rules 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  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/;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/INSTALL*
  149. rm $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd/COPYING*
  150. mv $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd \
  151. $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd-full-dbg
  152. mkdir -p $(CURDIR)/debian/ngircd-full-dbg/var/run/ircd
  153. cat $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd-full-dbg/sample-ngircd.conf | \
  154. sed -e "s/;ServerUID = 65534/ServerUID = irc/g" | \
  155. sed -e "s/;ServerGID = 65534/ServerGID = irc/g" | \
  156. sed -e "s/;MotdFile = \/usr\/local\/etc\/ngircd.motd/MotdFile = \/etc\/ngircd\/ngircd.motd/g" | \
  157. sed -e "s/;PidFile = \/var\/run\/ngircd\/ngircd.pid/PidFile = \/var\/run\/ircd\/ngircd.pid/g" \
  158. >$(CURDIR)/debian/ngircd-full-dbg/etc/ngircd/ngircd.conf
  159. touch $(CURDIR)/debian/ngircd-full-dbg/etc/ngircd/ngircd.motd
  160. mkdir -p $(CURDIR)/debian/ngircd-full-dbg/etc/pam.d
  161. cp $(CURDIR)/debian/ngircd.pam $(CURDIR)/debian/ngircd-full-dbg/etc/pam.d/ngircd
  162. # Build architecture-independent files here.
  163. binary-indep:
  164. # We have nothing to do by default.
  165. # Build architecture-dependent files here.
  166. binary-arch: build install
  167. ln -s $(CURDIR)/debian/ngircd.default \
  168. $(CURDIR)/debian/ngircd-full.default
  169. ln -s $(CURDIR)/debian/ngircd.init \
  170. $(CURDIR)/debian/ngircd-full.init
  171. ln -s $(CURDIR)/debian/ngircd.postinst \
  172. $(CURDIR)/debian/ngircd-full.postinst
  173. ln -s $(CURDIR)/debian/ngircd.default \
  174. $(CURDIR)/debian/ngircd-full-dbg.default
  175. ln -s $(CURDIR)/debian/ngircd.init \
  176. $(CURDIR)/debian/ngircd-full-dbg.init
  177. ln -s $(CURDIR)/debian/ngircd.postinst \
  178. $(CURDIR)/debian/ngircd-full-dbg.postinst
  179. dh_testdir
  180. dh_testroot
  181. dh_installchangelogs -a -A ChangeLog
  182. dh_installdocs -a
  183. dh_installinit -a
  184. dh_strip -a --no-package=ngircd-full-dbg
  185. dh_compress -a
  186. dh_fixperms -a
  187. dh_installdeb -a
  188. dh_shlibdeps -a
  189. dh_gencontrol -a
  190. dh_md5sums -a
  191. dh_builddeb -a
  192. binary: binary-indep binary-arch
  193. .PHONY: build clean binary-indep binary-arch binary install
  194. # -eof-