rules 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. #!/usr/bin/make -f
  2. #
  3. # ngIRCd -- The Next Generation IRC Daemon
  4. # Copyright (c)2001-2014 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-gnutls --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-gnutls --with-iconv --with-ident --with-tcp-wrappers \
  64. --with-pam \
  65. --enable-ipv6
  66. build:
  67. dh_clean -k
  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-full.default
  94. rm -f $(CURDIR)/debian/ngircd-full.init
  95. rm -f $(CURDIR)/debian/ngircd-full.postinst
  96. rm -f $(CURDIR)/debian/ngircd-full-dbg.default
  97. rm -f $(CURDIR)/debian/ngircd-full-dbg.postinst
  98. rm -f $(CURDIR)/debian/ngircd-full-dbg.init
  99. # Add here commands to clean up after the build process:
  100. [ ! -f Makefile ] || $(MAKE) distclean
  101. ifneq "$(wildcard /usr/share/misc/config.sub)" ""
  102. cp -f /usr/share/misc/config.sub config.sub
  103. endif
  104. ifneq "$(wildcard /usr/share/misc/config.guess)" ""
  105. cp -f /usr/share/misc/config.guess config.guess
  106. endif
  107. dh_clean
  108. install: install-ngircd install-ngircd-full install-ngircd-full-dbg
  109. install-ngircd: build-ngircd
  110. dh_testdir
  111. dh_testroot
  112. dh_installdirs
  113. # Add here commands to install the "standard" package into debian/ngircd:
  114. $(MAKE) install DESTDIR=$(CURDIR)/debian/ngircd
  115. rm $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/INSTALL*
  116. rm $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/COPYING*
  117. mkdir -p $(CURDIR)/debian/ngircd/var/run/ircd
  118. cat $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/sample-ngircd.conf | \
  119. sed -e "s|;ServerUID = 65534|ServerUID = irc|g" | \
  120. sed -e "s|;ServerGID = 65534|ServerGID = irc|g" | \
  121. sed -e "s|;PidFile = /var/run/ngircd/ngircd.pid|PidFile = /var/run/ircd/ngircd.pid|g" \
  122. >$(CURDIR)/debian/ngircd/etc/ngircd/ngircd.conf
  123. touch $(CURDIR)/debian/ngircd/etc/ngircd/ngircd.motd
  124. install-ngircd-full: build-ngircd-full
  125. dh_testdir
  126. dh_testroot
  127. dh_installdirs
  128. # Add here commands to install the "full" package into debian/ngircd-full:
  129. $(MAKE) install DESTDIR=$(CURDIR)/debian/ngircd-full
  130. rm $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd-full/INSTALL*
  131. rm $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd-full/COPYING*
  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|;PidFile = /var/run/ngircd/ngircd.pid|PidFile = /var/run/ircd/ngircd.pid|g" \
  137. >$(CURDIR)/debian/ngircd-full/etc/ngircd/ngircd.conf
  138. touch $(CURDIR)/debian/ngircd-full/etc/ngircd/ngircd.motd
  139. mkdir -p $(CURDIR)/debian/ngircd-full/etc/pam.d
  140. cp $(CURDIR)/debian/ngircd.pam $(CURDIR)/debian/ngircd-full/etc/pam.d/ngircd
  141. install-ngircd-full-dbg: build-ngircd-full-dbg
  142. dh_testdir
  143. dh_testroot
  144. dh_installdirs
  145. # Add here commands to install the "full" package into debian/ngircd-full:
  146. $(MAKE) install DESTDIR=$(CURDIR)/debian/ngircd-full-dbg
  147. rm $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd-full-dbg/INSTALL*
  148. rm $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd-full-dbg/COPYING*
  149. mkdir -p $(CURDIR)/debian/ngircd-full-dbg/var/run/ircd
  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)/debian/ngircd.default \
  164. $(CURDIR)/debian/ngircd-full.default
  165. ln -s $(CURDIR)/debian/ngircd.init \
  166. $(CURDIR)/debian/ngircd-full.init
  167. ln -s $(CURDIR)/debian/ngircd.postinst \
  168. $(CURDIR)/debian/ngircd-full.postinst
  169. ln -s $(CURDIR)/debian/ngircd.default \
  170. $(CURDIR)/debian/ngircd-full-dbg.default
  171. ln -s $(CURDIR)/debian/ngircd.init \
  172. $(CURDIR)/debian/ngircd-full-dbg.init
  173. ln -s $(CURDIR)/debian/ngircd.postinst \
  174. $(CURDIR)/debian/ngircd-full-dbg.postinst
  175. dh_testdir
  176. dh_testroot
  177. dh_installchangelogs -a -A ChangeLog
  178. dh_installdocs -a
  179. dh_installinit -a
  180. dh_strip -a --no-package=ngircd-full-dbg
  181. dh_compress -a -XCommands.txt
  182. dh_fixperms -a
  183. dh_installdeb -a
  184. dh_shlibdeps -a
  185. dh_gencontrol -a
  186. dh_md5sums -a
  187. dh_builddeb -a
  188. binary: binary-indep binary-arch
  189. .PHONY: build clean binary-indep binary-arch binary install
  190. # -eof-