1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197
|
#!/usr/bin/make -f
# Made with the iad of dh_make, by Craig Small
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
# Also some stuff taken from debmake scripts, by Cristopt Lameter.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
export DH_COMPAT=4
DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
DESTDIR = `pwd`/debian/tmp
PACKAGE = dhcp3
include /usr/share/dpatch/dpatch.make
CFLAGS = -Wall -g
INSTALL = install
INSTALL_FILE = $(INSTALL) -p -o root -g root -m 644
INSTALL_PROGRAM = $(INSTALL) -p -o root -g root -m 755
INSTALL_SCRIPT = $(INSTALL) -p -o root -g root -m 755
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
IVARS = DESTDIR=$(DESTDIR)
BVARS = PREDEFINES='-D_PATH_DHCPD_DB=\"/var/lib/dhcp3/dhcpd.leases\" \
-D_PATH_DHCLIENT_DB=\"/var/lib/dhcp3/dhclient.leases\" \
-D_PATH_DHCLIENT_SCRIPT=\"/sbin/dhclient-script\" \
-D_PATH_DHCPD_CONF=\"/etc/dhcp3/dhcpd.conf\" \
-D_PATH_DHCLIENT_CONF=\"/etc/dhcp3/dhclient.conf\"'
#patch: patch-stamp
#patch-stamp:
# dh_testdir
# if [ ! -f patch-stamp ]; then /bin/sh debian/scripts/patch-source; fi
# touch patch-stamp
#
#unpatch:
# dh_testdir
# if [ -f patch-stamp ]; then /bin/sh debian/scripts/unpatch-source; fi
# rm -f patch-stamp
build: patch-stamp build-stamp
build-stamp:
dh_testdir
./configure
#CFLAGS="$(CFLAGS)" sh -x debian/scripts/insert_cflags.sh patch
#cat site.conf
$(MAKE) $(BVARS)
cp debian/dhclient-script.$(DEB_HOST_ARCH_OS) client/scripts/debian
touch build-stamp
clean: unpatch
dh_testdir
rm -f build-stamp install-stamp
#CFLAGS="$(CFLAGS)" sh -x debian/scripts/insert_cflags.sh unpatch
# Add here commands to clean up after the build process.
-$(MAKE) distclean
# Remove leftover junk...
rm -Rf work.*/
debconf-updatepo
dh_clean
install: install-stamp
install-stamp: build-stamp
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs -A
# Add here commands to install the package into debian/tmp.
$(MAKE) install $(IVARS)
mkdir -p $(DESTDIR)/etc/dhcp3
#mv $(DESTDIR)/etc/dhclient-script $(DESTDIR)/sbin
# Install dhcp's conffile.
$(INSTALL_FILE) -m 644 debian/dhcpd.conf $(DESTDIR)/etc/dhcp3
# Install dhcp-client's conffiles.
$(INSTALL_FILE) -m 644 debian/dhclient.conf $(DESTDIR)/etc/dhcp3
# install the udeb binary
$(INSTALL_PROGRAM) -m 755 $(DESTDIR)/sbin/dhclient \
`pwd`/debian/dhcp3-client-udeb/sbin/
# udeb needs the os-specific script too
cp `pwd`/debian/tmp/sbin/dhclient-script \
`pwd`/debian/dhcp3-client-udeb/sbin
# Rename binaries so they do not conflict with the binaries in the
# v2 packages.
for f in /usr/sbin/dhcpd /usr/sbin/dhcrelay /sbin/dhclient; do \
mv $(DESTDIR)$$f $(DESTDIR)$${f}3; \
done
# Rename man page so the have the same name as the binaries.
for f in dhcpd dhcrelay dhclient; do \
mv $(DESTDIR)/usr/share/man/man8/$$f.8 \
$(DESTDIR)/usr/share/man/man8/$${f}3.8; \
done
# Weird, weird Japanese manpages in weird, weird locations
# need to be special-cased...
mkdir -p $(DESTDIR)/usr/share/man/ja/man5
for f in dhclient.conf dhcp-eval dhclient.leases dhcp-options; do \
cp doc/ja_JP.eucJP/$$f.5 \
$(DESTDIR)/usr/share/man/ja/man5; \
done
mkdir -p $(DESTDIR)/usr/share/man/ja/man8
for f in dhclient dhclient-script; do \
cp doc/ja_JP.eucJP/$$f.8 \
$(DESTDIR)/usr/share/man/ja/man8; \
done
cp debian/debug-enter debian/dhcp3-client/etc/dhcp3/dhclient-enter-hooks.d/debug
cp debian/debug-exit debian/dhcp3-client/etc/dhcp3/dhclient-exit-hooks.d/debug
dh_movefiles
# Create symlink so we don't break ifupdown
dh_link -a
# Remove unwanted directories that dh_movefiles leaves around
rmdir $(DESTDIR)/sbin/
rmdir $(DESTDIR)/usr/lib/
rm -Rf $(DESTDIR)/usr/include/
# Install Linux specific documentation
ifeq ($(DEB_HOST_ARCH_OS), linux)
for p in dhcp3-client dhcp3-relay dhcp3-server ; do \
install -d -m 755 `pwd`/debian/$p/usr/share/doc; \
install -m 644 `pwd`/debian/dhcp-on-linux.txt `pwd`/debian/$p/usr/share/doc; \
done
endif
$(INSTALL_FILE) debian/dhcp3-client.lintian \
debian/dhcp3-client/usr/share/lintian/overrides/dhcp3-client
touch install-stamp
UDEBPACKAGE=dhcp3-client-udeb
VERSION=$(shell dpkg-parsechangelog | grep ^Version:.* | cut -d ' ' -f 2)
ARCH=$(shell dpkg --print-architecture)
#UDEBFILENAME=$(UDEBPACKAGE)_$(VERSION)_$(ARCH).udeb
PRIORITY=$(shell grep ^Priority: debian/control | cut -d ' ' -f 2)
# Build architecture-dependent files here (this package does not contain
# architecture-independent files).
binary-arch: build install
# dh_testversion
dh_testdir -a
dh_testroot -a
dh_installdebconf
dh_installdocs -a -A debian/README.Debian -X doc/ja_JP.eucJP
dh_installexamples -a
# dh_installmenu -a
# dh_installemacsen -a
dh_installinit -a -n
# dh_installcron -a
# dh_installmanpages -a
# dh_undocumented
dh_installchangelogs -a
dh_strip -a
dh_compress -a
dh_fixperms -a
dh_installdeb -a
dh_shlibdeps -a
dh_gencontrol -a
# dh_makeshlibs -a
dh_md5sums -a --no-package=dhcp3-client-udeb
dh_builddeb -a
source diff:
@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
binary: binary-arch
.PHONY: build clean binary-indep binary-arch binary
|