Source: softether-vpn
Version: 5.01.9674+git20200806+8181039+dfsg-1
Severity: wishlist
Tags: patch
User: [email protected]
Usertags: hostname
X-Debbugs-Cc: [email protected]

Hi,

Whilst working on the Reproducible Builds effort [0] we noticed that
softether-vpn could not be built reproducibly.

This is because it embeds the build username and build hostname into
the final binary.

Patch attached that doesn't set these variables (by editing the CMake
build configuration). The build does not fail when we do not define
these because of #ifdef preprocessor macros in upstream's header
files that has fallbacks.

The build is not fully reproducible with this change though, but it
will be once we enable fixfilepath dpkg-buildflags feature area toggle
archive-wide. (There's a thread unfolding on dpkg-dev now; no need to
set this here for now.)

 [0] https://reproducible-builds.org/


Regards,

--
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      [email protected] / chris-lamb.co.uk
       `-
--- a/debian/patches/reproducible-build.patch   1970-01-01 01:00:00.000000000 
+0100
--- b/debian/patches/reproducible-build.patch   2020-10-19 11:30:17.523909380 
+0100
@@ -0,0 +1,24 @@
+Description: Make the build reproducible
+Author: Chris Lamb <[email protected]>
+Last-Update: 2020-10-19
+
+--- 
softether-vpn-5.01.9674+git20200806+8181039+dfsg.orig/src/Cedar/CMakeLists.txt
++++ softether-vpn-5.01.9674+git20200806+8181039+dfsg/src/Cedar/CMakeLists.txt
+@@ -43,17 +43,6 @@ endif()
+ # Version
+ add_definitions(-DCEDAR_VERSION_MAJOR=${PROJECT_VERSION_MAJOR} 
-DCEDAR_VERSION_MINOR=${PROJECT_VERSION_MINOR} 
-DCEDAR_VERSION_BUILD=${PROJECT_VERSION_PATCH})
+ 
+-# Builder
+-if(UNIX)
+-  add_definitions(-DBUILDER_NAME="$ENV{USER}")
+-elseif(WIN32)
+-  add_definitions(-DBUILDER_NAME="$ENV{USERNAME}")
+-endif()
+-
+-cmake_host_system_information(RESULT BUILDER_HOSTNAME QUERY HOSTNAME)
+-
+-add_definitions(-DBUILD_PLACE="${BUILDER_HOSTNAME}")
+-
+ # Remove leading 0 from date and time
+ string(REGEX REPLACE "^0([^ ]*)" "\\1" BUILD_DAY "${DATE_DAY}")
+ string(REGEX REPLACE "^0([^ ]*)" "\\1" BUILD_MONTH "${DATE_MONTH}")
--- a/debian/patches/series     2020-10-19 11:07:54.187577017 +0100
--- b/debian/patches/series     2020-10-19 11:30:16.675898707 +0100
@@ -1,2 +1,3 @@
 static-link.patch
 fix-systemd-units.patch
+reproducible-build.patch

Reply via email to