1
0

rules 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #!/usr/bin/make -f
  2. # See FEATURE AREAS in dpkg-buildflags(1).
  3. export DEB_BUILD_MAINT_OPTIONS = hardening=+all
  4. %:
  5. dh $@
  6. # Disable dh_autoreconf since we are using de-ANSI-fication which was removed
  7. # from automake a while ago. See <https://github.com/ngircd/ngircd/issues/261>.
  8. override_dh_autoreconf:
  9. override_dh_auto_configure:
  10. dh_auto_configure -- \
  11. --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
  12. --prefix=/usr \
  13. --mandir=\$${prefix}/share/man \
  14. --sysconfdir=/etc/ngircd \
  15. --with-iconv \
  16. --with-ident \
  17. --with-openssl \
  18. --with-pam \
  19. --with-syslog \
  20. --with-zlib
  21. execute_before_dh_auto_install:
  22. ln -fs $(CURDIR)/contrib/ngircd.service $(CURDIR)/debian/ngircd.service
  23. execute_after_dh_auto_install:
  24. # Generate the default ngircd.conf:
  25. install -o root -g irc -m 0640 -D /dev/null \
  26. $(CURDIR)/debian/ngircd/etc/ngircd/ngircd.conf
  27. sed \
  28. -e "s|;ServerUID = 65534|ServerUID = irc|g" \
  29. -e "s|;ServerGID = 65534|ServerGID = irc|g" \
  30. -e "s|;PidFile = /var/run/ngircd/ngircd.pid|PidFile = /run/ircd/ngircd.pid|g" \
  31. -e "s|;PAM = yes|PAM = no|g" \
  32. -e "s|;\[SSL\]|[SSL]|g" \
  33. -e "s|;CAFile = /etc/ssl/CA/cacert.pem|CAFile = /etc/ssl/certs/ca-certificates.crt|g" \
  34. $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/sample-ngircd.conf \
  35. >>$(CURDIR)/debian/ngircd/etc/ngircd/ngircd.conf
  36. # Create drop-in configuration directory:
  37. install -o root -g irc -m 0750 -d \
  38. $(CURDIR)/debian/ngircd/etc/ngircd/ngircd.conf.d
  39. # Install an empty MOTD file.
  40. install -o root -g irc -m 0640 -D /dev/null \
  41. $(CURDIR)/debian/ngircd/etc/ngircd/ngircd.motd
  42. # Install the logcheck(8) configuration.
  43. install -o root -g root -m 0644 -D \
  44. $(CURDIR)/contrib/ngircd.logcheck \
  45. $(CURDIR)/debian/ngircd/etc/logcheck/ignore.d.paranoid/ngircd
  46. # Install the fail2ban configuration.
  47. install -o root -g root -m 0644 -D \
  48. $(CURDIR)/contrib/ngircd-fail2ban.conf \
  49. $(CURDIR)/debian/ngircd/etc/fail2ban/filter.d/ngircd.conf
  50. # Make lintian happy :-)
  51. rm $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/COPYING
  52. mv $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/ChangeLog \
  53. $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/changelog
  54. override_dh_fixperms:
  55. # Preserve the permissions of files installed in /etc/ngircd!
  56. dh_fixperms -X/etc/ngircd
  57. override_dh_compress:
  58. # The Commands.txt file is read by the daemon, don't compress it!
  59. dh_compress -XCommands.txt