rules 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. #!/usr/bin/make -f
  2. #
  3. # ngIRCd -- The Next Generation IRC Daemon
  4. # Copyright (c)2001-2012 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. --with-syslog --with-zlib
  40. configure-ngircd-full: configure
  41. dh_testdir
  42. # configure "full" variant:
  43. ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
  44. --prefix=/usr \
  45. --sysconfdir=/etc/ngircd \
  46. --mandir=\$${prefix}/share/man \
  47. --with-syslog --with-zlib \
  48. --with-gnutls --with-iconv --with-ident --with-tcp-wrappers \
  49. --with-pam \
  50. --enable-ipv6
  51. configure-ngircd-full-dbg: configure
  52. dh_testdir
  53. # configure "full debug" variant:
  54. ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
  55. --prefix=/usr \
  56. --sysconfdir=/etc/ngircd \
  57. --mandir=\$${prefix}/share/man \
  58. --enable-debug --enable-sniffer \
  59. --with-syslog --with-zlib \
  60. --with-gnutls --with-iconv --with-ident --with-tcp-wrappers \
  61. --with-pam \
  62. --enable-ipv6
  63. build:
  64. dh_clean -k
  65. build-ngircd: build-stamp-ngircd
  66. build-stamp-ngircd: configure-ngircd
  67. dh_testdir
  68. rm -f build-stamp-*
  69. # Add here commands to compile the "standard" package:
  70. $(MAKE)
  71. touch build-stamp-ngircd
  72. build-ngircd-full: build-stamp-ngircd-full
  73. build-stamp-ngircd-full: configure-ngircd-full
  74. dh_testdir
  75. rm -f build-stamp-*
  76. # Add here commands to compile the "full" package:
  77. $(MAKE)
  78. touch build-stamp-ngircd-full
  79. build-ngircd-full-dbg: build-stamp-ngircd-full-dbg
  80. build-stamp-ngircd-full-dbg: configure-ngircd-full-dbg
  81. dh_testdir
  82. rm -f build-stamp-*
  83. # Add here commands to compile the "full debug" package:
  84. $(MAKE)
  85. touch build-stamp-ngircd-full
  86. clean:
  87. dh_testdir
  88. dh_testroot
  89. rm -f build-stamp*
  90. rm -f $(CURDIR)/debian/ngircd-full.default
  91. rm -f $(CURDIR)/debian/ngircd-full.init
  92. rm -f $(CURDIR)/debian/ngircd-full.postinst
  93. rm -f $(CURDIR)/debian/ngircd-full-dbg.default
  94. rm -f $(CURDIR)/debian/ngircd-full-dbg.postinst
  95. rm -f $(CURDIR)/debian/ngircd-full-dbg.init
  96. # Add here commands to clean up after the build process:
  97. [ ! -f Makefile ] || $(MAKE) distclean
  98. ifneq "$(wildcard /usr/share/misc/config.sub)" ""
  99. cp -f /usr/share/misc/config.sub config.sub
  100. endif
  101. ifneq "$(wildcard /usr/share/misc/config.guess)" ""
  102. cp -f /usr/share/misc/config.guess config.guess
  103. endif
  104. dh_clean
  105. install: install-ngircd install-ngircd-full install-ngircd-full-dbg
  106. install-ngircd: build-ngircd
  107. dh_testdir
  108. dh_testroot
  109. dh_installdirs
  110. # Add here commands to install the "standard" package into debian/ngircd:
  111. $(MAKE) install DESTDIR=$(CURDIR)/debian/ngircd
  112. rm $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/INSTALL*
  113. rm $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/COPYING*
  114. mkdir -p $(CURDIR)/debian/ngircd/var/run/ircd
  115. cat $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/sample-ngircd.conf | \
  116. sed -e "s|;ServerUID = 65534|ServerUID = irc|g" | \
  117. sed -e "s|;ServerGID = 65534|ServerGID = irc|g" | \
  118. sed -e "s|;MotdFile = /usr/local/etc/ngircd.motd|MotdFile = |/etc/ngircd/ngircd.motd|g" | \
  119. sed -e "s|;PidFile = /var/run/ngircd/ngircd.pid|PidFile = /var/run/ircd/ngircd.pid|g" \
  120. >$(CURDIR)/debian/ngircd/etc/ngircd/ngircd.conf
  121. touch $(CURDIR)/debian/ngircd/etc/ngircd/ngircd.motd
  122. install-ngircd-full: build-ngircd-full
  123. dh_testdir
  124. dh_testroot
  125. dh_installdirs
  126. # Add here commands to install the "full" package into debian/ngircd-full:
  127. $(MAKE) install DESTDIR=$(CURDIR)/debian/ngircd-full
  128. rm $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd/INSTALL*
  129. rm $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd/COPYING*
  130. mv $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd \
  131. $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd-full
  132. mkdir -p $(CURDIR)/debian/ngircd-full/var/run/ircd
  133. cat $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd-full/sample-ngircd.conf | \
  134. sed -e "s|;ServerUID = 65534|ServerUID = irc|g" | \
  135. sed -e "s|;ServerGID = 65534|ServerGID = irc|g" | \
  136. sed -e "s|;MotdFile = /usr/local/etc/ngircd.motd|MotdFile = /etc/ngircd/ngircd.motd|g" | \
  137. sed -e "s|;HelpFile = /usr/share/doc/ngircd/Commands.txt|HelpFile = /usr/share/doc/ngircd-full/Commands.txt|g" | \
  138. sed -e "s|;PidFile = /var/run/ngircd/ngircd.pid|PidFile = /var/run/ircd/ngircd.pid|g" \
  139. >$(CURDIR)/debian/ngircd-full/etc/ngircd/ngircd.conf
  140. touch $(CURDIR)/debian/ngircd-full/etc/ngircd/ngircd.motd
  141. mkdir -p $(CURDIR)/debian/ngircd-full/etc/pam.d
  142. cp $(CURDIR)/debian/ngircd.pam $(CURDIR)/debian/ngircd-full/etc/pam.d/ngircd
  143. install-ngircd-full-dbg: build-ngircd-full-dbg
  144. dh_testdir
  145. dh_testroot
  146. dh_installdirs
  147. # Add here commands to install the "full" package into debian/ngircd-full:
  148. $(MAKE) install DESTDIR=$(CURDIR)/debian/ngircd-full-dbg
  149. rm $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd/INSTALL*
  150. rm $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd/COPYING*
  151. mv $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd \
  152. $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd-full-dbg
  153. mkdir -p $(CURDIR)/debian/ngircd-full-dbg/var/run/ircd
  154. cat $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd-full-dbg/sample-ngircd.conf | \
  155. sed -e "s|;ServerUID = 65534|ServerUID = irc|g" | \
  156. sed -e "s|;ServerGID = 65534|ServerGID = irc|g" | \
  157. sed -e "s|;MotdFile = /usr/local/etc/ngircd.motd|MotdFile = /etc/ngircd/ngircd.motd|g" | \
  158. sed -e "s|;HelpFile = /usr/share/doc/ngircd/Commands.txt|HelpFile = /usr/share/doc/ngircd-full-dbg/Commands.txt|g" | \
  159. sed -e "s|;PidFile = /var/run/ngircd/ngircd.pid|PidFile = /var/run/ircd/ngircd.pid|g" \
  160. >$(CURDIR)/debian/ngircd-full-dbg/etc/ngircd/ngircd.conf
  161. touch $(CURDIR)/debian/ngircd-full-dbg/etc/ngircd/ngircd.motd
  162. mkdir -p $(CURDIR)/debian/ngircd-full-dbg/etc/pam.d
  163. cp $(CURDIR)/debian/ngircd.pam $(CURDIR)/debian/ngircd-full-dbg/etc/pam.d/ngircd
  164. # Build architecture-independent files here.
  165. binary-indep:
  166. # We have nothing to do by default.
  167. # Build architecture-dependent files here.
  168. binary-arch: build install
  169. ln -s $(CURDIR)/debian/ngircd.default \
  170. $(CURDIR)/debian/ngircd-full.default
  171. ln -s $(CURDIR)/debian/ngircd.init \
  172. $(CURDIR)/debian/ngircd-full.init
  173. ln -s $(CURDIR)/debian/ngircd.postinst \
  174. $(CURDIR)/debian/ngircd-full.postinst
  175. ln -s $(CURDIR)/debian/ngircd.default \
  176. $(CURDIR)/debian/ngircd-full-dbg.default
  177. ln -s $(CURDIR)/debian/ngircd.init \
  178. $(CURDIR)/debian/ngircd-full-dbg.init
  179. ln -s $(CURDIR)/debian/ngircd.postinst \
  180. $(CURDIR)/debian/ngircd-full-dbg.postinst
  181. dh_testdir
  182. dh_testroot
  183. dh_installchangelogs -a -A ChangeLog
  184. dh_installdocs -a
  185. dh_installinit -a
  186. dh_strip -a --no-package=ngircd-full-dbg
  187. dh_compress -a -XCommands.txt
  188. dh_fixperms -a
  189. dh_installdeb -a
  190. dh_shlibdeps -a
  191. dh_gencontrol -a
  192. dh_md5sums -a
  193. dh_builddeb -a
  194. binary: binary-indep binary-arch
  195. .PHONY: build clean binary-indep binary-arch binary install
  196. # -eof-