~ubuntu-branches/debian/lenny/dnsmasq/lenny

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Bazaar Package Importer
  • Author(s): Simon Kelley
  • Date: 2008-07-20 19:27:11 UTC
  • mfrom: (0.3.1 upstream) (9.1.4 hardy)
  • Revision ID: james.westby@ubuntu.com-20080720192711-b0lg0kl8egyg0v1b
Tags: 2.45-1
New upstream - fixes regression when min-port not set.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/make -f
2
2
# debian/rules file - for dnsmasq.
3
 
# Copyright 2001 by Simon Kelley
 
3
# Copyright 2001-2008 by Simon Kelley
4
4
# Based on the sample in the debian hello package which carries the following:
5
5
# Copyright 1994,1995 by Ian Jackson.
6
6
# I hereby give you perpetual unlimited permission to copy,
9
9
# paternity under the Copyright, Designs and Patents Act 1988.)
10
10
# This file may have to be extensively modified
11
11
 
12
 
# Pay no attention to the man behind the curtain......
13
 
DBUS ?= -DHAVE_DBUS
14
 
 
15
 
package=dnsmasq
 
12
package=dnsmasq-base
 
13
 
 
14
# policy manual, section 10.1
 
15
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
 
16
     CFLAGS = -g -O0 -Wall -W
 
17
else
 
18
     CFLAGS = -g -O2 -Wall -W
 
19
endif
 
20
 
 
21
COPTS = 
 
22
TARGET = install-i18n
 
23
 
 
24
ifeq (,$(findstring nodbus,$(DEB_BUILD_OPTIONS)))
 
25
     COPTS += -DHAVE_DBUS
 
26
endif
 
27
 
 
28
ifneq (,$(findstring noipv6,$(DEB_BUILD_OPTIONS)))
 
29
     COPTS += -DNO_IPV6
 
30
endif
 
31
 
 
32
ifneq (,$(findstring notftp,$(DEB_BUILD_OPTIONS)))
 
33
     COPTS += -DNO_TFTP
 
34
endif
 
35
 
 
36
ifneq (,$(findstring nortc,$(DEB_BUILD_OPTIONS)))
 
37
     COPTS += -DHAVE_BROKEN_RTC
 
38
endif
 
39
 
 
40
ifneq (,$(findstring noi18n,$(DEB_BUILD_OPTIONS)))
 
41
     TARGET = install
 
42
endif
16
43
 
17
44
clean:
18
45
        $(checkdir)
19
 
        rm -rf debian/tmp debian/*~ debian/files debian/substvars
 
46
        rm -rf debian/daemon debian/base debian/*~ debian/files debian/substvars
20
47
        make clean
21
48
 
 
49
binary-indep:   checkroot
 
50
        $(checkdir)
 
51
        rm -rf debian/daemon
 
52
        install -m 755 \
 
53
                -d debian/daemon/DEBIAN \
 
54
                -d debian/daemon/usr/share/doc \
 
55
                -d debian/daemon/etc/init.d \
 
56
                -d debian/daemon/etc/resolvconf/update.d \
 
57
                -d debian/daemon/etc/default \
 
58
                -d debian/daemon/etc/dbus-1/system.d 
 
59
        install -m 644 debian/conffiles debian/daemon/DEBIAN
 
60
        install -m 755 debian/postinst debian/postrm debian/prerm debian/daemon/DEBIAN
 
61
        install -m 755 debian/init debian/daemon/etc/init.d/dnsmasq
 
62
        install -m 755 debian/resolvconf debian/daemon/etc/resolvconf/update.d/dnsmasq
 
63
        install -m 644 debian/default debian/daemon/etc/default/dnsmasq
 
64
        install -m 644 dnsmasq.conf.example debian/daemon/etc/dnsmasq.conf
 
65
        install -m 644 dbus/dnsmasq.conf debian/daemon/etc/dbus-1/system.d/dnsmasq.conf
 
66
        ln -s $(package) debian/daemon/usr/share/doc/dnsmasq
 
67
        cd debian/daemon && find . -type f ! -regex '.*DEBIAN/.*' -printf '%P\0' | xargs -r0 md5sum > DEBIAN/md5sums    
 
68
        dpkg-gencontrol -pdnsmasq -Pdebian/daemon
 
69
        chown -R root.root debian/daemon
 
70
        chmod -R g-ws debian/daemon
 
71
        dpkg --build debian/daemon ..
 
72
 
22
73
binary-arch:    checkroot 
23
74
        $(checkdir)
24
 
        rm -rf debian/tmp
25
 
        install -d debian/tmp/DEBIAN\
26
 
                -d debian/tmp/usr/share/doc/$(package)\
27
 
                -d debian/tmp/etc/init.d\
28
 
                -d debian/tmp/etc/resolvconf/update.d\
29
 
                -d debian/tmp/etc/default\
30
 
                -d debian/tmp/etc/dbus-1/system.d\
31
 
                -d debian/tmp/var/run\
32
 
                -d debian/tmp/var/lib/misc
33
 
        install -m 644 debian/conffiles debian/tmp/DEBIAN
34
 
        install -m 755 debian/postinst debian/postrm debian/prerm debian/tmp/DEBIAN
35
 
        install -m 755 debian/init debian/tmp/etc/init.d/dnsmasq
36
 
        install -m 755 debian/resolvconf debian/tmp/etc/resolvconf/update.d/dnsmasq
37
 
        install -m 644 debian/default debian/tmp/etc/default/dnsmasq
38
 
        install -m 644 dnsmasq.conf.example debian/tmp/etc/dnsmasq.conf
39
 
        install -m 644 dbus/dnsmasq.conf debian/tmp/etc/dbus-1/system.d/dnsmasq.conf
40
 
        make install-i18n PREFIX=/usr DESTDIR=`pwd`/debian/tmp COPTS=$(DBUS)
41
 
        cp doc.html debian/tmp/usr/share/doc/$(package)/.
42
 
        cp setup.html debian/tmp/usr/share/doc/$(package)/.
43
 
        cp FAQ debian/tmp/usr/share/doc/$(package)/.
44
 
        gzip -9 debian/tmp/usr/share/doc/$(package)/FAQ
45
 
        cp CHANGELOG debian/tmp/usr/share/doc/$(package)/changelog
46
 
        gzip -9 debian/tmp/usr/share/doc/$(package)/changelog
47
 
        cp dbus/DBus-interface debian/tmp/usr/share/doc/$(package)/.
48
 
        gzip -9 debian/tmp/usr/share/doc/$(package)/DBus-interface      
49
 
        cp debian/changelog debian/tmp/usr/share/doc/$(package)/changelog.Debian
50
 
        gzip -9 debian/tmp/usr/share/doc/$(package)/changelog.Debian
51
 
        cp debian/readme debian/tmp/usr/share/doc/$(package)/README.Debian
52
 
        cp debian/copyright debian/tmp/usr/share/doc/$(package)/copyright
53
 
        gzip -9 debian/tmp/usr/share/man/man8/dnsmasq.8
54
 
        for f in debian/tmp/usr/share/man/*; do \
 
75
        rm -rf debian/base
 
76
        install -m 755 \
 
77
                -d debian/base/DEBIAN \
 
78
                -d debian/base/usr/share/doc/$(package) \
 
79
                -d debian/base/usr/share/doc/$(package)/examples \
 
80
                -d debian/base/var/run \
 
81
                -d debian/base/var/lib/misc
 
82
        make $(TARGET) PREFIX=/usr DESTDIR=`pwd`/debian/base CFLAGS="$(CFLAGS)" COPTS="$(COPTS)" CC=gcc AWK=gawk
 
83
ifeq (,$(findstring nodocs,$(DEB_BUILD_OPTIONS)))
 
84
        install -m 644 doc.html debian/base/usr/share/doc/$(package)/.
 
85
        install -m 644 setup.html debian/base/usr/share/doc/$(package)/.
 
86
        install -m 644 dnsmasq.conf.example debian/base/usr/share/doc/$(package)/examples/.
 
87
        install -m 644 FAQ debian/base/usr/share/doc/$(package)/.
 
88
        gzip -9 debian/base/usr/share/doc/$(package)/FAQ
 
89
        install -m 644 CHANGELOG debian/base/usr/share/doc/$(package)/changelog
 
90
        gzip -9 debian/base/usr/share/doc/$(package)/changelog
 
91
        install -m 644 dbus/DBus-interface debian/base/usr/share/doc/$(package)/.
 
92
        gzip -9 debian/base/usr/share/doc/$(package)/DBus-interface     
 
93
endif
 
94
        install -m 644 debian/changelog debian/base/usr/share/doc/$(package)/changelog.Debian
 
95
        gzip -9 debian/base/usr/share/doc/$(package)/changelog.Debian
 
96
        install -m 644 debian/readme debian/base/usr/share/doc/$(package)/README.Debian
 
97
        install -m 644 debian/copyright debian/base/usr/share/doc/$(package)/copyright
 
98
        gzip -9 debian/base/usr/share/man/man8/dnsmasq.8
 
99
        for f in debian/base/usr/share/man/*; do \
55
100
                if [ -f $$f/man8/dnsmasq.8 ]; then \
56
101
                       gzip -9 $$f/man8/dnsmasq.8 ; \
57
102
                fi \
58
103
        done
59
 
        strip -R .note -R .comment debian/tmp/usr/sbin/dnsmasq
60
 
        dpkg-shlibdeps debian/tmp/usr/sbin/dnsmasq
61
 
        dpkg-gencontrol -isp
62
 
        chown -R root.root debian/tmp
63
 
        chmod -R g-ws debian/tmp
64
 
        dpkg --build debian/tmp ..
 
104
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
 
105
        strip -R .note -R .comment debian/base/usr/sbin/dnsmasq
 
106
endif
 
107
        cd debian/base && find . -type f ! -regex '.*DEBIAN/.*' -printf '%P\0' | xargs -r0 md5sum > DEBIAN/md5sums
 
108
        dpkg-shlibdeps debian/base/usr/sbin/dnsmasq
 
109
        dpkg-gencontrol -pdnsmasq-base -Pdebian/base
 
110
        chown -R root.root debian/base
 
111
        chmod -R g-ws debian/base 
 
112
        dpkg --build debian/base ..
65
113
 
66
114
define checkdir
67
115
        test -f FAQ -a -f debian/rules
69
117
 
70
118
# Below here is fairly generic really
71
119
 
72
 
binary:         binary-arch
 
120
binary:         binary-arch binary-indep
73
121
build:          
74
 
binary-indep:
75
122
          
76
123
checkroot:
77
 
        $(checkdir)
78
124
        test root = "`whoami`"
79
125
 
80
126
.PHONY: binary binary-arch binary-indep clean checkroot