]> git.donarmstrong.com Git - unscd.git/blobdiff - debian/rules
Migrate to salsa (with donarmstrong.com as a backup)
[unscd.git] / debian / rules
index b93568908ee54cf7404cd48c5396f9a745679fee..29c7baf8cb84f795d7d7fab15290b1551b35a199 100755 (executable)
@@ -1,5 +1,11 @@
 #!/usr/bin/make -f
 
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+
+include /usr/share/dpkg/architecture.mk
+-include /usr/share/dpkg/buildtools.mk
+CC_FOR_BUILD ?= $(CC)
+
 %:
        dh $@
 
@@ -8,10 +14,21 @@ override_dh_auto_clean:
        dh_auto_clean
 
 override_dh_auto_build:
-       gcc $(CFLAGS) $(LDFLAGS) -o nscd nscd.c
+       $(CC_FOR_BUILD) $(CFLAGS) $(LDFLAGS) -o nscd nscd.c -lsystemd
+       help2man --name 'nscd which does not hang' \
+               --include debian/help2man \
+               --no-info \
+               ./nscd > debian/unscd.man
+       ln -fs unscd.man debian/nscd.man
+ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
+       $(CC) $(CFLAGS) $(LDFLAGS) -o nscd nscd.c
+endif
 
 override_dh_auto_install:
        install -d debian/unscd/usr/sbin/
        install -t debian/unscd/usr/sbin/ nscd
        install -d debian/unscd/etc/
        install -m644 -t debian/unscd/etc/ debian/nscd.conf
+
+override_dh_systemd_start:
+       dh_systemd_start --restart-after-upgrade --no-stop-on-upgrade