1
0

rules 7.5 KB

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