Source: libprelude
Version: 1.0.0-11.8
Severity: wishlist
Tags: patch
User: helm...@debian.org
Usertags: rebootstrap

libprelude is part of the build closure of essential: login is essential
and built from shadow. shadow needs stuff from audit, which in turn
needs stuff from libprelude. It looks like we cannot build perl and
python before libprelude, so libprelude should work without them. To
achieve that I'm attatching a patch that adds support for the noperl and
nopython build profiles. Together they can be used as a stage1 profile
to build libprelude during architecture bootstrap. Please consider
applying the patch. I verified that the profiles work individually and
combined and also verified that they do not change other packages other
than the -dbg package via diffoscope (minus build id changes). I
recommend switching to automatic dbgsym packages to make profile builds
reproducible.

Helmut
diff --minimal -Nru libprelude-1.0.0/debian/changelog 
libprelude-1.0.0/debian/changelog
--- libprelude-1.0.0/debian/changelog   2016-09-06 17:33:46.000000000 +0200
+++ libprelude-1.0.0/debian/changelog   2016-09-17 07:27:14.000000000 +0200
@@ -1,3 +1,10 @@
+libprelude (1.0.0-11.9) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Support Build profiles nopython and noperl (Closes: #-1)
+
+ -- Helmut Grohne <hel...@subdivi.de>  Sat, 17 Sep 2016 07:27:01 +0200
+
 libprelude (1.0.0-11.8) unstable; urgency=medium
 
   * Non-maintainer upload.
diff --minimal -Nru libprelude-1.0.0/debian/control 
libprelude-1.0.0/debian/control
--- libprelude-1.0.0/debian/control     2016-09-06 16:51:48.000000000 +0200
+++ libprelude-1.0.0/debian/control     2016-09-17 09:59:59.000000000 +0200
@@ -9,12 +9,12 @@
     quilt,
     libgnutls28-dev,
     libgcrypt20-dev,
-    python-all-dev (>> 2.6.6),
-    libperl-dev,
+    python-all-dev (>> 2.6.6) <!nopython>,
+    libperl-dev <!noperl>,
     libltdl-dev,
     pkg-config,
     gawk,
-    swig
+    swig <!noperl> <!nopython>
 Standards-Version: 3.9.3
 
 Package: libprelude-dev
@@ -74,6 +74,7 @@
 Section: perl
 Architecture: any
 Depends: ${perl:Depends}, libprelude2 (= ${binary:Version}), 
${shlibs:Depends}, ${misc:Depends}
+Build-Profiles: <!noperl>
 Description: Security Information Management System [ Base library ]
  Prelude is a Universal "Security Information Management" (SIM) system.
  Its goals are performance and modularity. It is divided in two main
@@ -92,6 +93,7 @@
 Architecture: any
 Depends: ${python:Depends}, libprelude2 (= ${binary:Version}), 
${shlibs:Depends}, ${misc:Depends}
 Provides: ${python:Provides}
+Build-Profiles: <!nopython>
 Description: Security Information Management System [ Base library ]
  Prelude is a Universal "Security Information Management" (SIM) system.
  Its goals are performance and modularity. It is divided in two main
diff --minimal -Nru libprelude-1.0.0/debian/rules libprelude-1.0.0/debian/rules
--- libprelude-1.0.0/debian/rules       2016-09-06 17:22:16.000000000 +0200
+++ libprelude-1.0.0/debian/rules       2016-09-17 07:59:28.000000000 +0200
@@ -3,13 +3,26 @@
 
 export DEB_BUILD_MAINT_OPTIONS=hardening=+all,-pie
 
+DH_ADDONS = --with quilt --with autoreconf
+
+ifeq ($(filter nopython,$(DEB_BUILD_PROFILES)),)
 PYVERS=$(shell pyversions -vr)
+DH_ADDONS += --with python2
+else
+CONFIGURE_FLAGS += --without-python
+endif
+
+ifeq ($(filter noperl,$(DEB_BUILD_PROFILES)),)
+CONFIGURE_FLAGS += --with-perl-installdirs=vendor
+else
+CONFIGURE_FLAGS += --without-perl
+endif
 
 override_dh_auto_configure:
        # backup files to be regenerated
        mkdir debian/temp.backup; \
        cp -a bindings/python/PreludeEasy.py bindings/python/_PreludeEasy.cxx 
debian/temp.backup/
-       dh_auto_configure -- --with-perl-installdirs=vendor
+       dh_auto_configure -- $(CONFIGURE_FLAGS)
 
 override_dh_auto_build: build-core $(PYVERS:%=build-python%)
 
@@ -32,10 +45,12 @@
        echo "OK"
 
 override_dh_auto_install:
-       dh_auto_install; \
-       rm -rf debian/tmp/usr/lib/python*; \
-       find debian/tmp-python-libprelude/usr/lib -name "*.la" -delete; \
+       dh_auto_install
+       rm -rf debian/tmp/usr/lib/python*
+ifeq ($(filter nopython,$(DEB_BUILD_PROFILES)),)
+       find debian/tmp-python-libprelude/usr/lib -name "*.la" -delete
        mv debian/tmp-python-libprelude/usr/lib/* debian/tmp/usr/lib/
+endif
 
 override_dh_strip:
        dh_strip --dbg-package=libprelude2-dbg
@@ -51,4 +66,4 @@
        [ ! -d debian/temp.backup ] || rm -rf debian/temp.backup
 
 %:
-       dh $@ --with=quilt,python2,autoreconf
+       dh $@ $(DH_ADDONS)

Reply via email to