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
# debian.rules file for Debian/GNU modutils package
#
# Adapted from sample file from Ian Jackson, as modified by Christoph Lameter.
#
# Debian package information
package=modutils
# C compiler information
CC = gcc
CFLAGS = -g -O2 -DNO_ROUTE -DNO_GDBM
LDFLAGS = -s
config:
./configure `dpkg --print-architecture`-linux
touch config
all build: config
$(checkdir)
make CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
(cd kerneld; make utils)
touch build
clean:
$(checkdir)
-rm -f build config
-make realclean
-rm -f `find . -name "*~"`
-rm -rf debian/tmp debian/files* core debian/substvars
binary-indep: checkroot build
$(checkdir)
# There are no architecture-independent files to be uploaded
# generated by this package. If there were any they would be
# made here.
binary-arch: checkroot build
$(checkdir)
-rm -rf debian/tmp
install -d debian/tmp
# Install modutils
install -d -m 755 -o root -g root debian/tmp/usr/lib/menu
install -d -m 755 -o root -g root debian/tmp/lib/modules
install -d -m 755 -o root -g root debian/tmp/sbin
install -d -m 755 -o root -g root debian/tmp/usr/man/{man1,man2,man5,man8}
$(MAKE) install ROOT=../debian/tmp
strip debian/tmp/sbin/modinfo
(cd kerneld; make install-utils ROOT=../debian/tmp )
(cd kerneld; make install-scripts ROOT=../debian/tmp )
install -s -m 755 -o root -g root kerneld/kdstat debian/tmp/sbin
chmod 644 debian/tmp/usr/man/man[1-8]/*
gzip -9f debian/tmp/usr/man/man[1-8]/*
# Remove the no longer supported request-route
rm -f debian/tmp/sbin/request-route
# Install documentation
install -d -m 755 -o root -g root debian/tmp/usr/doc/$(package)
install -g root -m 644 -o root README debian/tmp/usr/doc/$(package)
install -g root -m 644 -o root CREDITS debian/tmp/usr/doc/$(package)
install -g root -m 644 -o root TODO debian/tmp/usr/doc/$(package)
install -g root -m 644 -o root ChangeLog \
debian/tmp/usr/doc/$(package)/changelog
install -g root -m 644 -o root depmod/README \
debian/tmp/usr/doc/$(package)/README.depmod
install -g root -m 644 -o root kerneld/README.kerneld \
debian/tmp/usr/doc/$(package)
gzip -9f debian/tmp/usr/doc/$(package)/*
# Install Debian-only documentation
install -g root -m 644 -o root debian/modules.5 debian/tmp/usr/man/man5
gzip -9f debian/tmp/usr/man/man5/modules.5
install -g root -m 644 -o root debian/placement \
debian/tmp/usr/doc/$(package)/placement.Debian
gzip debian/tmp/usr/doc/$(package)/placement.Debian
install -g root -m 644 -o root debian/changelog \
debian/tmp/usr/doc/$(package)/changelog.Debian
gzip debian/tmp/usr/doc/$(package)/changelog.Debian
install -g root -m 644 -o root debian/README \
debian/tmp/usr/doc/$(package)/README.Debian
gzip debian/tmp/usr/doc/$(package)/README.Debian
install -g root -m 644 -o root debian/menu \
debian/tmp/usr/lib/menu/$(package)
install -g root -m 644 -o root debian/index.html \
debian/tmp/usr/doc/$(package)/index.html
install -g root -m 644 -o root debian/copyright \
debian/tmp/usr/doc/$(package)
# Install Debian's own kerneld.h patch
install -g root -m 644 -o root debian/kerneld-persist-patch \
debian/tmp/usr/doc/$(package)
# Install example files
install -d -m 755 -o root -g root debian/tmp/usr/doc/$(package)/examples
install -d -m 755 -o root -g root \
debian/tmp/usr/doc/$(package)/examples/GOODIES
install -g root -m 644 -o root depmod/Example.modules.conf \
debian/tmp/usr/doc/$(package)/examples/conf.modules
install -g root -m 644 -o root kerneld/GOODIES/[^d]* \
debian/tmp/usr/doc/$(package)/examples/GOODIES
install -g root -m 755 -o root kerneld/GOODIES/do_sound \
debian/tmp/usr/doc/$(package)/examples/GOODIES
# Install Debian utils
install -m 755 debian/kernelversion debian/tmp/sbin
install -m 644 debian/kernelversion.1 debian/tmp/usr/man/man1
gzip -9f debian/tmp/usr/man/man1/kernelversion.1
install -m 644 debian/kdstat.8 debian/tmp/usr/man/man8
gzip -9f debian/tmp/usr/man/man8/kdstat.8
# Install configuration files
install -g root -m 755 -o root -d debian/tmp/etc
install -g root -m 755 -o root -d debian/tmp/etc/modutils
install -g root -m 644 -o root debian/modules debian/tmp/etc/modules
install -g root -m 644 -o root debian/conf.* debian/tmp/etc/modutils
install -d -g root -m 755 -o root debian/tmp/etc/init.d
install -g root -m 755 -o root debian/rc.modutils \
debian/tmp/etc/init.d/modutils
install -g root -m 755 -o root debian/rc.kerneld \
debian/tmp/etc/init.d/kerneld
# Install Debian system files
install -d -m 755 -o root -g root debian/tmp/DEBIAN
install -g root -m 644 -o root debian/control debian/tmp/DEBIAN
install -g root -m 644 -o root debian/conffiles debian/tmp/DEBIAN
install -g root -m 755 -o root debian/preinst debian/tmp/DEBIAN
install -g root -m 755 -o root debian/postinst debian/tmp/DEBIAN
install -g root -m 755 -o root debian/prerm debian/tmp/DEBIAN
install -g root -m 755 -o root debian/postrm debian/tmp/DEBIAN
# Compatibility files to easy the upgrade from modules
# install -d debian/tmp/usr/doc/modules/examples/{GOODIES,Stacking}
# install -d debian/tmp/usr/bin
# set -e; for i in \
# README.kerneld HOWTO-modularize copyright changelog.Debian \
# depmod.template README.genksyms README.ppp-slip \
# examples/GOODIES/Makefile \
# examples/GOODIES/README examples/GOODIES/blanker_patch \
# examples/GOODIES/do_sound examples/GOODIES/kdsound.c \
# examples/GOODIES/kdsound_patch \
# examples/Stacking/Makefile examples/Stacking/base.c \
# examples/Stacking/demo examples/Stacking/mid.c \
# examples/Stacking/modversions.h \
# examples/Stacking/symtab_begin.h \
# examples/Stacking/symtab_end.h examples/Stacking/top.c \
# examples/drv_hello.c examples/Makefile depmod.txt \
# examples/conf.modules \
# modules.doc Example.conf.modules \
# debian.placement; do \
# echo "This file is obsolete and no longer user by Debian GNU/Linux 1.3" > debian/tmp/usr/doc/modules/$$i; \
# echo "It has been replaced for backwards compatibilty and will be" >> debian/tmp/usr/doc/modules/$$i; \
# echo "removed in the next release." >> debian/tmp/usr/doc/modules/$$i; \
# done
# set -e; for i in \
# HOWTO-modularize changelog.Debian depmod.txt modules.doc \
# Example.conf.modules README.ppp-slip debian.placement \
# README.kerneld README.genksyms depmod.template ; do \
# gzip -9f debian/tmp/usr/doc/modules/$$i; \
# done
# Some left-over stuff
install -d -m 755 -o root -g root debian/tmp/usr/bin
ln -s /sbin/genksyms debian/tmp/usr/bin/genksyms
ln -s ../man7/undocumented.7.gz debian/tmp/usr/man/man2/modules.2.gz
ln -s ../man7/undocumented.7.gz debian/tmp/usr/man/man8/admpersist.8.gz
# And now.. for the final packaging!
find debian/tmp -type f | grep -v "./DEBIAN" | xargs md5sum | \
sed -e 's#debian/tmp/##' > debian/tmp/DEBIAN/md5sums
dpkg-shlibdeps debian/tmp/sbin/*
dpkg-gencontrol
chown -R root.root debian/tmp
chmod -R go=rX debian/tmp
dpkg --build debian/tmp ..
define checkdir
test -f debian/rules
endef
# Below here is fairly generic really
binary: binary-indep binary-arch
source diff:
@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
checkroot:
$(checkdir)
test root = "`whoami`"
.PHONY: binary binary-arch binary-indep clean checkroot
|