3 # ngIRCd -- The Next Generation IRC Daemon
4 # Copyright (c)2001-2014 Alexander Barton (alex@barton.de) and Contributors
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 --docdir=\$${prefix}/share/doc/ngircd \
46 --with-syslog --with-zlib
48 configure-ngircd-full: configure
51 # configure "full" variant:
52 ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
54 --sysconfdir=/etc/ngircd \
55 --mandir=\$${prefix}/share/man \
56 --docdir=\$${prefix}/share/doc/ngircd-full \
57 --with-syslog --with-zlib \
58 --with-gnutls --with-iconv --with-ident --with-tcp-wrappers \
62 configure-ngircd-full-dbg: configure
65 # configure "full debug" variant:
66 ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
68 --sysconfdir=/etc/ngircd \
69 --mandir=\$${prefix}/share/man \
70 --docdir=\$${prefix}/share/doc/ngircd-full-dbg \
71 --enable-debug --enable-sniffer \
72 --with-syslog --with-zlib \
73 --with-gnutls --with-iconv --with-ident --with-tcp-wrappers \
80 build-ngircd: build-stamp-ngircd
81 build-stamp-ngircd: configure-ngircd
85 # Add here commands to compile the "standard" package:
88 touch build-stamp-ngircd
90 build-ngircd-full: build-stamp-ngircd-full
91 build-stamp-ngircd-full: configure-ngircd-full
95 # Add here commands to compile the "full" package:
98 touch build-stamp-ngircd-full
100 build-ngircd-full-dbg: build-stamp-ngircd-full-dbg
101 build-stamp-ngircd-full-dbg: configure-ngircd-full-dbg
105 # Add here commands to compile the "full debug" package:
108 touch build-stamp-ngircd-full
114 rm -f $(CURDIR)/debian/ngircd-full.default
115 rm -f $(CURDIR)/debian/ngircd-full.init
116 rm -f $(CURDIR)/debian/ngircd-full.postinst
117 rm -f $(CURDIR)/debian/ngircd-full-dbg.default
118 rm -f $(CURDIR)/debian/ngircd-full-dbg.postinst
119 rm -f $(CURDIR)/debian/ngircd-full-dbg.init
121 # Add here commands to clean up after the build process:
122 [ ! -f Makefile ] || $(MAKE) distclean
124 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
125 cp -f /usr/share/misc/config.sub config.sub
127 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
128 cp -f /usr/share/misc/config.guess config.guess
132 install: install-ngircd install-ngircd-full install-ngircd-full-dbg
134 install-ngircd: build-ngircd
139 # Add here commands to install the "standard" package into debian/ngircd:
140 $(MAKE) install DESTDIR=$(CURDIR)/debian/ngircd
141 rm $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/INSTALL*
142 rm $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/COPYING*
143 mkdir -p $(CURDIR)/debian/ngircd/var/run/ircd
144 cat $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/sample-ngircd.conf | \
145 sed -e "s|;ServerUID = 65534|ServerUID = irc|g" | \
146 sed -e "s|;ServerGID = 65534|ServerGID = irc|g" | \
147 sed -e "s|;PidFile = /var/run/ngircd/ngircd.pid|PidFile = /var/run/ircd/ngircd.pid|g" \
148 >$(CURDIR)/debian/ngircd/etc/ngircd/ngircd.conf
149 touch $(CURDIR)/debian/ngircd/etc/ngircd/ngircd.motd
151 install-ngircd-full: build-ngircd-full
156 # Add here commands to install the "full" package into debian/ngircd-full:
157 $(MAKE) install DESTDIR=$(CURDIR)/debian/ngircd-full
158 rm $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd-full/INSTALL*
159 rm $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd-full/COPYING*
160 mkdir -p $(CURDIR)/debian/ngircd-full/var/run/ircd
161 cat $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd-full/sample-ngircd.conf | \
162 sed -e "s|;ServerUID = 65534|ServerUID = irc|g" | \
163 sed -e "s|;ServerGID = 65534|ServerGID = irc|g" | \
164 sed -e "s|;PidFile = /var/run/ngircd/ngircd.pid|PidFile = /var/run/ircd/ngircd.pid|g" \
165 >$(CURDIR)/debian/ngircd-full/etc/ngircd/ngircd.conf
166 touch $(CURDIR)/debian/ngircd-full/etc/ngircd/ngircd.motd
167 mkdir -p $(CURDIR)/debian/ngircd-full/etc/pam.d
168 cp $(CURDIR)/debian/ngircd.pam $(CURDIR)/debian/ngircd-full/etc/pam.d/ngircd
170 install-ngircd-full-dbg: build-ngircd-full-dbg
175 # Add here commands to install the "full" package into debian/ngircd-full:
176 $(MAKE) install DESTDIR=$(CURDIR)/debian/ngircd-full-dbg
177 rm $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd-full-dbg/INSTALL*
178 rm $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd-full-dbg/COPYING*
179 mkdir -p $(CURDIR)/debian/ngircd-full-dbg/var/run/ircd
180 cat $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd-full-dbg/sample-ngircd.conf | \
181 sed -e "s|;ServerUID = 65534|ServerUID = irc|g" | \
182 sed -e "s|;ServerGID = 65534|ServerGID = irc|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
186 mkdir -p $(CURDIR)/debian/ngircd-full-dbg/etc/pam.d
187 cp $(CURDIR)/debian/ngircd.pam $(CURDIR)/debian/ngircd-full-dbg/etc/pam.d/ngircd
189 # Build architecture-independent files here.
191 # We have nothing to do by default.
193 # Build architecture-dependent files here.
194 binary-arch: build install
195 ln -s $(CURDIR)/debian/ngircd.default \
196 $(CURDIR)/debian/ngircd-full.default
197 ln -s $(CURDIR)/debian/ngircd.init \
198 $(CURDIR)/debian/ngircd-full.init
199 ln -s $(CURDIR)/debian/ngircd.postinst \
200 $(CURDIR)/debian/ngircd-full.postinst
202 ln -s $(CURDIR)/debian/ngircd.default \
203 $(CURDIR)/debian/ngircd-full-dbg.default
204 ln -s $(CURDIR)/debian/ngircd.init \
205 $(CURDIR)/debian/ngircd-full-dbg.init
206 ln -s $(CURDIR)/debian/ngircd.postinst \
207 $(CURDIR)/debian/ngircd-full-dbg.postinst
211 dh_installchangelogs -a -A ChangeLog
214 dh_strip -a --no-package=ngircd-full-dbg
215 dh_compress -a -XCommands.txt
223 binary: binary-indep binary-arch
225 .PHONY: build clean binary-indep binary-arch binary install