1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
|
#!/usr/bin/make -f
# build under UTF-8
LC_ALL := C.UTF-8
export LC_ALL
# enable verbose mode
export DH_VERBOSE=1
# enable all hardening build flags
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
# non-executable stack
export DEB_CFLAGS_MAINT_APPEND=-Wa,--noexecstack
export DEB_LDFLAGS_MAINT_APPEND=-Wl,-z,noexecstack
%:
dh $@
override_dh_clean:
dh_clean
find . -name Makefile.in -delete
override_dh_auto_configure:
dh_auto_configure -- \
--disable-dependency-tracking \
--libdir=/usr/lib/lighttpd \
--libexecdir="/usr/lib/lighttpd" \
--with-attr \
--with-brotli \
--with-dbi \
$(if $(filter-out hurd-%,$(DEB_BUILD_ARCH)),--with-gnutls) \
$(if $(filter-out hurd-%,$(DEB_BUILD_ARCH)),--with-krb5) \
--with-ldap \
$(if $(filter-out hurd-%,$(DEB_BUILD_ARCH)),--with-libdeflate) \
--with-lua=lua5.4 \
--with-maxminddb \
--with-mbedtls \
$(if $(filter-out hurd-%,$(DEB_BUILD_ARCH)),--with-mysql) \
--with-nettle \
--with-nss \
--with-openssl \
--with-pam \
--with-pcre2 \
--with-pgsql \
--with-sasl \
--with-webdav-locks \
--with-webdav-props \
$(if $(filter-out hurd-%,$(DEB_BUILD_ARCH)),--with-wolfssl) \
--with-xxhash \
--with-zstd \
$(if $(filter pkg.lighttpd.libunwind,$(DEB_BUILD_PROFILES)),--with-libunwind) \
CFLAGS_FOR_BUILD="$$(dpkg-architecture -a$(DEB_BUILD_ARCH) -f -c dpkg-buildflags --get CFLAGS)" \
LDFLAGS_FOR_BUILD="$$(dpkg-architecture -a$(DEB_BUILD_ARCH) -f -c dpkg-buildflags --get LDFLAGS)" \
CPPFLAGS_FOR_BUILD="$$(dpkg-architecture -a$(DEB_BUILD_ARCH) -f -c dpkg-buildflags --get CPPFLAGS)" \
override_dh_install:
cp NEWS debian/tmp/changelog
dh_install
override_dh_missing:
dh_missing --fail-missing
override_dh_installdocs:
dh_installdocs -Nlighttpd -Nlighttpd-doc --link-doc=lighttpd
dh_installdocs -plighttpd -plighttpd-doc
override_dh_installinit:
dh_installinit --error-handler=start_failed
execute_after_dh_installsystemd:
dh_installtmpfiles
dh_installsystemd -plighttpd --name=lighttpd-maint
# The perl dependency for `lighttpd` is handled manually (as Recommends)
override_dh_perl:
dh_perl -Nlighttpd
execute_before_dh_debputy:
set -e; for p in `dh_listpackages`; do \
test -d debian/$$p/usr/lib/lighttpd || continue; \
m=`ls debian/$$p/usr/lib/lighttpd | sed 'y/_/-/;s/^mod-\(.*\)\.so$$/lighttpd-mod-\1,/;ta;d;:a /^'"$$p"',$$/d;' | xargs`; \
echo "lighttpd:ModuleProvides=$$m" >> debian/$$p.substvars; \
done
|