3 ######################################################################
6 # ifupdown's written in litprog using noweb. noweb is written in icon.
7 # icon isn't as portable as one might hope (it needs to have bits recoded
8 # for each arch and OS it's ported to. ugh).
10 # So. The "upstream" source is made to not include any of the generated
11 # files. That's neat and tidy. If you want to modify anything, you edit
14 # Once you've done all the Debian changes, you run debian/rules binary,
15 # and get all the .c files and such updated. Once you're done, you
16 # run debian/rules clean, which leaves the generated .c files around
17 # for porters. You then generate a .diff.gz, and all should be well.
19 # Useful targets of the toplevel makefile:
21 # * gets rid of all the generated files except Makefile,
22 # make{c,nw}dep.sh, which are needed to bootstrap
25 # * removes ALL generated files. Use with care.
28 # * builds the documentation. Note that this is not done per
29 # default (only executables are built). If this is added to
30 # the default build process (which will not be done in the near
31 # future since dia requires an X display even if using the -e option)
32 # the 'tetex-base' and 'dia' packages would need to be added to the
35 ######################################################################
37 # Uncomment this to turn on verbose mode.
40 # This is the debhelper compatability version to use.
43 # For working out whether we're cross-building
44 DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
45 DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
47 # user/group of to-be-installed files
51 ifeq (,$(wildcard /usr/bin/po2debconf))
56 MINDEBCONFVER := 1.2.0
63 build-stamp: # configure
66 if [ -x /usr/bin/noweb ]; then \
69 chmod a+rx defn2c.pl defn2man.pl makecdep.sh makenwdep.sh; \
77 ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
78 chmod a+rx debian/testbuild
79 @echo running debian/testbuild
80 @if ! debian/testbuild; then \
81 echo '=================================================='; \
82 echo 'AUTOMATIC TESTS FAILED -- Something built wrong or'; \
83 echo 'there is a bug in the code!!! Either way something'; \
84 echo 'is completely screwed up!!! File a bug!'; \
86 echo 'Aborting build.'; \
87 echo '=================================================='; \
96 # Add here commands to clean up after the build process
98 rm -f build-stamp install-stamp
102 ifeq ($(PO2DEBCONF),yes)
103 # Hack for woody compatibility. This makes sure that the
104 # debian/templates file shipped in the source package doesn't
105 # specify encodings, which woody's debconf can't handle. If building
106 # on a system with po-debconf installed (conveniently debhelper (>=
107 # 4.1.16) depends on it), the binary-arch target will generate a
108 # better version for sarge.
109 echo 1 > debian/po/output
110 po2debconf debian/templates.master > debian/templates
111 rm -f debian/po/output
114 install-stamp: install
119 dh_installdirs etc/network/if-pre-up.d etc/network/if-up.d etc/network/if-down.d etc/network/if-post-down.d
121 # Add here commands to install the package into debian/tmp.
122 $(MAKE) install BASEDIR=`pwd`/debian/tmp
124 install -o $(ROOT_USER) -g $(ROOT_GROUP) -m 755 debian/upgrade-from-0.5.x.pl \
125 debian/tmp/usr/share/ifupdown/
128 # Build architecture-independent files here.
129 binary-indep: build-stamp install-stamp
130 # We have nothing to do by default.
132 # Build architecture-dependent files here.
133 binary-arch: build install
139 dh_installexamples contrib/*
140 mv debian/tmp/usr/share/doc/ifupdown/examples debian/tmp/usr/share/doc/ifupdown/contrib
141 dh_installexamples examples/*
145 dh_installinit --name=ifupdown --no-start -- start 39 S . start 36 0 6 .
146 dh_installinit --name=ifupdown-clean --no-start -- start 18 S .
149 # ^-- can't do our symlink trick
150 install -o $(ROOT_USER) -g $(ROOT_GROUP) -m 644 interfaces.5 debian/tmp/usr/share/man/man5/interfaces.5
151 install -o $(ROOT_USER) -g $(ROOT_GROUP) -m 644 ifup.8 debian/tmp/usr/share/man/man8/ifup.8
152 ln -s ifup.8 debian/tmp/usr/share/man/man8/ifdown.8
155 dh_installchangelogs ChangeLog
160 # You may want to make some executables suid here.
166 ifeq ($(PO2DEBCONF),yes)
167 po2debconf -e utf8 debian/templates.master > debian/templates
169 dh_gencontrol -- -V'debconf-depends=debconf (>= $(MINDEBCONFVER)) | debconf-2.0'
173 binary: binary-indep binary-arch
174 .PHONY: build clean binary-indep binary-arch binary install configure test