[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Debian Packaging Build Patches (aka bike shed painting)



In updating the Debian scrypt package to the most recent version in SVN,
there were a few minor patches to the build system to support building
without manual intervention.  I'm attaching these below, in case others
might either find them useful or be driven to explain why they're bogus.

There are a few other small build mods that might make sense which I
didn't make:

(a) Since all arch=amd64 (aka x86_64) CPUs support SSE2, --enable-sse2
    should probably be enabled by default on amd64.

(b) The macro file acscrypt.m4 defining CHECK_SYSCTL_HW_USERMEM could be
    moved to m4/check_sysctl_hw_usermem.m4, and
    AC_CONFIG_MACRO_DIR([m4]) added to configure.ac, to let it be picked
    up automatically, included in aclocal.m4, etc.

(c) Having ./configure write over the Makefile in the tarball with a new
    completely unrelated Makefile is a bit ... confusing.

I've put the debian packaging information, along with a mirror of the SVN
repository, at git://github.com/barak/scrypt
--
Barak A. Pearlmutter
 Hamilton Institute & Dept Comp Sci, NUI Maynooth, Co. Kildare, Ireland
 http://www.bcl.hamilton.ie/~barak/
From: "Barak A. Pearlmutter" <barak+git@cs.nuim.ie>
Date: Fri, 11 Apr 2014 09:23:31 +0100
Subject: configure.ac version

autoconf gets annoyed if configure.ac does not contain a literal
version argument in AC_INIT.  The upstream code tries to figure out
the version from the directory name and include it in.  This has a few problems:

* The code to do this is in Makefile, and is overwritten by autotools.
* The code doesn't work in Debian because the directory name does
  not necessarily encode the version.
* The file containing the version is not present in the upstream sources,
  and must be created by running "make", and autoconf fails if it is not
  found.
* The Makefile in the sources uses a syntactic extension not supported
  by GNU make, which errors out with "missing separator".

This patch passes a literal version number to AC_INIT.

BE SURE TO UPDATE FOR A NEW UPSTREAM VERSION!
---
 configure.ac | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index dee096a..b9445a7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,4 @@
-m4_define([SCRYPT_VERS],m4_include([scrypt-version]))
-AC_INIT([scrypt],SCRYPT_VERS())
+AC_INIT([scrypt],[1.1.6])
 AC_CONFIG_AUX_DIR([config.aux])
 AM_INIT_AUTOMAKE()
 AM_MAINTAINER_MODE
From: "Barak A. Pearlmutter" <barak+git@cs.nuim.ie>
Date: Fri, 11 Apr 2014 09:24:33 +0100
Subject: automake options

Add two automake options.  The first, subdir-objects, is to avoid
zillions of warnings concerning refering to source files in
subdirectories.  The second, -Wall, has no discernible effect, which
is good.
---
 Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index 6728d8b..706f2e8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-AUTOMAKE_OPTIONS=	foreign
+AUTOMAKE_OPTIONS=	foreign subdir-objects -Wall
 
 bin_PROGRAMS=	scrypt
 dist_man_MANS=$(scrypt_man_MANS)
From: "Barak A. Pearlmutter" <barak+git@cs.nuim.ie>
Date: Fri, 11 Apr 2014 09:28:55 +0100
Subject: configure.ac include acscrypt.m4

acscrypt.m4 contains the macro CHECK_SYSCTL_HW_USERMEM.  This should
be put in check_sysctl_hw_usermem.m4 so it can be found automatically,
but that would be more appropriate to do upstream, and this is a
minimal patch.
---
 configure.ac | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure.ac b/configure.ac
index b9445a7..8f73c42 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,6 +2,7 @@ AC_INIT([scrypt],[1.1.6])
 AC_CONFIG_AUX_DIR([config.aux])
 AM_INIT_AUTOMAKE()
 AM_MAINTAINER_MODE
+m4_include([acscrypt.m4])
 AC_PROG_CC
 
 # Check for clock_gettime.  On some systems, this is provided via librt.
From: "Barak A. Pearlmutter" <barak+git@cs.nuim.ie>
Date: Fri, 11 Apr 2014 15:14:39 +0100
Subject: configure.ac clock_gettime

Instead of always including -lrt when linking with it provides
clock_gettime, only link to it when clock_gettime is not available
without -lrt.  This is the recommended procedure.  To quote the
autoconf 2.69 info pages:

     'AC_CHECK_LIB' requires some care ... it is normally better to
     use 'AC_SEARCH_LIBS([gethostbyname], [nsl])' instead of
     'AC_CHECK_LIB([nsl], [gethostbyname])'.
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 8f73c42..0778ad2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6,7 +6,7 @@ m4_include([acscrypt.m4])
 AC_PROG_CC
 
 # Check for clock_gettime.  On some systems, this is provided via librt.
-AC_CHECK_LIB(rt, clock_gettime)
+AC_SEARCH_LIBS([clock_gettime], [rt])
 AC_CHECK_FUNCS([clock_gettime])
 
 # Check for a linuxy sysinfo syscall; and while we're doing that, check if

Attachment: pgpcjrym_SrQU.pgp
Description: PGP signature