3 # ngIRCd -- The Next Generation IRC Daemon
4 # Copyright (c)2001-2009 Alexander Barton <alex@barton.de>
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.
12 # debian/rules for ngIRCd
14 # Based on the sample debian/rules that uses debhelper,
15 # GNU copyright 1997 to 1999 by Joey Hess.
18 # Uncomment this to turn on verbose mode.
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)
28 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
33 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
37 configure-ngircd: configure
40 # configure "standard" variant:
41 ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
43 --sysconfdir=/etc/ngircd \
44 --mandir=\$${prefix}/share/man \
45 --with-syslog --with-zlib
47 configure-ngircd-full: configure
50 # configure "full" variant:
51 ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
53 --sysconfdir=/etc/ngircd \
54 --mandir=\$${prefix}/share/man \
55 --with-syslog --with-zlib \
56 --with-gnutls --with-ident --with-tcp-wrappers \
59 configure-ngircd-full-dbg: configure
62 # configure "full debug" variant:
63 ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
65 --sysconfdir=/etc/ngircd \
66 --mandir=\$${prefix}/share/man \
67 --enable-debug --enable-sniffer \
68 --with-syslog --with-zlib \
69 --with-gnutls --with-ident --with-tcp-wrappers \
75 build-ngircd: build-stamp-ngircd
76 build-stamp-ngircd: configure-ngircd
80 # Add here commands to compile the "standard" package:
83 touch build-stamp-ngircd
85 build-ngircd-full: build-stamp-ngircd-full
86 build-stamp-ngircd-full: configure-ngircd-full
90 # Add here commands to compile the "full" package:
93 touch build-stamp-ngircd-full
95 build-ngircd-full-dbg: build-stamp-ngircd-full-dbg
96 build-stamp-ngircd-full-dbg: configure-ngircd-full-dbg
100 # Add here commands to compile the "full debug" package:
103 touch build-stamp-ngircd-full
109 rm -f $(CURDIR)/debian/ngircd-full.default
110 rm -f $(CURDIR)/debian/ngircd-full.init
111 rm -f $(CURDIR)/debian/ngircd-full.postinst
112 rm -f $(CURDIR)/debian/ngircd-full-dbg.default
113 rm -f $(CURDIR)/debian/ngircd-full-dbg.postinst
114 rm -f $(CURDIR)/debian/ngircd-full-dbg.init
116 # Add here commands to clean up after the build process:
117 [ ! -f Makefile ] || $(MAKE) distclean
119 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
120 cp -f /usr/share/misc/config.sub config.sub
122 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
123 cp -f /usr/share/misc/config.guess config.guess
127 install: install-ngircd install-ngircd-full install-ngircd-full-dbg
129 install-ngircd: build-ngircd
134 # Add here commands to install the "standard" package into debian/ngircd:
135 $(MAKE) install DESTDIR=$(CURDIR)/debian/ngircd
136 rm $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/INSTALL*
137 rm $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/COPYING*
138 mkdir -p $(CURDIR)/debian/ngircd/var/run/ircd
139 cat $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/sample-ngircd.conf | \
140 sed -e "s/;ServerUID = 65534/ServerUID = irc/g" | \
141 sed -e "s/;ServerGID = 65534/ServerGID = irc/g" | \
142 sed -e "s/;MotdFile = \/usr\/local\/etc\/ngircd.motd/MotdFile = \/etc\/ngircd\/ngircd.motd/g" | \
143 sed -e "s/;PidFile = \/var\/run\/ngircd\/ngircd.pid/PidFile = \/var\/run\/ircd\/ngircd.pid/g" \
144 >$(CURDIR)/debian/ngircd/etc/ngircd/ngircd.conf
145 touch $(CURDIR)/debian/ngircd/etc/ngircd/ngircd.motd
147 install-ngircd-full: build-ngircd-full
152 # Add here commands to install the "full" package into debian/ngircd-full:
153 $(MAKE) install DESTDIR=$(CURDIR)/debian/ngircd-full
154 rm $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd/INSTALL*
155 rm $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd/COPYING*
156 mv $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd \
157 $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd-full
158 mkdir -p $(CURDIR)/debian/ngircd-full/var/run/ircd
159 cat $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd-full/sample-ngircd.conf | \
160 sed -e "s/;ServerUID = 65534/ServerUID = irc/g" | \
161 sed -e "s/;ServerGID = 65534/ServerGID = irc/g" | \
162 sed -e "s/;MotdFile = \/usr\/local\/etc\/ngircd.motd/MotdFile = \/etc\/ngircd\/ngircd.motd/g" | \
163 sed -e "s/;PidFile = \/var\/run\/ngircd\/ngircd.pid/PidFile = \/var\/run\/ircd\/ngircd.pid/g" \
164 >$(CURDIR)/debian/ngircd-full/etc/ngircd/ngircd.conf
165 touch $(CURDIR)/debian/ngircd-full/etc/ngircd/ngircd.motd
167 install-ngircd-full-dbg: build-ngircd-full-dbg
172 # Add here commands to install the "full" package into debian/ngircd-full:
173 $(MAKE) install DESTDIR=$(CURDIR)/debian/ngircd-full-dbg
174 rm $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd/INSTALL*
175 rm $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd/COPYING*
176 mv $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd \
177 $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd-full-dbg
178 mkdir -p $(CURDIR)/debian/ngircd-full-dbg/var/run/ircd
179 cat $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd-full-dbg/sample-ngircd.conf | \
180 sed -e "s/;ServerUID = 65534/ServerUID = irc/g" | \
181 sed -e "s/;ServerGID = 65534/ServerGID = irc/g" | \
182 sed -e "s/;MotdFile = \/usr\/local\/etc\/ngircd.motd/MotdFile = \/etc\/ngircd\/ngircd.motd/g" | \
183 sed -e "s/;PidFile = \/var\/run\/ngircd\/ngircd.pid/PidFile = \/var\/run\/ircd\/ngircd.pid/g" \
184 >$(CURDIR)/debian/ngircd-full-dbg/etc/ngircd/ngircd.conf
185 touch $(CURDIR)/debian/ngircd-full-dbg/etc/ngircd/ngircd.motd
187 # Build architecture-independent files here.
189 # We have nothing to do by default.
191 # Build architecture-dependent files here.
192 binary-arch: build install
193 ln -s $(CURDIR)/debian/ngircd.default \
194 $(CURDIR)/debian/ngircd-full.default
195 ln -s $(CURDIR)/debian/ngircd.init \
196 $(CURDIR)/debian/ngircd-full.init
197 ln -s $(CURDIR)/debian/ngircd.postinst \
198 $(CURDIR)/debian/ngircd-full.postinst
200 ln -s $(CURDIR)/debian/ngircd.default \
201 $(CURDIR)/debian/ngircd-full-dbg.default
202 ln -s $(CURDIR)/debian/ngircd.init \
203 $(CURDIR)/debian/ngircd-full-dbg.init
204 ln -s $(CURDIR)/debian/ngircd.postinst \
205 $(CURDIR)/debian/ngircd-full-dbg.postinst
209 dh_installchangelogs -a -A ChangeLog
212 dh_strip -a --no-package=ngircd-full-dbg
221 binary: binary-indep binary-arch
223 .PHONY: build clean binary-indep binary-arch binary install