diff options
Diffstat (limited to 'buildtools')
-rw-r--r-- | buildtools/debian/README | 11 | ||||
-rwxr-xr-x | buildtools/debian/mkdeb | 11 | ||||
-rwxr-xr-x | buildtools/installnetpbm.pl | 230 | ||||
-rwxr-xr-x | buildtools/makeman | 1 | ||||
-rwxr-xr-x | buildtools/stamp-date | 19 |
5 files changed, 28 insertions, 244 deletions
diff --git a/buildtools/debian/README b/buildtools/debian/README index 02fae4b5..2cf921ce 100644 --- a/buildtools/debian/README +++ b/buildtools/debian/README @@ -37,11 +37,11 @@ To install Netpbm as a Debian package: PREREQUSISITES -------------- -The following information was taken from the Wheezy version (Version 7) of -Debian, in January 2014. +The following information was taken from the Jessie version (Version 8) of +Debian, in March 2017. You don't actually need the current version of any of these. For example, -while we list package libjpeg8-dev, the package libjpeg62-dev works fine. +while we list package libjpeg62-dev, the package libjpeg8-dev works fine. Building @@ -54,12 +54,11 @@ indicate you don't have them, and the build will simply omit some parts. For example, if you don't install libx11-dev, the Netpbm build process will not build the 'pamx' program. - libjpeg8-dev + libjpeg62-dev libpng12-0-dev - libsvga1-dev libtiff5-dev libx11-dev - libxml2a-dev + libxml2-dev zlib1g-dev diff --git a/buildtools/debian/mkdeb b/buildtools/debian/mkdeb index 42a986eb..d1a88dc8 100755 --- a/buildtools/debian/mkdeb +++ b/buildtools/debian/mkdeb @@ -10,6 +10,10 @@ # package (what Debian contains is derived from Sourceforge Netpbm ca. # 2002). # +# The dependencies this package declares are those that can be satisfied by +# Debian 8 (Jessie). Netpbm works fine on other versions of Debian, but you +# may have to change the dependencies in this program or ignore dependencies +# at install time. ############################################################################### use strict; @@ -111,8 +115,8 @@ sub control($$) { # The Debian packaging system doesn't provide a way to express Netpbm's actual # prerequisites. For example, Netpbm needs Version 6.2 or better of Libjpeg, -# but there is no way to state that here. Instead, we state Libjpeg 8. -# This makes the Netpbm package less useful. +# but there is no way to state that here. Instead, we state Libjpeg 6.2 +# exactly. This makes the Netpbm package less useful. my %control; @@ -135,8 +139,7 @@ sub control($$) { 'libc6, ' . 'libjpeg62, ' . 'libpng12-0, ' . - 'libsvga1, ' . - 'libtiff4, ' . + 'libtiff5, ' . 'libx11-6, ' . 'libxml2, ' . 'zlib1g, ' . diff --git a/buildtools/installnetpbm.pl b/buildtools/installnetpbm.pl index 61900335..c4a30d17 100755 --- a/buildtools/installnetpbm.pl +++ b/buildtools/installnetpbm.pl @@ -752,228 +752,6 @@ sub installHeader($$$) { -sub getManDir($) { -#----------------------------------------------------------------------------- -# Find out from the user where he wants the pointer man pages -# installed and return that. -#----------------------------------------------------------------------------- - my ($prefix) = @_; - - print("Where do you want the man pages installed?\n"); - - print("\n"); - - my $manDir; - - while (!$manDir) { - my $default = "$prefix/man"; - - my $response = prompt("man page directory", $default); - - if (-d($response)) { - $manDir = $response; - } else { - my $succeeded = mkdir($response, 0777); - - if (!$succeeded) { - print("Unable to create directory '$response'. " . - "Error=$ERRNO\n"); - } else { - $manDir = $response; - } - } - } - print("\n"); - - return $manDir; -} - - - -sub removeObsoleteManPage($) { - - my ($mandir) = @_; - - unlink("$mandir/man1/pgmoil"); - unlink("$mandir/man1/pgmnorm"); - unlink("$mandir/man1/ppmtojpeg"); - unlink("$mandir/man1/bmptoppm"); - unlink("$mandir/man1/ppmtonorm"); - unlink("$mandir/man1/ppmtouil"); - unlink("$mandir/man1/pnmnoraw"); - unlink("$mandir/man1/gemtopbm"); - unlink("$mandir/man1/pnminterp"); -} - - - -sub tryToCreateManwebConf($) { - - my ($manweb_conf_filename) = $@; - - print("You don't have a /etc/manweb.conf, which is the " . - "configuration\n"); - print("file for the 'manweb' program, which is a quick way to " . - "get to Netpbm\n"); - print("documentation. Would you like to create one now?\n"); - - my $done; - - while (!$done) { - my $response = prompt("create /etc/manweb.conf", "Y"); - - if (uc($response) eq "Y") { - my $successful = open(MANWEB_CONF, ">/etc/manweb.conf"); - if (!$successful) { - print("Unable to create file /etc/manweb.conf. " . - "error = $ERRNO\n"); - } else { - print(MANWEB_CONF "#Configuration file for Manweb\n"); - print(MANWEB_CONF "webdir=/usr/man/web\n"); - close(MANWEB_CONF); - $done = $TRUE; - } - } else { - $done = $TRUE; - } - } -} - - - -sub getWebdir($) { - my ($manweb_conf_filename) = @_; -#----------------------------------------------------------------------------- -# Return the value of the Manweb "web directory," as indicated by the -# Manweb configuration file $manweb_conf_filename. -# -# If that file doesn't exist, or doesn't have a 'webdir' value, or -# the 'webdir' value is a chain of directories instead of just one, -# we return an undefined value. -#----------------------------------------------------------------------------- - my $webdir; - - my $success = open(MANWEB_CONF, "<$manweb_conf_filename"); - if (!$success) { - print("Unable to open file '$manweb_conf_filename' for reading. " . - "error is $ERRNO\n"); - } else { - while (<MANWEB_CONF>) { - chomp(); - if (/^\s*#/) { - #It's comment - ignore - } elsif (/^\s*$/) { - #It's a blank line - ignore - } elsif (/\s*(\S+)\s*=\s*(\S+)/) { - #It looks like "keyword=value" - my ($keyword, $value) = ($1, $2); - if ($keyword eq "webdir") { - # We can't handle a multi-directory path; we're looking - # only for a webdir statement naming a sole directory. - if ($value !~ m{:}) { - $webdir = $value; - } - } - } - } - close(MANWEB_CONF); - } - - return $webdir -} - - - -sub userWantsManwebSymlink($$) { - - my ($webdir, $netpbmWebdir) = @_; - - print("Your manweb.conf file says top level documentation " . - "is in $webdir, \n"); - print("but you installed netpbm.url in $netpbmWebdir.\n"); - print("Do you want to create a symlink in $webdir now?\n"); - - my $wants; - my $done; - - while (!$done) { - my $response = prompt("create symlink (Y/N)", "Y"); - - if (uc($response) eq "Y") { - $wants = $TRUE; - $done = $TRUE; - } elsif (uc($response) eq "N") { - $wants = $FALSE; - $done = $TRUE; - } - } - return $wants; -} - - - -sub makeInManwebPath($) { - - my ($netpbmWebdir) = @_; - - # Now we need /etc/manweb.conf to point to the directory in which we - # just installed netpbm.url. - - if (!-f("/etc/manweb.conf")) { - tryToCreateManwebConf("/etc/manweb.conf"); - } - if (-f("/etc/manweb.conf")) { - my $webdir = getWebdir("/etc/manweb.conf"); - if (defined($webdir)) { - if ($webdir ne $netpbmWebdir) { - if (userWantsManwebSymlink($webdir, $netpbmWebdir)) { - my $old = "$netpbmWebdir/netpbm.url"; - my $new = "$webdir/netpbm.url"; - mkdir($webdir, 0777); - my $success = symlink($old, $new); - if (!$success) { - print("Failed to create symbolic link from $new to " . - "$old. Error is $ERRNO\n"); - } - } - } - } - } -} - - - -sub installManPage($$$) { - - -# Note: This installs the pointer man pages and the netpbm.url file for Manweb. - - my ($pkgdir, $prefix, $mandirR) = @_; - - my $manDir = getManDir($prefix); - - print("Installing man pages...\n"); - - my $rc = system("$cpCommand $pkgdir/man/* $manDir/"); - - if ($rc != 0) { - print("copy of man pages from $pkgdir/man to $manDir failed.\n"); - print("cp exit code is $rc\n"); - } else { - print("done.\n"); - } - - print("\n"); - - removeObsoleteManPage($manDir); - - makeInManwebPath("$manDir/web"); - - $$mandirR = $manDir; -} - - - sub netpbmVersion($) { my ($pkgdir) = @_; @@ -1030,9 +808,6 @@ processTemplate($$$) { if (defined($infoR->{INCLUDEDIR})) { s/\@INCLUDEDIR@/$infoR->{INCLUDEDIR}/; } - if (defined($infoR->{MANDIR})) { - s/\@MANDIR@/$infoR->{MANDIR}/; - } push(@output, $_); } } @@ -1203,9 +978,6 @@ print("\n"); installHeader($pkgdir, $prefix, \my $includedir); print("\n"); -installManPage($pkgdir, $prefix, \my $mandir); -print("\n"); - my $templateSubsR = {VERSION => netpbmVersion($pkgdir), BINDIR => $bindir, @@ -1213,7 +985,7 @@ my $templateSubsR = LINKDIR => $linkdir, DATADIR => $datadir, INCLUDEDIR => $includedir, - MANDIR => $mandir}; + }; installConfig($bindir, $templateSubsR); diff --git a/buildtools/makeman b/buildtools/makeman index 13c54a70..b1d30afd 100755 --- a/buildtools/makeman +++ b/buildtools/makeman @@ -231,6 +231,7 @@ def makeman(name, file, indoc): indoc = indoc.replace("μ", "mu") indoc = indoc.replace("σ", "sigma") # Tables + # This will not handle rowspan indoc = re.sub('(?i) *<table[^>]*>.*', ".TS", indoc) indoc = re.sub("(?i) *</table>.*", ".TE", indoc) # First the single-line case diff --git a/buildtools/stamp-date b/buildtools/stamp-date index 32839e94..902c82e4 100755 --- a/buildtools/stamp-date +++ b/buildtools/stamp-date @@ -8,16 +8,25 @@ # copyright notice and this permission notice appear in supporting # documentation. This software is provided "as is" without express or # implied warranty. -# -DATE=$(date) + +# SOURCE_DATE_EPOCH is an environment variable as described here: +# https://reproducible-builds.org/specs/source-date-epoch/ on 2017.03.16. + +SOURCE_DATE_OR_NONE=${SOURCE_DATE_EPOCH:-NONE} + +BUILD_DATETIME=$(date +%s) + LOGNAME_OR_UNKNOWN=${LOGNAME:-UNKNOWN} USER=${USER:-$LOGNAME_OR_UNKNOWN} if [ "$USER" = "UNKNOWN" ]; then - USER=`whoami` + USER=$(whoami) fi -echo "/* This file tells the package when it was compiled */" +echo "/* This file tells some facts about the building of the package */" echo "/* DO NOT EDIT - THIS FILE IS MAINTAINED AUTOMATICALLY */" echo "/* Created by the program 'stamp-date' */" -echo "#define COMPILE_TIME \"$DATE\"" +if [ "$SOURCE_DATE_OR_NONE" != "NONE" ]; then + echo "#define SOURCE_DATETIME $SOURCE_DATE_OR_NONE" +fi +echo "#define BUILD_DATETIME $BUILD_DATETIME" echo "#define COMPILED_BY \"$USER\"" |