]> arthur.barton.de Git - ngircd-alex.git/blob - contrib/Debian/rules
Restructured debian packaging system: now there are two packages, a "standard"
[ngircd-alex.git] / contrib / Debian / rules
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.2 2004/01/01 22:24:48 alex Exp $
15 #
16 # Based on the sample debian/rules that uses debhelper,
17 # GNU copyright 1997 to 1999 by Joey Hess.
18 #
19
20 # Uncomment this to turn on verbose mode.
21 #export DH_VERBOSE=1
22
23 # These are used for cross-compiling and for saving the configure script
24 # from having to guess our platform (since we know it already)
25 DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
26 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
27
28 CFLAGS = -Wall -g
29
30 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
31         CFLAGS += -O0
32 else
33         CFLAGS += -O2
34 endif
35 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
36         INSTALL_PROGRAM += -s
37 endif
38
39 configure-ngircd: configure
40         dh_testdir
41
42         # configure "standard" 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
49 configure-ngircd-full: configure
50         dh_testdir
51
52         # configure "full" 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           --with-syslog --with-zlib --with-tcp-wrappers --with-ident
58
59 build:
60         dh_clean -k
61
62 build-ngircd: build-stamp-ngircd
63 build-stamp-ngircd: configure-ngircd
64         dh_testdir
65         rm -f build-stamp-*
66
67         # Add here commands to compile the "standard" package:
68         $(MAKE)
69
70         touch build-stamp-ngircd
71
72 build-ngircd-full: build-stamp-ngircd-full
73 build-stamp-ngircd-full: configure-ngircd-full
74         dh_testdir
75         rm -f build-stamp-*
76
77         # Add here commands to compile the "full" package:
78         $(MAKE)
79
80         touch build-stamp-ngircd-full
81
82 clean:
83         dh_testdir
84         dh_testroot
85         rm -f build-stamp*
86         rm -f $(CURDIR)/debian/ngircd-full.default
87         rm -f $(CURDIR)/debian/ngircd-full.init
88         rm -f $(CURDIR)/debian/ngircd-full.postinst
89
90         # Add here commands to clean up after the build process:
91         -$(MAKE) clean
92
93 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
94         cp -f /usr/share/misc/config.sub config.sub
95 endif
96 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
97         cp -f /usr/share/misc/config.guess config.guess
98 endif
99         dh_clean
100
101 install: install-ngircd install-ngircd-full
102
103 install-ngircd: build-ngircd
104         dh_testdir
105         dh_testroot
106         dh_installdirs
107
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
113 install-ngircd-full: build-ngircd-full
114         dh_testdir
115         dh_testroot
116         dh_installdirs
117
118         # Add here commands to install the "full" package into debian/ngircd-full:
119         $(MAKE) install DESTDIR=$(CURDIR)/debian/ngircd-full
120         rm $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd/INSTALL*
121         rm $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd/COPYING*
122         mv $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd \
123          $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd-full
124
125 # Build architecture-independent files here.
126 binary-indep:
127         # We have nothing to do by default.
128
129 # Build architecture-dependent files here.
130 binary-arch: build install
131         ln -s $(CURDIR)/debian/ngircd.default \
132          $(CURDIR)/debian/ngircd-full.default
133         ln -s $(CURDIR)/debian/ngircd.init \
134          $(CURDIR)/debian/ngircd-full.init
135         ln -s $(CURDIR)/debian/ngircd.postinst \
136          $(CURDIR)/debian/ngircd-full.postinst
137         
138         dh_testdir
139         dh_testroot
140         dh_installchangelogs -a -A ChangeLog
141         dh_installdocs -a
142         dh_installinit -a
143         dh_strip -a
144         dh_compress -a
145         dh_fixperms -a
146         dh_installdeb -a
147         dh_shlibdeps -a
148         dh_gencontrol -a
149         dh_md5sums -a
150         dh_builddeb -a
151
152 binary: binary-indep binary-arch
153
154 .PHONY: build clean binary-indep binary-arch binary install 
155
156 # -eof-