rules 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. #!/usr/bin/make -f
  2. #
  3. # ngIRCd -- The Next Generation IRC Daemon
  4. # Copyright (c)2001-2016 Alexander Barton (alex@barton.de) and Contributors
  5. #
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2 of the License, or
  9. # (at your option) any later version.
  10. # Please read the file COPYING, README and AUTHORS for more information.
  11. #
  12. # debian/rules for ngIRCd
  13. #
  14. # Based on the sample debian/rules that uses debhelper,
  15. # GNU copyright 1997 to 1999 by Joey Hess.
  16. #
  17. # Uncomment this to turn on verbose mode.
  18. #export DH_VERBOSE=1
  19. # These are used for cross-compiling and for saving the configure script
  20. # from having to guess our platform (since we know it already)
  21. DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
  22. DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
  23. CFLAGS = -Wall -g
  24. ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
  25. CFLAGS += -O0
  26. else
  27. CFLAGS += -O2
  28. endif
  29. ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
  30. INSTALL_PROGRAM += -s
  31. endif
  32. configure-ngircd: configure
  33. dh_testdir
  34. # configure "standard" variant:
  35. ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
  36. --prefix=/usr \
  37. --sysconfdir=/etc/ngircd \
  38. --mandir=\$${prefix}/share/man \
  39. --docdir=\$${prefix}/share/doc/ngircd \
  40. --with-syslog --with-zlib
  41. configure-ngircd-full: configure
  42. dh_testdir
  43. # configure "full" variant:
  44. ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
  45. --prefix=/usr \
  46. --sysconfdir=/etc/ngircd \
  47. --mandir=\$${prefix}/share/man \
  48. --docdir=\$${prefix}/share/doc/ngircd-full \
  49. --with-syslog --with-zlib \
  50. --with-openssl --with-iconv --with-ident --with-tcp-wrappers \
  51. --with-pam \
  52. --enable-ipv6
  53. configure-ngircd-full-dbg: configure
  54. dh_testdir
  55. # configure "full debug" variant:
  56. ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
  57. --prefix=/usr \
  58. --sysconfdir=/etc/ngircd \
  59. --mandir=\$${prefix}/share/man \
  60. --docdir=\$${prefix}/share/doc/ngircd-full-dbg \
  61. --enable-debug --enable-sniffer \
  62. --with-syslog --with-zlib \
  63. --with-openssl --with-iconv --with-ident --with-tcp-wrappers \
  64. --with-pam \
  65. --enable-ipv6
  66. build:
  67. dh_prep
  68. build-ngircd: build-stamp-ngircd
  69. build-stamp-ngircd: configure-ngircd
  70. dh_testdir
  71. rm -f build-stamp-*
  72. # Add here commands to compile the "standard" package:
  73. $(MAKE)
  74. touch build-stamp-ngircd
  75. build-ngircd-full: build-stamp-ngircd-full
  76. build-stamp-ngircd-full: configure-ngircd-full
  77. dh_testdir
  78. rm -f build-stamp-*
  79. # Add here commands to compile the "full" package:
  80. $(MAKE)
  81. touch build-stamp-ngircd-full
  82. build-ngircd-full-dbg: build-stamp-ngircd-full-dbg
  83. build-stamp-ngircd-full-dbg: configure-ngircd-full-dbg
  84. dh_testdir
  85. rm -f build-stamp-*
  86. # Add here commands to compile the "full debug" package:
  87. $(MAKE)
  88. touch build-stamp-ngircd-full
  89. clean:
  90. dh_testdir
  91. dh_testroot
  92. rm -f build-stamp*
  93. rm -f $(CURDIR)/debian/ngircd.service
  94. rm -f $(CURDIR)/debian/ngircd-full.default
  95. rm -f $(CURDIR)/debian/ngircd-full.init
  96. rm -f $(CURDIR)/debian/ngircd-full.postinst
  97. rm -f $(CURDIR)/debian/ngircd-full.service
  98. rm -f $(CURDIR)/debian/ngircd-full-dbg.default
  99. rm -f $(CURDIR)/debian/ngircd-full-dbg.postinst
  100. rm -f $(CURDIR)/debian/ngircd-full-dbg.init
  101. rm -f $(CURDIR)/debian/ngircd-full-dbg.service
  102. # Add here commands to clean up after the build process:
  103. [ ! -f Makefile ] || $(MAKE) distclean
  104. ifneq "$(wildcard /usr/share/misc/config.sub)" ""
  105. cp -f /usr/share/misc/config.sub config.sub
  106. endif
  107. ifneq "$(wildcard /usr/share/misc/config.guess)" ""
  108. cp -f /usr/share/misc/config.guess config.guess
  109. endif
  110. dh_clean
  111. install: install-ngircd install-ngircd-full install-ngircd-full-dbg
  112. install-ngircd: build-ngircd
  113. dh_testdir
  114. dh_testroot
  115. dh_installdirs
  116. # Add here commands to install the "standard" package into debian/ngircd:
  117. $(MAKE) install DESTDIR=$(CURDIR)/debian/ngircd
  118. rm $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/INSTALL*
  119. rm $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/COPYING*
  120. cat $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/sample-ngircd.conf | \
  121. sed -e "s|;ServerUID = 65534|ServerUID = irc|g" | \
  122. sed -e "s|;ServerGID = 65534|ServerGID = irc|g" | \
  123. sed -e "s|;PidFile = /var/run/ngircd/ngircd.pid|PidFile = /var/run/ircd/ngircd.pid|g" \
  124. >$(CURDIR)/debian/ngircd/etc/ngircd/ngircd.conf
  125. touch $(CURDIR)/debian/ngircd/etc/ngircd/ngircd.motd
  126. install-ngircd-full: build-ngircd-full
  127. dh_testdir
  128. dh_testroot
  129. dh_installdirs
  130. # Add here commands to install the "full" package into debian/ngircd-full:
  131. $(MAKE) install DESTDIR=$(CURDIR)/debian/ngircd-full
  132. rm $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd-full/INSTALL*
  133. rm $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd-full/COPYING*
  134. cat $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd-full/sample-ngircd.conf | \
  135. sed -e "s|;ServerUID = 65534|ServerUID = irc|g" | \
  136. sed -e "s|;ServerGID = 65534|ServerGID = irc|g" | \
  137. sed -e "s|;PidFile = /var/run/ngircd/ngircd.pid|PidFile = /var/run/ircd/ngircd.pid|g" \
  138. >$(CURDIR)/debian/ngircd-full/etc/ngircd/ngircd.conf
  139. touch $(CURDIR)/debian/ngircd-full/etc/ngircd/ngircd.motd
  140. mkdir -p $(CURDIR)/debian/ngircd-full/etc/pam.d
  141. cp $(CURDIR)/debian/ngircd.pam $(CURDIR)/debian/ngircd-full/etc/pam.d/ngircd
  142. install-ngircd-full-dbg: build-ngircd-full-dbg
  143. dh_testdir
  144. dh_testroot
  145. dh_installdirs
  146. # Add here commands to install the "full" package into debian/ngircd-full:
  147. $(MAKE) install DESTDIR=$(CURDIR)/debian/ngircd-full-dbg
  148. rm $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd-full-dbg/INSTALL*
  149. rm $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd-full-dbg/COPYING*
  150. cat $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd-full-dbg/sample-ngircd.conf | \
  151. sed -e "s|;ServerUID = 65534|ServerUID = irc|g" | \
  152. sed -e "s|;ServerGID = 65534|ServerGID = irc|g" | \
  153. sed -e "s|;PidFile = /var/run/ngircd/ngircd.pid|PidFile = /var/run/ircd/ngircd.pid|g" \
  154. >$(CURDIR)/debian/ngircd-full-dbg/etc/ngircd/ngircd.conf
  155. touch $(CURDIR)/debian/ngircd-full-dbg/etc/ngircd/ngircd.motd
  156. mkdir -p $(CURDIR)/debian/ngircd-full-dbg/etc/pam.d
  157. cp $(CURDIR)/debian/ngircd.pam $(CURDIR)/debian/ngircd-full-dbg/etc/pam.d/ngircd
  158. # Build architecture-independent files here.
  159. binary-indep:
  160. # We have nothing to do by default.
  161. # Build architecture-dependent files here.
  162. binary-arch: build install
  163. ln -s $(CURDIR)/contrib/ngircd.service \
  164. $(CURDIR)/debian/ngircd.service
  165. ln -s $(CURDIR)/debian/ngircd.default \
  166. $(CURDIR)/debian/ngircd-full.default
  167. ln -s $(CURDIR)/debian/ngircd.init \
  168. $(CURDIR)/debian/ngircd-full.init
  169. ln -s $(CURDIR)/debian/ngircd.postinst \
  170. $(CURDIR)/debian/ngircd-full.postinst
  171. cp $(CURDIR)/contrib/ngircd.service \
  172. $(CURDIR)/debian/ngircd-full.service
  173. echo "Alias=ngircd.service" >>$(CURDIR)/debian/ngircd-full.service
  174. ln -s $(CURDIR)/debian/ngircd.default \
  175. $(CURDIR)/debian/ngircd-full-dbg.default
  176. ln -s $(CURDIR)/debian/ngircd.init \
  177. $(CURDIR)/debian/ngircd-full-dbg.init
  178. ln -s $(CURDIR)/debian/ngircd.postinst \
  179. $(CURDIR)/debian/ngircd-full-dbg.postinst
  180. cp $(CURDIR)/contrib/ngircd.service \
  181. $(CURDIR)/debian/ngircd-full-dbg.service
  182. echo "Alias=ngircd.service" >>$(CURDIR)/debian/ngircd-full-dbg.service
  183. dh_testdir
  184. dh_testroot
  185. dh_installchangelogs -a -A ChangeLog
  186. dh_installdocs -a
  187. dh_systemd_enable -a
  188. dh_installinit -a
  189. dh_systemd_start -a
  190. dh_strip -a --no-package=ngircd-full-dbg
  191. dh_compress -a -XCommands.txt
  192. dh_fixperms -a
  193. dh_installdeb -a
  194. dh_shlibdeps -a
  195. dh_gencontrol -a
  196. dh_md5sums -a
  197. dh_builddeb -a
  198. binary: binary-indep binary-arch
  199. .PHONY: build clean binary-indep binary-arch binary install
  200. # -eof-