From 040037ad3ace38b95f486640753e8084501b232e Mon Sep 17 00:00:00 2001 From: Stephen Gaito Date: Sun, 31 May 2020 13:58:56 +0100 Subject: [PATCH 1/7] begun work on reintroducing building debian packages --- buildScripts/createDebianPackage | 156 ++++++++++++++++ debian/changelog | 311 +++++++++++++++++++++++++++++++ debian/compat | 1 + debian/control | 14 ++ debian/copyright | 23 +++ debian/dirs | 1 + debian/pdf2htmlex.NEWS | 0 debian/pdf2htmlex.README | 1 + debian/pdf2htmlex.TODO | 0 debian/rules | 14 ++ debian/source/format | 2 + 11 files changed, 523 insertions(+) create mode 100755 buildScripts/createDebianPackage create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/dirs create mode 100644 debian/pdf2htmlex.NEWS create mode 100644 debian/pdf2htmlex.README create mode 100644 debian/pdf2htmlex.TODO create mode 100755 debian/rules create mode 100644 debian/source/format diff --git a/buildScripts/createDebianPackage b/buildScripts/createDebianPackage new file mode 100755 index 0000000..a100f6b --- /dev/null +++ b/buildScripts/createDebianPackage @@ -0,0 +1,156 @@ +#!/usr/bin/env python + +""" +Dirty script for building package for PPA +by WangLu +2011.01.13 + +modified for pdf2htmlEX +2012.08.28 + +modified for general git repo +2013.05.30 +""" + +import os +import sys +import re +import time + +package='pdf2htmlex' +ppa_name='ppa:pdf2htmlex/pdf2htmlex' +supported_distributions=('disco',) +dist_pattern=re.compile('|'.join(['\\) '+i for i in supported_distributions])) +archive_cmd='(rm CMakeCache.txt || true) && cmake . && make dist' +archive_suffix='.tar.bz2' + +if os.path.exists('../build-area'): + sys.stdout.write('Build area already exists, delete to continue?(y/n)') + sys.stdout.flush() + ans = raw_input().lower() + while ans not in ['y', 'n']: + sys.stdout.write('I don\'t understand, enter \'y\' or \'n\':') + ans = raw_input().lower() + + if ans == 'n': + print 'Skipped.' + sys.exit(0) + + if os.system('rm -rf ../build-area') != 0: + print 'Failed to clean up old build directory' + sys.exit(-1) + +print 'Generating version...' +try: + version = re.findall(r'set\(PDF2HTMLEX_VERSION\s*"([^"]*)"\)', open('CMakeLists.txt').read())[0] +except: + print 'Cannot get package name and version number' + sys.exit(-1) + +try: + rev = open('.git/refs/heads/master').read()[:5] +except: + print 'Cannot get revision number' + sys.exit(-1) + +projectdir=os.getcwd() +today_timestr = time.strftime('%Y%m%d') +deb_version = version+'-1~git'+today_timestr+'r'+rev +full_deb_version = deb_version+'-0ubuntu1' + +print 'Version: %s' % (version,) +print 'Full Version: %s' % (full_deb_version,) + +#check if we need to update debian/changelog +with open('debian/changelog') as f: + if re.findall(r'\(([^)]+)\)', f.readline())[0] == full_deb_version: + print + print 'No need to update debian/changelog, skipping' + else: + print + print 'Writing debian/changelog' + if os.system('dch -v "%s"' % (full_deb_version,)) != 0: + print 'Failed when updating debian/changelog' + sys.exit(-1) + +# changelog may have been updated, reopen it +with open('debian/changelog') as f: + #check dist mark of changelog + changelog = f.read() + m = dist_pattern.search(changelog) + if m is None or m.pos >= changelog.find('\n'): + print 'Cannot locate the dist name in the first line of changelog' + sys.exit(-1) + +print +print 'Preparing build ...' +# handling files +if os.system(archive_cmd) != 0: + print 'Failed in creating tarball' + sys.exit(-1) + +orig_tar_filename = package+'-'+version+archive_suffix +os.mkdir('../build-area') +if os.system('test -e %s && cp %s ../build-area/' % (orig_tar_filename, orig_tar_filename)) != 0: + print 'Cannot copy tarball file to build area' + sys.exit(-1) + +deb_orig_tar_filename = package+'_'+deb_version+'.orig'+archive_suffix +try: + os.chdir('../build-area') +except: + print 'Cannot find ../build-area' + sys.exit(-1) + +# remove old dir +os.system('rm -rf %s' % (package+'-'+version,)) + +if os.system('mv %s %s && tar -xvf %s' % (orig_tar_filename, deb_orig_tar_filename, deb_orig_tar_filename)) != 0: + print 'Cannot extract tarball' + sys.exit(-1) + +try: + os.chdir(package+'-'+version) +except: + print 'Cannot enter project dir' + sys.exit(-1) + +os.system('cp -r %s/debian .' % (projectdir,)) + +for cur_dist in supported_distributions: + print + print 'Building for ' + cur_dist + ' ...' + # substitute distribution name + with open('debian/changelog', 'w') as f: + f.write(dist_pattern.sub('~%s1) %s' % (cur_dist, cur_dist), changelog, 1)) + +# No PPA Orginization set up, only building dpkg +# # building for ppa +# if os.system('debuild -S -sa') != 0: +# print 'Failed in debuild' +# sys.exit(-1) +# +# print +# sys.stdout.write('Everything seems to be good so far, upload?(y/n)') +# sys.stdout.flush() +# ans = raw_input().lower() +# while ans not in ['y', 'n']: +# sys.stdout.write('I don\'t understand, enter \'y\' or \'n\':') +# ans = raw_input().lower() +# +# if ans == 'n': +# print 'Skipped.' +# sys.exit(0) +# +# print 'Uploading' +# if os.system('dput %s ../%s' % (ppa_name, package+'_'+full_deb_version+'~'+cur_dist+'1_source.changes')) != 0: +# print 'Failed in uploading by dput' +# sys.exit(-1) + + # building for dpkg + if os.system('dpkg-buildpackage -b --no-sign') != 0: + print 'Failed in dpkg-buildpackage' + sys.exit(-1) + +print 'Build area not cleaned.' +print 'All done. Cool!' diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..4601bfc --- /dev/null +++ b/debian/changelog @@ -0,0 +1,311 @@ +pdf2htmlex (0.18.7-1~git20190927rb69b8-0ubuntu1) disco; urgency=low + + * Package for poppler-0.81.0 + + -- Stephen Gaito Fri, 27 Sep 2019 12:55:39 +0000 + +pdf2htmlex (0.18.6-1~git20190927r583b1-0ubuntu1) disco; urgency=low + + * Package for poppler-0.80.0 + + -- Stephen Gaito Fri, 27 Sep 2019 11:58:57 +0000 + +pdf2htmlex (0.18.5-1~git20190927rdb4cc-0ubuntu1) disco; urgency=low + + * Package for poppler-0.79.0 + + -- Stephen Gaito Fri, 27 Sep 2019 09:12:53 +0000 + +pdf2htmlex (0.18.4-1~git20190927r34bac-0ubuntu1) disco; urgency=low + + * Package for poppler-0.78.0 + + -- Stephen Gaito Fri, 27 Sep 2019 07:46:26 +0000 + +pdf2htmlex (0.18.3-1~git20190926r7ed19-0ubuntu1) disco; urgency=low + + * Package for poppler-0.77.0 + + -- Stephen Gaito Thu, 26 Sep 2019 17:56:51 +0000 + +pdf2htmlex (0.18.2-1~git20190926ra37f7-0ubuntu1) disco; urgency=low + + * Package for poppler-0.76.0 + + -- Stephen Gaito Thu, 26 Sep 2019 15:29:27 +0000 + +pdf2htmlex (0.18.1-1~git20190926r11e2a-0ubuntu1) disco; urgency=low + + * Package for poppler-0.75.0 + + -- Stephen Gaito Thu, 26 Sep 2019 10:59:59 +0000 + +pdf2htmlex (0.18.0-1~git20190924r37921-0ubuntu1) disco; urgency=medium + + * Package for Ubuntu 19.04 (poppler-0.74.0) + + -- Stephen Gaito Tue, 24 Sep 2019 14:56:03 +0000 + +pdf2htmlex (0.17.0-1~git20190924r37921-0ubuntu1) cosmic; urgency=low + + * Package for 18.10 (poppler-0.68.0) + + -- Stephen Gaito Tue, 24 Sep 2019 10:32:08 +0000 + +pdf2htmlex (0.16.0-1~git20190920r21a9f-0ubuntu1) bionic; urgency=low + + * Package for 18.04 + + -- Trent Petersen Thu, 19 Sep 2019 10:33:35 -0500 + +pdf2htmlex (0.11-1~git201311150048r23755-0ubuntu1) saucy; urgency=low + + * Fix packaging + + -- WANG Lu Fri, 15 Nov 2013 00:48:06 +0800 + +pdf2htmlex (0.11-1~git201311042119refddc-0ubuntu1) saucy; urgency=low + + * Packaging for 13.10 + + -- WANG Lu Mon, 04 Nov 2013 21:19:41 +0800 + +pdf2htmlex (0.11-1~git201310172203re1b11-0ubuntu1) raring; urgency=low + + * Fix typo in dependencies + + -- WANG Lu Thu, 17 Oct 2013 22:03:42 +0800 + +pdf2htmlex (0.10-1~git201310171220rc344e-0ubuntu1) raring; urgency=low + + * Fix build + + -- WANG Lu Thu, 17 Oct 2013 12:20:59 +0800 + +pdf2htmlex (0.10-1~git201310171209rdc970-0ubuntu1) raring; urgency=low + + * v0.10 released, see Changelog + + -- WANG Lu Thu, 17 Oct 2013 12:09:01 +0800 + +pdf2htmlex (0.9-1~git201309161133rd60eb-0ubuntu1) raring; urgency=low + + * fix cmake test for packaging + + -- WANG Lu Mon, 16 Sep 2013 11:33:11 +0800 + +pdf2htmlex (0.9-1~git201309161021rf2993-0ubuntu1) raring; urgency=low + + * v0.9 released, see Changelog + + -- WANG Lu Mon, 16 Sep 2013 10:21:05 +0800 + +pdf2htmlex (0.9-1~git201305291247rf655a-0ubuntu1) raring; urgency=low + + * Regular upload + + -- WANG Lu Wed, 29 May 2013 12:47:16 +0800 + +pdf2htmlex (0.8-1~git201305051429r92eab-0ubuntu1) raring; urgency=low + + * v0.8 released, see Changelog + + -- WANG Lu Sun, 05 May 2013 14:29:07 +0800 + +pdf2htmlex (0.8-1~git201304281550rd5f9c-0ubuntu1) raring; urgency=low + + * Test packaging for multiple distributions + * Fix crashing with --split-pages + + -- WANG Lu Sun, 28 Apr 2013 15:39:34 +0800 + +pdf2htmlex (0.8-1~git201304151420r1da9b-0ubuntu1) quantal; urgency=low + + * HTML optimization + * New options: --optimize-text, --fallabck + * See more in Changelog + + -- WANG Lu Mon, 15 Apr 2013 14:20:22 +0800 + +pdf2htmlex (0.8-1~git201303011406r3bc73-0ubuntu1) quantal; urgency=low + + * Experimental printing support + * New version + + -- WANG Lu Fri, 01 Mar 2013 14:06:42 +0800 + +pdf2htmlex (0.7-1~git201302282259r3bc73-0ubuntu1) quantal; urgency=low + + * suggests ttfautohint + + -- WANG Lu Thu, 28 Feb 2013 22:59:45 +0800 + +pdf2htmlex (0.7-1~git201302271054r3bc73-0ubuntu1) precise; urgency=low + + * Packaging for 12.04 + + -- WANG Lu Wed, 27 Feb 2013 10:54:12 +0800 + +pdf2htmlex (0.7-1~git201302271053r3bc73-0ubuntu1) quantal; urgency=low + + * Fix packpage dependency + + -- WANG Lu Wed, 27 Feb 2013 10:52:17 +0800 + +pdf2htmlex (0.7-1~git201302270111r3bc73-0ubuntu1) quantal; urgency=low + + * Regular upload + + -- WANG Lu Wed, 27 Feb 2013 01:11:56 +0800 + +pdf2htmlex (0.7-1~git201302182049r3bc73-0ubuntu1) quantal; urgency=low + + * New parameter: process-outline + + -- WANG Lu Mon, 18 Feb 2013 20:49:57 +0800 + +pdf2htmlex (0.7-1~git201301292229r2595c-0ubuntu1) quantal; urgency=low + + * Fixed a CSS issue + + -- WANG Lu Tue, 29 Jan 2013 22:29:21 +0800 + +pdf2htmlex (0.7-1~git201301282229r2595c-0ubuntu1) quantal; urgency=low + + * Process PDF Outline + + -- WANG Lu Mon, 28 Jan 2013 22:29:35 +0800 + +pdf2htmlex (0.7-1~git201301261427r2595c-0ubuntu1) quantal; urgency=low + + * New version, see Changelog for changelog + + -- WANG Lu Sat, 26 Jan 2013 14:27:18 +0800 + +pdf2htmlex (0.6-1~git201212182148rd76af-0ubuntu1) quantal; urgency=low + + * fix dependency of poppler for quantal + + -- WANG Lu Tue, 18 Dec 2012 21:48:35 +0800 + +pdf2htmlex (0.6-1~git201212111844rd76af-0ubuntu1) quantal; urgency=low + + * Package for quantal + + -- WANG Lu Tue, 11 Dec 2012 18:44:44 +0800 + +pdf2htmlex (0.6-1~git201210070052rcb9a8-0ubuntu1) precise; urgency=low + + * New version + + -- WANG Lu Sun, 07 Oct 2012 00:52:42 +0800 + +pdf2htmlex (0.5-1~git201210051800rbaa37-0ubuntu1) precise; urgency=low + + * Regularly re-packing. + + -- WANG Lu Fri, 05 Oct 2012 18:00:48 +0800 + +pdf2htmlex (0.5-1~git201209270317r6fa14-0ubuntu1) precise; urgency=low + + * Regularly re-packing. + + -- WANG Lu Thu, 27 Sep 2012 03:17:02 +0800 + +pdf2htmlex (0.5-1~git201209261622r170a0-0ubuntu1) precise; urgency=low + + * new version + + -- WANG Lu Wed, 26 Sep 2012 16:22:50 +0800 + +pdf2htmlex (0.4-1~git201209241628r30aee-0ubuntu1) precise; urgency=low + + * Regularly re-packing. + + -- WANG Lu Mon, 24 Sep 2012 16:28:18 +0800 + +pdf2htmlex (0.4-1~git201209170124r8b4ec-0ubuntu1) precise; urgency=low + + * Regularly re-packing. + + -- WANG Lu Mon, 17 Sep 2012 01:24:29 +0800 + +pdf2htmlex (0.4-1~git201209162328r8b4ec-0ubuntu1) precise; urgency=low + + * Regularly re-packing. + + -- WANG Lu Sun, 16 Sep 2012 23:28:03 +0800 + +pdf2htmlex (0.3-1~git201209152353rf02e1-0ubuntu1) precise; urgency=low + + * Regularly re-packing. + + -- WANG Lu Sat, 15 Sep 2012 23:53:43 +0800 + +pdf2htmlex (0.3-1~git201209071504ra0de6-0ubuntu1) precise; urgency=low + + * fix build + * 0.3 comes with more bug fixed + + -- WANG Lu Fri, 07 Sep 2012 15:04:09 +0800 + +pdf2htmlex (0.2-3~git201209052329rbc256-0ubuntu1) precise; urgency=low + + * Change dependency of fontforge + + -- WANG Lu Wed, 05 Sep 2012 23:29:49 +0800 + +pdf2htmlex (0.2-3~git201209030158r926cf-0ubuntu1) precise; urgency=low + + * Fix dependency of libpoppler27 + + -- WANG Lu Mon, 03 Sep 2012 01:58:42 +0800 + +pdf2htmlex (0.2-3~git201209010002rfe7b3-0ubuntu1) precise; urgency=low + + * update license + + -- WANG Lu Sat, 01 Sep 2012 00:02:23 +0800 + +pdf2htmlex (0.2-3~git201208312351rd12b8-0ubuntu1) precise; urgency=low + + * 0.2dev, many bugs fixed + + -- WANG Lu Fri, 31 Aug 2012 23:51:57 +0800 + +pdf2htmlex (0.1-3~git201208281638r1addb-0ubuntu1) precise; urgency=low + + * Add debian files + + -- WANG Lu Tue, 28 Aug 2012 16:38:19 +0800 + +pdf2htmlex (0.1-3~git201208281523r80dc3-0ubuntu1) precise; urgency=low + + * Add dependency libpng + + -- WANG Lu Tue, 28 Aug 2012 15:22:22 +0800 + +pdf2htmlex (0.1-3~git201208281431r383b1-0ubuntu1) precise; urgency=low + + * Updated CMakeList.txt + + -- WANG Lu Tue, 28 Aug 2012 14:29:43 +0800 + +pdf2htmlex (0.1-3~git201208281420rc53d7-0ubuntu1) precise; urgency=low + + * Added config.h.in + + -- WANG Lu Tue, 28 Aug 2012 14:06:22 +0800 + +pdf2htmlex (0.1-3~git201208281356r5731e-0ubuntu1) precise; urgency=low + + * Fix version for package + + -- WANG Lu Tue, 28 Aug 2012 13:46:09 +0800 + +pdf2htmlex (0.1-1~git20120828rf083f-0ubuntu1) precise; urgency=low + + * Initial release. + + -- WANG Lu Tue, 28 Aug 2012 01:26:33 +0800 + diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..f599e28 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +10 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..673bc9a --- /dev/null +++ b/debian/control @@ -0,0 +1,14 @@ +Source: pdf2htmlex +Section: universe/web +Priority: extra +Maintainer: Trent Petersen +Build-Depends: cmake (>= 2.6.0), pkg-config, debhelper (>= 10), libpoppler-dev (>= 0.20.3), libpng-dev, libjpeg-dev, libfontforge-dev, libspiro-dev, python-dev, openjdk-8-jre-headless +Standards-Version: 3.9.3 +Homepage: http://github.com/pdf2htmlEX/pdf2htmlEX + +Package: pdf2htmlex +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Suggests: ttfautohint +Description: Converts PDF to HTML without losing format + pdf2htmlEX converts PDF to HTML while retaining text, format & style as much as possible diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..836b598 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,23 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: pdf2htmlEX +Upstream-Contact: WANG Lu . +Source: http://github.com/pdf2htmlEX/pdf2htmlEX + +Files: * +Copyright: 2012 WANG Lu +License: GPL-3+ + +License: GPL-3 + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + diff --git a/debian/dirs b/debian/dirs new file mode 100644 index 0000000..e772481 --- /dev/null +++ b/debian/dirs @@ -0,0 +1 @@ +usr/bin diff --git a/debian/pdf2htmlex.NEWS b/debian/pdf2htmlex.NEWS new file mode 100644 index 0000000..e69de29 diff --git a/debian/pdf2htmlex.README b/debian/pdf2htmlex.README new file mode 100644 index 0000000..b43bf86 --- /dev/null +++ b/debian/pdf2htmlex.README @@ -0,0 +1 @@ +README.md diff --git a/debian/pdf2htmlex.TODO b/debian/pdf2htmlex.TODO new file mode 100644 index 0000000..e69de29 diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..26ba418 --- /dev/null +++ b/debian/rules @@ -0,0 +1,14 @@ +#!/usr/bin/make -f +%: + dh $@ + +override_dh_auto_test: + dh_auto_test || true + +# The following override is required when creating a Debian package +# associated with a version of poppler which has NO debian package (ie when +# poppler has been compiled and installed from source). +# +override_dh_shlibdeps: + dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info + diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..c3d9f24 --- /dev/null +++ b/debian/source/format @@ -0,0 +1,2 @@ +3.0 (quilt) + From 30ffdeeea4297ba2703ebc5868c5f9d43714cbd6 Mon Sep 17 00:00:00 2001 From: Stephen Gaito Date: Sun, 31 May 2020 15:18:57 +0000 Subject: [PATCH 2/7] initial work on packaging debian old script too complex and does not work with new build system --- buildScripts/createDebianPackage | 64 +++++++++++++++++++++----------- buildScripts/getBuildToolsApt | 3 ++ debian/changelog | 6 +++ debian/control | 2 +- 4 files changed, 53 insertions(+), 22 deletions(-) diff --git a/buildScripts/createDebianPackage b/buildScripts/createDebianPackage index a100f6b..7f5054c 100755 --- a/buildScripts/createDebianPackage +++ b/buildScripts/createDebianPackage @@ -12,6 +12,25 @@ modified for general git repo 2013.05.30 """ +# CONSIDER PORTING to either BASH or PERL (as used by dpkg-buldpackage) +# CONSIDER BINARY ONLY PACKAGE based on appDir or docerDir +# +# See: https://blog.serverdensity.com/how-to-create-a-debian-deb-package/ +# See: http://www.sj-vs.net/creating-a-simple-debian-deb-package-based-on-a-directory-structure/ +# See: https://unix.stackexchange.com/questions/30303/how-to-create-a-deb-file-manually +# See: https://askubuntu.com/questions/1130558/how-to-build-deb-package-for-ubuntu-18-04 +# See: https://blog.knoldus.com/create-a-debian-package-using-dpkg-deb-tool/ +# See: http://www.tldp.org/HOWTO/html_single/Debian-Binary-Package-Building-HOWTO/ +# See: https://coderwall.com/p/urkybq/how-to-create-debian-package-from-source +# +# NOTES: +# 1. Should use something to force update of changelog +# 2. How best to compute dpkg version +# 3. Distribute only binary package (no source package -- link to main github repo) +# 4. Use ppa: https://launchpad.net/~pdf2htmlex/+archive/ubuntu/pdf2htmlex +# 5. Rename poppler-data destination to poppler-pdf2htmlEX +# 6. Ensure source code location of poppler-data has been updated + import os import sys import re @@ -21,28 +40,31 @@ package='pdf2htmlex' ppa_name='ppa:pdf2htmlex/pdf2htmlex' supported_distributions=('disco',) dist_pattern=re.compile('|'.join(['\\) '+i for i in supported_distributions])) -archive_cmd='(rm CMakeCache.txt || true) && cmake . && make dist' +archive_cmd='cd pdf2htmlEX/build && (rm CMakeCache.txt || true) && cmake .. && make dist' archive_suffix='.tar.bz2' -if os.path.exists('../build-area'): - sys.stdout.write('Build area already exists, delete to continue?(y/n)') - sys.stdout.flush() - ans = raw_input().lower() - while ans not in ['y', 'n']: - sys.stdout.write('I don\'t understand, enter \'y\' or \'n\':') - ans = raw_input().lower() - - if ans == 'n': - print 'Skipped.' - sys.exit(0) - - if os.system('rm -rf ../build-area') != 0: - print 'Failed to clean up old build directory' - sys.exit(-1) +#if os.path.exists('imageBuild/debianDir'): +# sys.stdout.write('Build area already exists, delete to continue?(y/n)') +# sys.stdout.flush() +# ans = raw_input().lower() +# while ans not in ['y', 'n']: +# sys.stdout.write('I don\'t understand, enter \'y\' or \'n\':') +# ans = raw_input().lower() +# +# if ans == 'n': +# print 'Skipped.' +# sys.exit(0) +# +if os.system('rm -rf imageBuild/debianDir') != 0: + print 'Failed to clean up old build directory' + sys.exit(-1) print 'Generating version...' try: - version = re.findall(r'set\(PDF2HTMLEX_VERSION\s*"([^"]*)"\)', open('CMakeLists.txt').read())[0] + version = re.findall( + r'set\(PDF2HTMLEX_VERSION\s*"([^"]*)"\)', + open('pdf2htmlEX/CMakeLists.txt').read() + )[0] except: print 'Cannot get package name and version number' sys.exit(-1) @@ -90,16 +112,16 @@ if os.system(archive_cmd) != 0: sys.exit(-1) orig_tar_filename = package+'-'+version+archive_suffix -os.mkdir('../build-area') -if os.system('test -e %s && cp %s ../build-area/' % (orig_tar_filename, orig_tar_filename)) != 0: +os.mkdir('imageBuild/debianDir') +if os.system('test -e pdf2htmlEX/build/%s && cp pdf2htmlEX/build/%s imageBuild/debianDir/' % (orig_tar_filename, orig_tar_filename)) != 0: print 'Cannot copy tarball file to build area' sys.exit(-1) deb_orig_tar_filename = package+'_'+deb_version+'.orig'+archive_suffix try: - os.chdir('../build-area') + os.chdir('imageBuild/debianDir') except: - print 'Cannot find ../build-area' + print 'Cannot find imageBuild/debianDir' sys.exit(-1) # remove old dir diff --git a/buildScripts/getBuildToolsApt b/buildScripts/getBuildToolsApt index 97acf12..9ed4d38 100755 --- a/buildScripts/getBuildToolsApt +++ b/buildScripts/getBuildToolsApt @@ -24,6 +24,9 @@ sudo apt-get $UNATTENDED install \ make \ gcc \ g++ \ + build-essential \ + dpkg-dev \ + devscripts \ gettext \ openjdk-8-jre-headless \ jq \ diff --git a/debian/changelog b/debian/changelog index 4601bfc..b77562a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +pdf2htmlex (0.18.7-1~git20200531r3fcd0-0ubuntu1) UNRELEASED; urgency=medium + + * test packaging + + -- Stephen Gaito Sun, 31 May 2020 13:38:59 +0000 + pdf2htmlex (0.18.7-1~git20190927rb69b8-0ubuntu1) disco; urgency=low * Package for poppler-0.81.0 diff --git a/debian/control b/debian/control index 673bc9a..7c0a227 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: pdf2htmlex Section: universe/web Priority: extra Maintainer: Trent Petersen -Build-Depends: cmake (>= 2.6.0), pkg-config, debhelper (>= 10), libpoppler-dev (>= 0.20.3), libpng-dev, libjpeg-dev, libfontforge-dev, libspiro-dev, python-dev, openjdk-8-jre-headless +Build-Depends: cmake (>= 2.6.0), pkg-config, debhelper (>= 10), libpng-dev, libjpeg-dev, openjdk-8-jre-headless Standards-Version: 3.9.3 Homepage: http://github.com/pdf2htmlEX/pdf2htmlEX From 1b7bab3e2d2f96437ab340ec1ccbf6882a5fc7ba Mon Sep 17 00:00:00 2001 From: Stephen Gaito Date: Sun, 31 May 2020 18:34:48 +0000 Subject: [PATCH 3/7] begun rearranging poppler-data-dir --- buildScripts/createAppImage | 5 ++++- buildScripts/createDockerImage | 5 ++++- buildScripts/installPdf2htmlEX | 9 +++++++++ pdf2htmlEX/src/pdf2htmlEX.cc | 3 ++- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/buildScripts/createAppImage b/buildScripts/createAppImage index e9fd107..90ff685 100755 --- a/buildScripts/createAppImage +++ b/buildScripts/createAppImage @@ -27,7 +27,10 @@ make install DESTDIR=../../imageBuild/appDir cd ../../poppler-data -make install prefix=$PDF2HTMLEX_PREFIX DESTDIR=../imageBuild/appDir +make install \ + prefix=$PDF2HTMLEX_PREFIX \ + datadir=$PDF2HTMLEX_PREFIX/share/pdf2htmlEX \ + DESTDIR=../imageBuild/appDir cd ../imageBuild diff --git a/buildScripts/createDockerImage b/buildScripts/createDockerImage index c33f74d..5fddea5 100755 --- a/buildScripts/createDockerImage +++ b/buildScripts/createDockerImage @@ -25,7 +25,10 @@ make install DESTDIR=../../imageBuild/dockerDir cd ../../poppler-data -make install prefix=$PDF2HTMLEX_PREFIX DESTDIR=../imageBuild/dockerDir +make install \ + prefix=$PDF2HTMLEX_PREFIX \ + datadir=$PDF2HTMLEX_PREFIX/share/pdf2htmlEX \ + DESTDIR=../imageBuild/appDir cd ../imageBuild/dockerDir diff --git a/buildScripts/installPdf2htmlEX b/buildScripts/installPdf2htmlEX index c3b861e..c2e6021 100755 --- a/buildScripts/installPdf2htmlEX +++ b/buildScripts/installPdf2htmlEX @@ -20,3 +20,12 @@ fi cd pdf2htmlEX/build sudo make install + +## NEED to install poppler-data!!! +# +cd ../../poppler-data + +make install \ + prefix=$PDF2HTMLEX_PREFIX \ + datadir=$PDF2HTMLEX_PREFIX/share/pdf2htmlEX \ + DESTDIR=../imageBuild/appDir diff --git a/pdf2htmlEX/src/pdf2htmlEX.cc b/pdf2htmlEX/src/pdf2htmlEX.cc index 8d805b2..4ee1633 100644 --- a/pdf2htmlEX/src/pdf2htmlEX.cc +++ b/pdf2htmlEX/src/pdf2htmlEX.cc @@ -68,6 +68,7 @@ void show_version_and_exit(const char * dummy = nullptr) cerr << " cairo " << cairo_version_string() << endl; #endif cerr << "Default data-dir: " << param.data_dir << endl; + cerr << "Poppler data-dir: " << param.poppler_data_dir << endl; cerr << "Supported image format:"; #ifdef ENABLE_LIBPNG cerr << " png"; @@ -378,7 +379,7 @@ int main(int argc, char **argv) // param.data_dir = string(getenv("APPDIR")) + param.data_dir; } - + param.poppler_data_dir = param.data_dir + "/poppler" parse_options(argc, argv); check_param(); From a73211fb9b4a932950627195d2ace0fd8a63467c Mon Sep 17 00:00:00 2001 From: Stephen Gaito Date: Mon, 1 Jun 2020 07:49:30 +0000 Subject: [PATCH 4/7] provisional commit of scripts to build debian package --- archive/createDebianPackage | 178 +++++++++++++++++++++++ buildScripts/createDebianPackage | 242 ++++++++++--------------------- buildScripts/createDockerImage | 2 +- buildScripts/getBuildToolsApt | 4 +- buildScripts/getDevLibrariesApt | 7 - buildScripts/installPdf2htmlEX | 3 +- pdf2htmlEX/src/pdf2htmlEX.cc | 2 +- 7 files changed, 260 insertions(+), 178 deletions(-) create mode 100755 archive/createDebianPackage diff --git a/archive/createDebianPackage b/archive/createDebianPackage new file mode 100755 index 0000000..7f5054c --- /dev/null +++ b/archive/createDebianPackage @@ -0,0 +1,178 @@ +#!/usr/bin/env python + +""" +Dirty script for building package for PPA +by WangLu +2011.01.13 + +modified for pdf2htmlEX +2012.08.28 + +modified for general git repo +2013.05.30 +""" + +# CONSIDER PORTING to either BASH or PERL (as used by dpkg-buldpackage) +# CONSIDER BINARY ONLY PACKAGE based on appDir or docerDir +# +# See: https://blog.serverdensity.com/how-to-create-a-debian-deb-package/ +# See: http://www.sj-vs.net/creating-a-simple-debian-deb-package-based-on-a-directory-structure/ +# See: https://unix.stackexchange.com/questions/30303/how-to-create-a-deb-file-manually +# See: https://askubuntu.com/questions/1130558/how-to-build-deb-package-for-ubuntu-18-04 +# See: https://blog.knoldus.com/create-a-debian-package-using-dpkg-deb-tool/ +# See: http://www.tldp.org/HOWTO/html_single/Debian-Binary-Package-Building-HOWTO/ +# See: https://coderwall.com/p/urkybq/how-to-create-debian-package-from-source +# +# NOTES: +# 1. Should use something to force update of changelog +# 2. How best to compute dpkg version +# 3. Distribute only binary package (no source package -- link to main github repo) +# 4. Use ppa: https://launchpad.net/~pdf2htmlex/+archive/ubuntu/pdf2htmlex +# 5. Rename poppler-data destination to poppler-pdf2htmlEX +# 6. Ensure source code location of poppler-data has been updated + +import os +import sys +import re +import time + +package='pdf2htmlex' +ppa_name='ppa:pdf2htmlex/pdf2htmlex' +supported_distributions=('disco',) +dist_pattern=re.compile('|'.join(['\\) '+i for i in supported_distributions])) +archive_cmd='cd pdf2htmlEX/build && (rm CMakeCache.txt || true) && cmake .. && make dist' +archive_suffix='.tar.bz2' + +#if os.path.exists('imageBuild/debianDir'): +# sys.stdout.write('Build area already exists, delete to continue?(y/n)') +# sys.stdout.flush() +# ans = raw_input().lower() +# while ans not in ['y', 'n']: +# sys.stdout.write('I don\'t understand, enter \'y\' or \'n\':') +# ans = raw_input().lower() +# +# if ans == 'n': +# print 'Skipped.' +# sys.exit(0) +# +if os.system('rm -rf imageBuild/debianDir') != 0: + print 'Failed to clean up old build directory' + sys.exit(-1) + +print 'Generating version...' +try: + version = re.findall( + r'set\(PDF2HTMLEX_VERSION\s*"([^"]*)"\)', + open('pdf2htmlEX/CMakeLists.txt').read() + )[0] +except: + print 'Cannot get package name and version number' + sys.exit(-1) + +try: + rev = open('.git/refs/heads/master').read()[:5] +except: + print 'Cannot get revision number' + sys.exit(-1) + +projectdir=os.getcwd() +today_timestr = time.strftime('%Y%m%d') +deb_version = version+'-1~git'+today_timestr+'r'+rev +full_deb_version = deb_version+'-0ubuntu1' + +print 'Version: %s' % (version,) +print 'Full Version: %s' % (full_deb_version,) + +#check if we need to update debian/changelog +with open('debian/changelog') as f: + if re.findall(r'\(([^)]+)\)', f.readline())[0] == full_deb_version: + print + print 'No need to update debian/changelog, skipping' + else: + print + print 'Writing debian/changelog' + if os.system('dch -v "%s"' % (full_deb_version,)) != 0: + print 'Failed when updating debian/changelog' + sys.exit(-1) + +# changelog may have been updated, reopen it +with open('debian/changelog') as f: + #check dist mark of changelog + changelog = f.read() + m = dist_pattern.search(changelog) + if m is None or m.pos >= changelog.find('\n'): + print 'Cannot locate the dist name in the first line of changelog' + sys.exit(-1) + +print +print 'Preparing build ...' +# handling files +if os.system(archive_cmd) != 0: + print 'Failed in creating tarball' + sys.exit(-1) + +orig_tar_filename = package+'-'+version+archive_suffix +os.mkdir('imageBuild/debianDir') +if os.system('test -e pdf2htmlEX/build/%s && cp pdf2htmlEX/build/%s imageBuild/debianDir/' % (orig_tar_filename, orig_tar_filename)) != 0: + print 'Cannot copy tarball file to build area' + sys.exit(-1) + +deb_orig_tar_filename = package+'_'+deb_version+'.orig'+archive_suffix +try: + os.chdir('imageBuild/debianDir') +except: + print 'Cannot find imageBuild/debianDir' + sys.exit(-1) + +# remove old dir +os.system('rm -rf %s' % (package+'-'+version,)) + +if os.system('mv %s %s && tar -xvf %s' % (orig_tar_filename, deb_orig_tar_filename, deb_orig_tar_filename)) != 0: + print 'Cannot extract tarball' + sys.exit(-1) + +try: + os.chdir(package+'-'+version) +except: + print 'Cannot enter project dir' + sys.exit(-1) + +os.system('cp -r %s/debian .' % (projectdir,)) + +for cur_dist in supported_distributions: + print + print 'Building for ' + cur_dist + ' ...' + # substitute distribution name + with open('debian/changelog', 'w') as f: + f.write(dist_pattern.sub('~%s1) %s' % (cur_dist, cur_dist), changelog, 1)) + +# No PPA Orginization set up, only building dpkg +# # building for ppa +# if os.system('debuild -S -sa') != 0: +# print 'Failed in debuild' +# sys.exit(-1) +# +# print +# sys.stdout.write('Everything seems to be good so far, upload?(y/n)') +# sys.stdout.flush() +# ans = raw_input().lower() +# while ans not in ['y', 'n']: +# sys.stdout.write('I don\'t understand, enter \'y\' or \'n\':') +# ans = raw_input().lower() +# +# if ans == 'n': +# print 'Skipped.' +# sys.exit(0) +# +# print 'Uploading' +# if os.system('dput %s ../%s' % (ppa_name, package+'_'+full_deb_version+'~'+cur_dist+'1_source.changes')) != 0: +# print 'Failed in uploading by dput' +# sys.exit(-1) + + # building for dpkg + if os.system('dpkg-buildpackage -b --no-sign') != 0: + print 'Failed in dpkg-buildpackage' + sys.exit(-1) + +print 'Build area not cleaned.' +print 'All done. Cool!' diff --git a/buildScripts/createDebianPackage b/buildScripts/createDebianPackage index 7f5054c..18a30dd 100755 --- a/buildScripts/createDebianPackage +++ b/buildScripts/createDebianPackage @@ -1,178 +1,92 @@ -#!/usr/bin/env python +#!/bin/bash -""" -Dirty script for building package for PPA -by WangLu -2011.01.13 +# This bash script creates a (binary) Debian Package Archive for pdf2htmlEX -modified for pdf2htmlEX -2012.08.28 +source ./buildScripts/reSourceVersionEnvs -modified for general git repo -2013.05.30 -""" +echo "" +echo "-------------------------------------------------------------------" +echo "CREATING pdf2htmlEX (binary) Debian package" +echo "-------------------------------------------------------------------" +echo "" -# CONSIDER PORTING to either BASH or PERL (as used by dpkg-buldpackage) -# CONSIDER BINARY ONLY PACKAGE based on appDir or docerDir +export DPKG_NAME="pdf2htmlEX-$PDF2HTMLEX_BRANCH-$BUILD_TIME-$MACHINE_ARCH-$(lsb_release -cs).deb" + +echo "export DPKG_NAME=\"$DPKG_NAME\"" >> buildScripts/reSourceVersionEnvs + +# Adapted from: https://blog.serverdensity.com/how-to-create-a-debian-deb-package/ +# and: http://www.sj-vs.net/creating-a-simple-debian-deb-package-based-on-a-directory-structure/ + +DEBDIR=imageBuild/debianDir +DOCDIR=$DEBDIR/usr/local/share/doc/pdf2htmlEX + +sudo rm -rf $DEBDIR +mkdir -p $DOCDIR + +# Install pdf2htmlEX # -# See: https://blog.serverdensity.com/how-to-create-a-debian-deb-package/ -# See: http://www.sj-vs.net/creating-a-simple-debian-deb-package-based-on-a-directory-structure/ -# See: https://unix.stackexchange.com/questions/30303/how-to-create-a-deb-file-manually -# See: https://askubuntu.com/questions/1130558/how-to-build-deb-package-for-ubuntu-18-04 -# See: https://blog.knoldus.com/create-a-debian-package-using-dpkg-deb-tool/ -# See: http://www.tldp.org/HOWTO/html_single/Debian-Binary-Package-Building-HOWTO/ -# See: https://coderwall.com/p/urkybq/how-to-create-debian-package-from-source +cd pdf2htmlEX/build # -# NOTES: -# 1. Should use something to force update of changelog -# 2. How best to compute dpkg version -# 3. Distribute only binary package (no source package -- link to main github repo) -# 4. Use ppa: https://launchpad.net/~pdf2htmlex/+archive/ubuntu/pdf2htmlex -# 5. Rename poppler-data destination to poppler-pdf2htmlEX -# 6. Ensure source code location of poppler-data has been updated +make install DESTDIR=../../$DEBDIR -import os -import sys -import re -import time - -package='pdf2htmlex' -ppa_name='ppa:pdf2htmlex/pdf2htmlex' -supported_distributions=('disco',) -dist_pattern=re.compile('|'.join(['\\) '+i for i in supported_distributions])) -archive_cmd='cd pdf2htmlEX/build && (rm CMakeCache.txt || true) && cmake .. && make dist' -archive_suffix='.tar.bz2' - -#if os.path.exists('imageBuild/debianDir'): -# sys.stdout.write('Build area already exists, delete to continue?(y/n)') -# sys.stdout.flush() -# ans = raw_input().lower() -# while ans not in ['y', 'n']: -# sys.stdout.write('I don\'t understand, enter \'y\' or \'n\':') -# ans = raw_input().lower() +# Install a copy of poppler-data for pdf2htmlEX's exclusive use # -# if ans == 'n': -# print 'Skipped.' -# sys.exit(0) +cd ../../poppler-data # -if os.system('rm -rf imageBuild/debianDir') != 0: - print 'Failed to clean up old build directory' - sys.exit(-1) +make install \ + prefix=$PDF2HTMLEX_PREFIX \ + datadir=$PDF2HTMLEX_PREFIX/share/pdf2htmlEX \ + DESTDIR=../$DEBDIR -print 'Generating version...' -try: - version = re.findall( - r'set\(PDF2HTMLEX_VERSION\s*"([^"]*)"\)', - open('pdf2htmlEX/CMakeLists.txt').read() - )[0] -except: - print 'Cannot get package name and version number' - sys.exit(-1) +cd .. -try: - rev = open('.git/refs/heads/master').read()[:5] -except: - print 'Cannot get revision number' - sys.exit(-1) - -projectdir=os.getcwd() -today_timestr = time.strftime('%Y%m%d') -deb_version = version+'-1~git'+today_timestr+'r'+rev -full_deb_version = deb_version+'-0ubuntu1' - -print 'Version: %s' % (version,) -print 'Full Version: %s' % (full_deb_version,) - -#check if we need to update debian/changelog -with open('debian/changelog') as f: - if re.findall(r'\(([^)]+)\)', f.readline())[0] == full_deb_version: - print - print 'No need to update debian/changelog, skipping' - else: - print - print 'Writing debian/changelog' - if os.system('dch -v "%s"' % (full_deb_version,)) != 0: - print 'Failed when updating debian/changelog' - sys.exit(-1) - -# changelog may have been updated, reopen it -with open('debian/changelog') as f: - #check dist mark of changelog - changelog = f.read() - m = dist_pattern.search(changelog) - if m is None or m.pos >= changelog.find('\n'): - print 'Cannot locate the dist name in the first line of changelog' - sys.exit(-1) - -print -print 'Preparing build ...' -# handling files -if os.system(archive_cmd) != 0: - print 'Failed in creating tarball' - sys.exit(-1) - -orig_tar_filename = package+'-'+version+archive_suffix -os.mkdir('imageBuild/debianDir') -if os.system('test -e pdf2htmlEX/build/%s && cp pdf2htmlEX/build/%s imageBuild/debianDir/' % (orig_tar_filename, orig_tar_filename)) != 0: - print 'Cannot copy tarball file to build area' - sys.exit(-1) - -deb_orig_tar_filename = package+'_'+deb_version+'.orig'+archive_suffix -try: - os.chdir('imageBuild/debianDir') -except: - print 'Cannot find imageBuild/debianDir' - sys.exit(-1) - -# remove old dir -os.system('rm -rf %s' % (package+'-'+version,)) - -if os.system('mv %s %s && tar -xvf %s' % (orig_tar_filename, deb_orig_tar_filename, deb_orig_tar_filename)) != 0: - print 'Cannot extract tarball' - sys.exit(-1) - -try: - os.chdir(package+'-'+version) -except: - print 'Cannot enter project dir' - sys.exit(-1) - -os.system('cp -r %s/debian .' % (projectdir,)) - -for cur_dist in supported_distributions: - print - print 'Building for ' + cur_dist + ' ...' - # substitute distribution name - with open('debian/changelog', 'w') as f: - f.write(dist_pattern.sub('~%s1) %s' % (cur_dist, cur_dist), changelog, 1)) - -# No PPA Orginization set up, only building dpkg -# # building for ppa -# if os.system('debuild -S -sa') != 0: -# print 'Failed in debuild' -# sys.exit(-1) +# Create a 'useful' changelog # -# print -# sys.stdout.write('Everything seems to be good so far, upload?(y/n)') -# sys.stdout.flush() -# ans = raw_input().lower() -# while ans not in ['y', 'n']: -# sys.stdout.write('I don\'t understand, enter \'y\' or \'n\':') -# ans = raw_input().lower() -# -# if ans == 'n': -# print 'Skipped.' -# sys.exit(0) -# -# print 'Uploading' -# if os.system('dput %s ../%s' % (ppa_name, package+'_'+full_deb_version+'~'+cur_dist+'1_source.changes')) != 0: -# print 'Failed in uploading by dput' -# sys.exit(-1) +git log --format="%cd %h %d %n %s%n" --date=short > $DOCDIR/gitLog - # building for dpkg - if os.system('dpkg-buildpackage -b --no-sign') != 0: - print 'Failed in dpkg-buildpackage' - sys.exit(-1) +######################################## +# setup the DEBIAN package files -print 'Build area not cleaned.' -print 'All done. Cool!' +controlFile=$DEBDIR/DEBIAN/control +conffilesFile=$DEBDIR/DEBIAN/conffiles +md5sumsFile=$DEBDIR/DEBIAN/md5sums + +mkdir -p $DEBDIR/DEBIAN + +# Create the md5sums file +# +find $DEBDIR -type f | xargs md5sum > $md5sumsFile + +# Accumulate the control file information +# +versionValue=$(git describe --abbrev=0) +releaseValue=$(lsb_release -cs) +architectureValue=$(dpkg-architecture -q DEB_BUILD_ARCH_CPU) +maintainerValue="$(git config --get user.name) <$(git config --get user.email)>" + +# Now create the control file +# +echo "Package: pdf2htmlEX" > $controlFile +echo "Version: 0:0.$versionValue-0" >> $controlFile +echo "Distribution: $releaseValue" >> $controlFile +echo "Architecture: $architectureValue" >> $controlFile +echo "Section: universe/web" >> $controlFile +echo "Priority: optional" >> $controlFile +echo "Essential: no" >> $controlFile +echo "Depends: libcairo2, libpng16-16, libjpeg-turbo8, libxml2" >> $controlFile +echo "Maintainer: $maintainerValue" >> $controlFile +echo "Homepage: http://github.com/pdf2htmlEX/pdf2htmlEX" >> $controlFile +echo "Description: Converts PDF to HTML without losing format" >> $controlFile +echo " pdf2htmlEX converts PDF to HTML while retaining text, format & style as much as possible" >> $controlFile + +# Create the (empty) conffiles +# +touch $conffilesFile + +# Finally create the debian archive +# +cd imageBuild +# +sudo chown -R root:root debianDir +# +dpkg --build debianDir $DPKG_NAME diff --git a/buildScripts/createDockerImage b/buildScripts/createDockerImage index 5fddea5..06591da 100755 --- a/buildScripts/createDockerImage +++ b/buildScripts/createDockerImage @@ -28,7 +28,7 @@ cd ../../poppler-data make install \ prefix=$PDF2HTMLEX_PREFIX \ datadir=$PDF2HTMLEX_PREFIX/share/pdf2htmlEX \ - DESTDIR=../imageBuild/appDir + DESTDIR=../imageBuild/dockerDir cd ../imageBuild/dockerDir diff --git a/buildScripts/getBuildToolsApt b/buildScripts/getBuildToolsApt index 9ed4d38..6d14b84 100755 --- a/buildScripts/getBuildToolsApt +++ b/buildScripts/getBuildToolsApt @@ -24,9 +24,7 @@ sudo apt-get $UNATTENDED install \ make \ gcc \ g++ \ - build-essential \ - dpkg-dev \ - devscripts \ + dpkg \ gettext \ openjdk-8-jre-headless \ jq \ diff --git a/buildScripts/getDevLibrariesApt b/buildScripts/getDevLibrariesApt index 3041050..91385cd 100755 --- a/buildScripts/getDevLibrariesApt +++ b/buildScripts/getDevLibrariesApt @@ -19,10 +19,3 @@ sudo apt-get $UNATTENDED install \ libpng-dev \ libjpeg-dev \ libxml2-dev \ - -# libspiro-dev \ -# libpango1.0-dev \ -# liblcms2-dev \ -# libuninameslist-dev \ -# python3-dev - diff --git a/buildScripts/installPdf2htmlEX b/buildScripts/installPdf2htmlEX index c2e6021..102f168 100755 --- a/buildScripts/installPdf2htmlEX +++ b/buildScripts/installPdf2htmlEX @@ -27,5 +27,4 @@ cd ../../poppler-data make install \ prefix=$PDF2HTMLEX_PREFIX \ - datadir=$PDF2HTMLEX_PREFIX/share/pdf2htmlEX \ - DESTDIR=../imageBuild/appDir + datadir=$PDF2HTMLEX_PREFIX/share/pdf2htmlEX diff --git a/pdf2htmlEX/src/pdf2htmlEX.cc b/pdf2htmlEX/src/pdf2htmlEX.cc index 4ee1633..7197e51 100644 --- a/pdf2htmlEX/src/pdf2htmlEX.cc +++ b/pdf2htmlEX/src/pdf2htmlEX.cc @@ -379,7 +379,7 @@ int main(int argc, char **argv) // param.data_dir = string(getenv("APPDIR")) + param.data_dir; } - param.poppler_data_dir = param.data_dir + "/poppler" + param.poppler_data_dir = param.data_dir + "/poppler"; parse_options(argc, argv); check_param(); From 82aeeac8c76e268c5f54c8a464ab8ad3bbe7fbaf Mon Sep 17 00:00:00 2001 From: Stephen Gaito Date: Mon, 1 Jun 2020 11:28:38 +0100 Subject: [PATCH 5/7] corrected debian dependencies for lack of libglib-2.0 --- buildScripts/createDebianPackage | 22 +++++++++++----------- pdf2htmlEX/CMakeLists.txt | 6 ------ 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/buildScripts/createDebianPackage b/buildScripts/createDebianPackage index 18a30dd..000554c 100755 --- a/buildScripts/createDebianPackage +++ b/buildScripts/createDebianPackage @@ -66,17 +66,17 @@ maintainerValue="$(git config --get user.name) <$(git config --get user.email)>" # Now create the control file # -echo "Package: pdf2htmlEX" > $controlFile -echo "Version: 0:0.$versionValue-0" >> $controlFile -echo "Distribution: $releaseValue" >> $controlFile -echo "Architecture: $architectureValue" >> $controlFile -echo "Section: universe/web" >> $controlFile -echo "Priority: optional" >> $controlFile -echo "Essential: no" >> $controlFile -echo "Depends: libcairo2, libpng16-16, libjpeg-turbo8, libxml2" >> $controlFile -echo "Maintainer: $maintainerValue" >> $controlFile -echo "Homepage: http://github.com/pdf2htmlEX/pdf2htmlEX" >> $controlFile -echo "Description: Converts PDF to HTML without losing format" >> $controlFile +echo "Package: pdf2htmlEX" > $controlFile +echo "Version: 0:0.$versionValue-0" >> $controlFile +echo "Distribution: $releaseValue" >> $controlFile +echo "Architecture: $architectureValue" >> $controlFile +echo "Section: universe/web" >> $controlFile +echo "Priority: optional" >> $controlFile +echo "Essential: no" >> $controlFile +echo "Depends: libglib2.0-0, libcairo2, libpng16-16, libjpeg-turbo8, libxml2" >> $controlFile +echo "Maintainer: $maintainerValue" >> $controlFile +echo "Homepage: http://github.com/pdf2htmlEX/pdf2htmlEX" >> $controlFile +echo "Description: Converts PDF to HTML without losing format" >> $controlFile echo " pdf2htmlEX converts PDF to HTML while retaining text, format & style as much as possible" >> $controlFile # Create the (empty) conffiles diff --git a/pdf2htmlEX/CMakeLists.txt b/pdf2htmlEX/CMakeLists.txt index 6bc37b1..29b52fd 100644 --- a/pdf2htmlEX/CMakeLists.txt +++ b/pdf2htmlEX/CMakeLists.txt @@ -91,12 +91,6 @@ set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} -lgio-2.0 ) -# -llcms2 -# -lz -# -llcms2 -# -lspiro -# -luninameslist - # debug build flags (overwrite default cmake debug flags) set(CMAKE_C_FLAGS_DEBUG "-ggdb -pg") set(CMAKE_CXX_FLAGS_DEBUG "-ggdb -pg") From ed2f9db9cb28b0bd47ee39ae2318dc2a61f3d710 Mon Sep 17 00:00:00 2001 From: Stephen Gaito Date: Mon, 1 Jun 2020 11:06:06 +0000 Subject: [PATCH 6/7] added createDebianPackage into createImages added Licenses corrected install of poppler-data --- buildScripts/createDebianPackage | 8 +++++++- buildScripts/createImages | 8 +++++--- buildScripts/installPdf2htmlEX | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/buildScripts/createDebianPackage b/buildScripts/createDebianPackage index 000554c..13546d3 100755 --- a/buildScripts/createDebianPackage +++ b/buildScripts/createDebianPackage @@ -44,6 +44,12 @@ cd .. # git log --format="%cd %h %d %n %s%n" --date=short > $DOCDIR/gitLog +# Ensure the license and readme details are embedded in the debian archive +# +cp LICENSE $DOCDIR +cp LICENSE_GPLv3 $DOCDIR +cp README.md $DOCDIR + ######################################## # setup the DEBIAN package files @@ -73,7 +79,7 @@ echo "Architecture: $architectureValue" >> $controlFile echo "Section: universe/web" >> $controlFile echo "Priority: optional" >> $controlFile echo "Essential: no" >> $controlFile -echo "Depends: libglib2.0-0, libcairo2, libpng16-16, libjpeg-turbo8, libxml2" >> $controlFile +echo "Depends: libglib2.0-0, libfreetype6, libfontconfig1, libcairo2, libpng16-16, libjpeg-turbo8, libxml2" >> $controlFile echo "Maintainer: $maintainerValue" >> $controlFile echo "Homepage: http://github.com/pdf2htmlEX/pdf2htmlEX" >> $controlFile echo "Description: Converts PDF to HTML without losing format" >> $controlFile diff --git a/buildScripts/createImages b/buildScripts/createImages index 7b3a205..f67dd3e 100755 --- a/buildScripts/createImages +++ b/buildScripts/createImages @@ -5,10 +5,12 @@ ################# # do the creation -./buildScripts/reportEnvs || { echo 'reportEnvs FAILED' ; exit 1 ; } +./buildScripts/reportEnvs || { echo 'reportEnvs FAILED' ; exit 1 ; } -./buildScripts/createAppImage || { echo 'createAppImage FAILED' ; exit 1 ; } +./buildScripts/createAppImage || { echo 'createAppImage FAILED' ; exit 1 ; } -./buildScripts/createDockerImage || { echo 'createDockerImage FAILED' ; exit 1 ; } +./buildScripts/createDockerImage || { echo 'createDockerImage FAILED' ; exit 1 ; } + +./buildScripts/createDebianPackage || { echo 'createDebianPackage FAILED' ; exit 1 ; } diff --git a/buildScripts/installPdf2htmlEX b/buildScripts/installPdf2htmlEX index 102f168..cbe1023 100755 --- a/buildScripts/installPdf2htmlEX +++ b/buildScripts/installPdf2htmlEX @@ -25,6 +25,6 @@ sudo make install # cd ../../poppler-data -make install \ +sudo make install \ prefix=$PDF2HTMLEX_PREFIX \ datadir=$PDF2HTMLEX_PREFIX/share/pdf2htmlEX From cf48cf54c1567ac18a76de60bce9b9accd6b960e Mon Sep 17 00:00:00 2001 From: Stephen Gaito Date: Mon, 1 Jun 2020 16:12:22 +0000 Subject: [PATCH 7/7] removed dependence on lsb_release and ensured dpkg-architecture is installed --- buildScripts/buildInstallLocallyApt | 4 ++-- buildScripts/createDebianPackage | 7 ++++--- buildScripts/getBuildToolsApt | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/buildScripts/buildInstallLocallyApt b/buildScripts/buildInstallLocallyApt index 7aa5e70..6f023f7 100755 --- a/buildScripts/buildInstallLocallyApt +++ b/buildScripts/buildInstallLocallyApt @@ -10,8 +10,8 @@ export MAKE_PARALLEL="-j $(nproc)" # choose one of the following... # -export PDF2HTMLEX_BRANCH=update-poppler -# export PDF2HTMLEX_BRANCH="$(git rev-parse --abbrev-ref HEAD)" +# export PDF2HTMLEX_BRANCH=<> +export PDF2HTMLEX_BRANCH="$(git rev-parse --abbrev-ref HEAD)" # The following environment variable determines where the poppler, # poppler-data, fontforge and pdf2htmlEX packages are installed. diff --git a/buildScripts/createDebianPackage b/buildScripts/createDebianPackage index 13546d3..47f72a3 100755 --- a/buildScripts/createDebianPackage +++ b/buildScripts/createDebianPackage @@ -10,7 +10,9 @@ echo "CREATING pdf2htmlEX (binary) Debian package" echo "-------------------------------------------------------------------" echo "" -export DPKG_NAME="pdf2htmlEX-$PDF2HTMLEX_BRANCH-$BUILD_TIME-$MACHINE_ARCH-$(lsb_release -cs).deb" +source /etc/lsb-release + +export DPKG_NAME="pdf2htmlEX-$PDF2HTMLEX_BRANCH-$BUILD_TIME-$MACHINE_ARCH-$DISTRIB_CODENAME.deb" echo "export DPKG_NAME=\"$DPKG_NAME\"" >> buildScripts/reSourceVersionEnvs @@ -66,7 +68,6 @@ find $DEBDIR -type f | xargs md5sum > $md5sumsFile # Accumulate the control file information # versionValue=$(git describe --abbrev=0) -releaseValue=$(lsb_release -cs) architectureValue=$(dpkg-architecture -q DEB_BUILD_ARCH_CPU) maintainerValue="$(git config --get user.name) <$(git config --get user.email)>" @@ -74,7 +75,7 @@ maintainerValue="$(git config --get user.name) <$(git config --get user.email)>" # echo "Package: pdf2htmlEX" > $controlFile echo "Version: 0:0.$versionValue-0" >> $controlFile -echo "Distribution: $releaseValue" >> $controlFile +echo "Distribution: $DISTRIB_CODENAME" >> $controlFile echo "Architecture: $architectureValue" >> $controlFile echo "Section: universe/web" >> $controlFile echo "Priority: optional" >> $controlFile diff --git a/buildScripts/getBuildToolsApt b/buildScripts/getBuildToolsApt index 6d14b84..5295f60 100755 --- a/buildScripts/getBuildToolsApt +++ b/buildScripts/getBuildToolsApt @@ -25,6 +25,7 @@ sudo apt-get $UNATTENDED install \ gcc \ g++ \ dpkg \ + dpkg-dev \ gettext \ openjdk-8-jre-headless \ jq \