Merge pull request #461 from ecsv/batadv-2019.1
[feed/routing.git] / smcroute / patches / 001-Make-output-of-build-id-optional.patch
1 Author: Micha Lenk <micha@lenk.info>
2 Date: Thu, 7 May 2015 21:54:31 +0200
3 Description: Make output of build id optional
4 With free software, anyone can inspect the source code for malicious flaws.
5 But the software is often provided as binary packages to its users. The idea
6 of “deterministic” or “reproducible” builds is to empower anyone to verify
7 that no flaws have been introduced during the build process by reproducing
8 byte-for-byte identical binary packages from a given source. See also:
9 https://wiki.debian.org/ReproducibleBuilds
10 .
11 Prior to this change a timestamp generated at build time is included in the
12 output of 'smcroute -v'. As a result the binary is unreproducible.
13 .
14 With this change, users that still want 'smcroute -v' to include a build id
15 can run './configure --enable-build-id' to get the build id back (or even
16 specify a custom build id).
17 Origin: upstream, https://github.com/troglobit/smcroute/commit/73f6f14907f709e40689216291621ad26cd22ecd
18 Bug-Debian: https://bugs.debian.org/784694
19 Last-Update: 2017-08-08
20
21 ---
22 configure.ac | 9 ++++++++-
23 smcroute.c | 6 +++++-
24 2 files changed, 13 insertions(+), 2 deletions(-)
25
26 diff --git a/configure.ac b/configure.ac
27 index 556d958..eb4a291 100644
28 --- a/configure.ac
29 +++ b/configure.ac
30 @@ -181,7 +181,14 @@ AC_COMPILE_IFELSE(
31 [AC_MSG_RESULT(no)])
32
33 # Add build number to config.h.in
34 -AC_DEFINE_UNQUOTED([BUILD], "`date +%y%m%d`", [Build number, abbreviated date.])
35 +AC_ARG_ENABLE([build-id],
36 + [AS_HELP_STRING([--enable-build-id@<:@=ID@:>@],
37 + [show build id in output of 'smcroute -v'])],
38 + [AS_IF([test "x$enableval" = "xyes" ],
39 + [build_id=`date +%y%m%d`],
40 + [build_id=$enableval])
41 + AC_DEFINE_UNQUOTED([BUILD], "$build_id", [Build number, abbreviated date.])])
42 +
43
44 # Checks for library functions.
45 AC_FUNC_FORK
46 diff --git a/smcroute.c b/smcroute.c
47 index 7bd3c72..0287458 100644
48 --- a/smcroute.c
49 +++ b/smcroute.c
50 @@ -46,7 +46,11 @@ static const char *conf_file = SMCROUTE_SYSTEM_CONF;
51
52 extern char *__progname;
53 static const char version_info[] =
54 - "SMCRoute version " PACKAGE_VERSION " build " BUILD "\n";
55 + "SMCRoute version " PACKAGE_VERSION
56 +#ifdef BUILD
57 + " build " BUILD
58 +#endif
59 + "\n";
60
61 static const char usage_info[] =
62 "Usage: smcroute [OPTIONS]... [ARGS]...\n"
63 --
64 2.11.0
65