Blame


1 ed94d5d5 2003-12-31 alex #!/usr/bin/make -f
2 ed94d5d5 2003-12-31 alex #
3 ed94d5d5 2003-12-31 alex # ngIRCd -- The Next Generation IRC Daemon
4 ed94d5d5 2003-12-31 alex # Copyright (c)2001-2003 by Alexander Barton (alex@barton.de)
5 ed94d5d5 2003-12-31 alex #
6 ed94d5d5 2003-12-31 alex # This program is free software; you can redistribute it and/or modify
7 ed94d5d5 2003-12-31 alex # it under the terms of the GNU General Public License as published by
8 ed94d5d5 2003-12-31 alex # the Free Software Foundation; either version 2 of the License, or
9 ed94d5d5 2003-12-31 alex # (at your option) any later version.
10 ed94d5d5 2003-12-31 alex # Please read the file COPYING, README and AUTHORS for more information.
11 ed94d5d5 2003-12-31 alex #
12 ed94d5d5 2003-12-31 alex # debian/rules for ngIRCd
13 ed94d5d5 2003-12-31 alex #
14 c16d1b03 2005-02-07 alex # $Id: rules,v 1.3 2005/02/07 23:09:31 alex Exp $
15 ed94d5d5 2003-12-31 alex #
16 ed94d5d5 2003-12-31 alex # Based on the sample debian/rules that uses debhelper,
17 ed94d5d5 2003-12-31 alex # GNU copyright 1997 to 1999 by Joey Hess.
18 ed94d5d5 2003-12-31 alex #
19 ed94d5d5 2003-12-31 alex
20 ed94d5d5 2003-12-31 alex # Uncomment this to turn on verbose mode.
21 ed94d5d5 2003-12-31 alex #export DH_VERBOSE=1
22 ed94d5d5 2003-12-31 alex
23 ed94d5d5 2003-12-31 alex # These are used for cross-compiling and for saving the configure script
24 ed94d5d5 2003-12-31 alex # from having to guess our platform (since we know it already)
25 ed94d5d5 2003-12-31 alex DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
26 ed94d5d5 2003-12-31 alex DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
27 ed94d5d5 2003-12-31 alex
28 ed94d5d5 2003-12-31 alex CFLAGS = -Wall -g
29 ed94d5d5 2003-12-31 alex
30 ed94d5d5 2003-12-31 alex ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
31 ed94d5d5 2003-12-31 alex CFLAGS += -O0
32 ed94d5d5 2003-12-31 alex else
33 ed94d5d5 2003-12-31 alex CFLAGS += -O2
34 ed94d5d5 2003-12-31 alex endif
35 ed94d5d5 2003-12-31 alex ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
36 ed94d5d5 2003-12-31 alex INSTALL_PROGRAM += -s
37 ed94d5d5 2003-12-31 alex endif
38 ed94d5d5 2003-12-31 alex
39 ad07c94c 2004-01-01 alex configure-ngircd: configure
40 ed94d5d5 2003-12-31 alex dh_testdir
41 c16d1b03 2005-02-07 alex
42 ad07c94c 2004-01-01 alex # configure "standard" variant:
43 ed94d5d5 2003-12-31 alex ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
44 ed94d5d5 2003-12-31 alex --prefix=/usr \
45 ed94d5d5 2003-12-31 alex --sysconfdir=/etc/ngircd \
46 ed94d5d5 2003-12-31 alex --mandir=\$${prefix}/share/man \
47 ed94d5d5 2003-12-31 alex --with-syslog --with-zlib
48 ed94d5d5 2003-12-31 alex
49 ad07c94c 2004-01-01 alex configure-ngircd-full: configure
50 ad07c94c 2004-01-01 alex dh_testdir
51 c16d1b03 2005-02-07 alex
52 ad07c94c 2004-01-01 alex # configure "full" variant:
53 ad07c94c 2004-01-01 alex ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
54 ad07c94c 2004-01-01 alex --prefix=/usr \
55 ad07c94c 2004-01-01 alex --sysconfdir=/etc/ngircd \
56 ad07c94c 2004-01-01 alex --mandir=\$${prefix}/share/man \
57 ad07c94c 2004-01-01 alex --with-syslog --with-zlib --with-tcp-wrappers --with-ident
58 ad07c94c 2004-01-01 alex
59 ad07c94c 2004-01-01 alex build:
60 ad07c94c 2004-01-01 alex dh_clean -k
61 ad07c94c 2004-01-01 alex
62 ad07c94c 2004-01-01 alex build-ngircd: build-stamp-ngircd
63 ad07c94c 2004-01-01 alex build-stamp-ngircd: configure-ngircd
64 ed94d5d5 2003-12-31 alex dh_testdir
65 ad07c94c 2004-01-01 alex rm -f build-stamp-*
66 c16d1b03 2005-02-07 alex
67 ad07c94c 2004-01-01 alex # Add here commands to compile the "standard" package:
68 ed94d5d5 2003-12-31 alex $(MAKE)
69 c16d1b03 2005-02-07 alex
70 ad07c94c 2004-01-01 alex touch build-stamp-ngircd
71 ed94d5d5 2003-12-31 alex
72 ad07c94c 2004-01-01 alex build-ngircd-full: build-stamp-ngircd-full
73 ad07c94c 2004-01-01 alex build-stamp-ngircd-full: configure-ngircd-full
74 ad07c94c 2004-01-01 alex dh_testdir
75 ad07c94c 2004-01-01 alex rm -f build-stamp-*
76 c16d1b03 2005-02-07 alex
77 ad07c94c 2004-01-01 alex # Add here commands to compile the "full" package:
78 ad07c94c 2004-01-01 alex $(MAKE)
79 c16d1b03 2005-02-07 alex
80 ad07c94c 2004-01-01 alex touch build-stamp-ngircd-full
81 ad07c94c 2004-01-01 alex
82 ed94d5d5 2003-12-31 alex clean:
83 ed94d5d5 2003-12-31 alex dh_testdir
84 ed94d5d5 2003-12-31 alex dh_testroot
85 ad07c94c 2004-01-01 alex rm -f build-stamp*
86 ad07c94c 2004-01-01 alex rm -f $(CURDIR)/debian/ngircd-full.default
87 ad07c94c 2004-01-01 alex rm -f $(CURDIR)/debian/ngircd-full.init
88 ad07c94c 2004-01-01 alex rm -f $(CURDIR)/debian/ngircd-full.postinst
89 c16d1b03 2005-02-07 alex
90 ad07c94c 2004-01-01 alex # Add here commands to clean up after the build process:
91 ad07c94c 2004-01-01 alex -$(MAKE) clean
92 c16d1b03 2005-02-07 alex
93 ed94d5d5 2003-12-31 alex ifneq "$(wildcard /usr/share/misc/config.sub)" ""
94 ed94d5d5 2003-12-31 alex cp -f /usr/share/misc/config.sub config.sub
95 ed94d5d5 2003-12-31 alex endif
96 ed94d5d5 2003-12-31 alex ifneq "$(wildcard /usr/share/misc/config.guess)" ""
97 ed94d5d5 2003-12-31 alex cp -f /usr/share/misc/config.guess config.guess
98 ed94d5d5 2003-12-31 alex endif
99 ed94d5d5 2003-12-31 alex dh_clean
100 ed94d5d5 2003-12-31 alex
101 ad07c94c 2004-01-01 alex install: install-ngircd install-ngircd-full
102 ad07c94c 2004-01-01 alex
103 ad07c94c 2004-01-01 alex install-ngircd: build-ngircd
104 ed94d5d5 2003-12-31 alex dh_testdir
105 ed94d5d5 2003-12-31 alex dh_testroot
106 ed94d5d5 2003-12-31 alex dh_installdirs
107 c16d1b03 2005-02-07 alex
108 ad07c94c 2004-01-01 alex # Add here commands to install the "standard" package into debian/ngircd:
109 ed94d5d5 2003-12-31 alex $(MAKE) install DESTDIR=$(CURDIR)/debian/ngircd
110 ad07c94c 2004-01-01 alex rm $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/INSTALL*
111 ad07c94c 2004-01-01 alex rm $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/COPYING*
112 c16d1b03 2005-02-07 alex mkdir -p $(CURDIR)/debian/ngircd/var/run/ircd
113 c16d1b03 2005-02-07 alex cat $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/sample-ngircd.conf | \
114 c16d1b03 2005-02-07 alex sed -e "s/;ServerUID = 65534/ServerUID = irc/g" | \
115 c16d1b03 2005-02-07 alex sed -e "s/;ServerGID = 65534/ServerGID = irc/g" | \
116 c16d1b03 2005-02-07 alex sed -e "s/;MotdFile = \/usr\/local\/etc\/ngircd.motd/MotdFile = \/etc\/ngircd\/ngircd.motd/g" | \
117 c16d1b03 2005-02-07 alex sed -e "s/;PidFile = \/var\/run\/ngircd\/ngircd.pid/PidFile = \/var\/run\/ircd\/ngircd.pid/g" \
118 c16d1b03 2005-02-07 alex >$(CURDIR)/debian/ngircd/etc/ngircd/ngircd.conf
119 c16d1b03 2005-02-07 alex touch $(CURDIR)/debian/ngircd/etc/ngircd/ngircd.motd
120 ed94d5d5 2003-12-31 alex
121 ad07c94c 2004-01-01 alex install-ngircd-full: build-ngircd-full
122 ad07c94c 2004-01-01 alex dh_testdir
123 ad07c94c 2004-01-01 alex dh_testroot
124 ad07c94c 2004-01-01 alex dh_installdirs
125 c16d1b03 2005-02-07 alex
126 ad07c94c 2004-01-01 alex # Add here commands to install the "full" package into debian/ngircd-full:
127 ad07c94c 2004-01-01 alex $(MAKE) install DESTDIR=$(CURDIR)/debian/ngircd-full
128 ad07c94c 2004-01-01 alex rm $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd/INSTALL*
129 ad07c94c 2004-01-01 alex rm $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd/COPYING*
130 ad07c94c 2004-01-01 alex mv $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd \
131 ad07c94c 2004-01-01 alex $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd-full
132 c16d1b03 2005-02-07 alex mkdir -p $(CURDIR)/debian/ngircd-full/var/run/ircd
133 c16d1b03 2005-02-07 alex cat $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd-full/sample-ngircd.conf | \
134 c16d1b03 2005-02-07 alex sed -e "s/;ServerUID = 65534/ServerUID = irc/g" | \
135 c16d1b03 2005-02-07 alex sed -e "s/;ServerGID = 65534/ServerGID = irc/g" | \
136 c16d1b03 2005-02-07 alex sed -e "s/;MotdFile = \/usr\/local\/etc\/ngircd.motd/MotdFile = \/etc\/ngircd\/ngircd.motd/g" | \
137 c16d1b03 2005-02-07 alex sed -e "s/;PidFile = \/var\/run\/ngircd\/ngircd.pid/PidFile = \/var\/run\/ircd\/ngircd.pid/g" \
138 c16d1b03 2005-02-07 alex >$(CURDIR)/debian/ngircd-full/etc/ngircd/ngircd.conf
139 c16d1b03 2005-02-07 alex touch $(CURDIR)/debian/ngircd-full/etc/ngircd/ngircd.motd
140 ad07c94c 2004-01-01 alex
141 ed94d5d5 2003-12-31 alex # Build architecture-independent files here.
142 ad07c94c 2004-01-01 alex binary-indep:
143 ed94d5d5 2003-12-31 alex # We have nothing to do by default.
144 ed94d5d5 2003-12-31 alex
145 ed94d5d5 2003-12-31 alex # Build architecture-dependent files here.
146 ed94d5d5 2003-12-31 alex binary-arch: build install
147 ad07c94c 2004-01-01 alex ln -s $(CURDIR)/debian/ngircd.default \
148 ad07c94c 2004-01-01 alex $(CURDIR)/debian/ngircd-full.default
149 ad07c94c 2004-01-01 alex ln -s $(CURDIR)/debian/ngircd.init \
150 ad07c94c 2004-01-01 alex $(CURDIR)/debian/ngircd-full.init
151 ad07c94c 2004-01-01 alex ln -s $(CURDIR)/debian/ngircd.postinst \
152 ad07c94c 2004-01-01 alex $(CURDIR)/debian/ngircd-full.postinst
153 ad07c94c 2004-01-01 alex
154 ed94d5d5 2003-12-31 alex dh_testdir
155 ed94d5d5 2003-12-31 alex dh_testroot
156 ad07c94c 2004-01-01 alex dh_installchangelogs -a -A ChangeLog
157 ad07c94c 2004-01-01 alex dh_installdocs -a
158 ad07c94c 2004-01-01 alex dh_installinit -a
159 ad07c94c 2004-01-01 alex dh_strip -a
160 ad07c94c 2004-01-01 alex dh_compress -a
161 ad07c94c 2004-01-01 alex dh_fixperms -a
162 ad07c94c 2004-01-01 alex dh_installdeb -a
163 ad07c94c 2004-01-01 alex dh_shlibdeps -a
164 ad07c94c 2004-01-01 alex dh_gencontrol -a
165 ad07c94c 2004-01-01 alex dh_md5sums -a
166 ad07c94c 2004-01-01 alex dh_builddeb -a
167 ed94d5d5 2003-12-31 alex
168 ed94d5d5 2003-12-31 alex binary: binary-indep binary-arch
169 ed94d5d5 2003-12-31 alex
170 ed94d5d5 2003-12-31 alex .PHONY: build clean binary-indep binary-arch binary install
171 ed94d5d5 2003-12-31 alex
172 ed94d5d5 2003-12-31 alex # -eof-