1
0

rules 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. #!/usr/bin/make -f
  2. #
  3. # ngIRCd -- The Next Generation IRC Daemon
  4. # Copyright (c)2001-2003 by 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. # $Id: rules,v 1.3 2005/02/07 23:09:31 alex Exp $
  15. #
  16. # Based on the sample debian/rules that uses debhelper,
  17. # GNU copyright 1997 to 1999 by Joey Hess.
  18. #
  19. # Uncomment this to turn on verbose mode.
  20. #export DH_VERBOSE=1
  21. # These are used for cross-compiling and for saving the configure script
  22. # from having to guess our platform (since we know it already)
  23. DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
  24. DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
  25. CFLAGS = -Wall -g
  26. ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
  27. CFLAGS += -O0
  28. else
  29. CFLAGS += -O2
  30. endif
  31. ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
  32. INSTALL_PROGRAM += -s
  33. endif
  34. configure-ngircd: configure
  35. dh_testdir
  36. # configure "standard" variant:
  37. ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
  38. --prefix=/usr \
  39. --sysconfdir=/etc/ngircd \
  40. --mandir=\$${prefix}/share/man \
  41. --with-syslog --with-zlib
  42. configure-ngircd-full: configure
  43. dh_testdir
  44. # configure "full" variant:
  45. ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
  46. --prefix=/usr \
  47. --sysconfdir=/etc/ngircd \
  48. --mandir=\$${prefix}/share/man \
  49. --with-syslog --with-zlib --with-tcp-wrappers --with-ident
  50. build:
  51. dh_clean -k
  52. build-ngircd: build-stamp-ngircd
  53. build-stamp-ngircd: configure-ngircd
  54. dh_testdir
  55. rm -f build-stamp-*
  56. # Add here commands to compile the "standard" package:
  57. $(MAKE)
  58. touch build-stamp-ngircd
  59. build-ngircd-full: build-stamp-ngircd-full
  60. build-stamp-ngircd-full: configure-ngircd-full
  61. dh_testdir
  62. rm -f build-stamp-*
  63. # Add here commands to compile the "full" package:
  64. $(MAKE)
  65. touch build-stamp-ngircd-full
  66. clean:
  67. dh_testdir
  68. dh_testroot
  69. rm -f build-stamp*
  70. rm -f $(CURDIR)/debian/ngircd-full.default
  71. rm -f $(CURDIR)/debian/ngircd-full.init
  72. rm -f $(CURDIR)/debian/ngircd-full.postinst
  73. # Add here commands to clean up after the build process:
  74. -$(MAKE) clean
  75. ifneq "$(wildcard /usr/share/misc/config.sub)" ""
  76. cp -f /usr/share/misc/config.sub config.sub
  77. endif
  78. ifneq "$(wildcard /usr/share/misc/config.guess)" ""
  79. cp -f /usr/share/misc/config.guess config.guess
  80. endif
  81. dh_clean
  82. install: install-ngircd install-ngircd-full
  83. install-ngircd: build-ngircd
  84. dh_testdir
  85. dh_testroot
  86. dh_installdirs
  87. # Add here commands to install the "standard" package into debian/ngircd:
  88. $(MAKE) install DESTDIR=$(CURDIR)/debian/ngircd
  89. rm $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/INSTALL*
  90. rm $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/COPYING*
  91. mkdir -p $(CURDIR)/debian/ngircd/var/run/ircd
  92. cat $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/sample-ngircd.conf | \
  93. sed -e "s/;ServerUID = 65534/ServerUID = irc/g" | \
  94. sed -e "s/;ServerGID = 65534/ServerGID = irc/g" | \
  95. sed -e "s/;MotdFile = \/usr\/local\/etc\/ngircd.motd/MotdFile = \/etc\/ngircd\/ngircd.motd/g" | \
  96. sed -e "s/;PidFile = \/var\/run\/ngircd\/ngircd.pid/PidFile = \/var\/run\/ircd\/ngircd.pid/g" \
  97. >$(CURDIR)/debian/ngircd/etc/ngircd/ngircd.conf
  98. touch $(CURDIR)/debian/ngircd/etc/ngircd/ngircd.motd
  99. install-ngircd-full: build-ngircd-full
  100. dh_testdir
  101. dh_testroot
  102. dh_installdirs
  103. # Add here commands to install the "full" package into debian/ngircd-full:
  104. $(MAKE) install DESTDIR=$(CURDIR)/debian/ngircd-full
  105. rm $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd/INSTALL*
  106. rm $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd/COPYING*
  107. mv $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd \
  108. $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd-full
  109. mkdir -p $(CURDIR)/debian/ngircd-full/var/run/ircd
  110. cat $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd-full/sample-ngircd.conf | \
  111. sed -e "s/;ServerUID = 65534/ServerUID = irc/g" | \
  112. sed -e "s/;ServerGID = 65534/ServerGID = irc/g" | \
  113. sed -e "s/;MotdFile = \/usr\/local\/etc\/ngircd.motd/MotdFile = \/etc\/ngircd\/ngircd.motd/g" | \
  114. sed -e "s/;PidFile = \/var\/run\/ngircd\/ngircd.pid/PidFile = \/var\/run\/ircd\/ngircd.pid/g" \
  115. >$(CURDIR)/debian/ngircd-full/etc/ngircd/ngircd.conf
  116. touch $(CURDIR)/debian/ngircd-full/etc/ngircd/ngircd.motd
  117. # Build architecture-independent files here.
  118. binary-indep:
  119. # We have nothing to do by default.
  120. # Build architecture-dependent files here.
  121. binary-arch: build install
  122. ln -s $(CURDIR)/debian/ngircd.default \
  123. $(CURDIR)/debian/ngircd-full.default
  124. ln -s $(CURDIR)/debian/ngircd.init \
  125. $(CURDIR)/debian/ngircd-full.init
  126. ln -s $(CURDIR)/debian/ngircd.postinst \
  127. $(CURDIR)/debian/ngircd-full.postinst
  128. dh_testdir
  129. dh_testroot
  130. dh_installchangelogs -a -A ChangeLog
  131. dh_installdocs -a
  132. dh_installinit -a
  133. dh_strip -a
  134. dh_compress -a
  135. dh_fixperms -a
  136. dh_installdeb -a
  137. dh_shlibdeps -a
  138. dh_gencontrol -a
  139. dh_md5sums -a
  140. dh_builddeb -a
  141. binary: binary-indep binary-arch
  142. .PHONY: build clean binary-indep binary-arch binary install
  143. # -eof-