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
|
#!/usr/bin/make -f
SHELL+= -e
BUILD_UDEB := 1
USE_SELINUX := true
include debian/scripts/vars
BUILD_DIR := $(SOURCE_DIR)/$(TAR_DIR)
B := $(BUILD_DIR)
BU := $(BUILD_DIR)/udev-udeb
D := $(CURDIR)/debian/udev
DU := $(CURDIR)/debian/udev-udeb
DL := $(CURDIR)/debian/libvolume-id0
DD := $(CURDIR)/debian/libvolume-id-dev
UEX := $D/usr/share/doc/udev/examples
DOCS := FAQ README RELEASE-NOTES TODO docs/writing_udev_rules/
MAKE_EXTRAS := extras/ata_id/ extras/cdrom_id/ extras/edd_id extras/path_id \
extras/run_directory/ extras/scsi_id/ extras/usb_id/ extras/volume_id/
DEB_BUILD_ARCH := $(shell dpkg-architecture -qDEB_BUILD_ARCH)
ifeq ($(DEB_BUILD_ARCH),s390)
MAKE_EXTRAS += extras/dasd_id
endif
MAKE_VARIABLES := V=true EXTRAS=\"$(MAKE_EXTRAS)\"
ifndef BUILD_UDEB
NO_PACKAGE := --no-package=udev-udeb
endif
all: build
unpack: $(STAMP_DIR)/unpack
$(STAMP_DIR)/unpack:
$(MAKE) -f debian/sys-build.mk source.make
rm -rf $B/test/
touch $@
unpack2: $(STAMP_DIR)/unpack2
$(STAMP_DIR)/unpack2: $(STAMP_DIR)/unpack
ifdef BUILD_UDEB
cd $B && if [ ! -d udev-udeb/ ]; then \
mkdir udev-udeb/ && cd udev-udeb/ && \
sh $(CURDIR)/extra/lndir.sh ..; \
fi
endif
touch $@
# FIXME uglyness to get clean diffs
extra-clean:
rm -r $B.orig/test/
# used by the maintainer
unpack.nopatch:
$(MAKE) -f debian/sys-build.mk source.build
# used by the maintainer
diff:
$(MAKE) -f debian/sys-build.mk make-diff
clean:
$(MAKE) -f debian/sys-build.mk source.clean
debconf-updatepo
dh_clean
build: $(STAMP_DIR)/build
$(STAMP_DIR)/build: $(STAMP_DIR)/unpack2
dh_testdir
NOISY=1 \
$(MAKE) -f debian/sys-build.mk source.command SOURCE_CMD=" \
$(MAKE) all $(MAKE_VARIABLES) USE_SELINUX=$(USE_SELINUX) \
"
ifdef BUILD_UDEB
$(MAKE) -f debian/sys-build.mk source.command SOURCE_CMD=" \
cd udev-udeb/ && \
$(MAKE) all $(MAKE_VARIABLES) VOLUME_ID_STATIC=true \
OPTFLAGS='-Os -fomit-frame-pointer' \
"
endif
touch $@
binary-arch: $(STAMP_DIR)/build checkroot
dh_testdir
dh_clean -k
dh_installdirs
$(MAKE) -f debian/sys-build.mk source.command SOURCE_CMD=" \
$(MAKE) install $(MAKE_VARIABLES) DESTDIR=$D \
"
dh_movefiles --sourcedir=debian/udev
rmdir $D/dev/ $D/usr/lib/pkgconfig/ $D/usr/include/
rm -f $D/etc/udev/rules.d/*
install --mode=755 extra/*-devfs.sh \
hotplug/*.agent hotplug/scsi-re-add \
extra/write_*_rules $D/lib/udev/
cp rules/* extra/links.conf $D/etc/udev/
printf "# maximum size of the /dev tmpfs\ntmpfs_size=\"10M\"\n\n" \
>> $D/etc/udev/udev.conf
sed -e 's/^#\([^ ]\)/\1/' < rules/compat.rules > \
$D/etc/udev/compat-full.rules
install --mode=644 hotplug/hotplug.functions $D/lib/udev/
install --mode=644 hotplug/modprobe.d/* $D/etc/modprobe.d/
cp extra/reportbug.presubj $D/usr/share/bug/udev/presubj
install --mode=755 extra/reportbug.script $D/usr/share/bug/udev/script
install --mode=755 extra/initramfs.hook \
$D/usr/share/initramfs-tools/hooks/udev
install --mode=755 extra/initramfs.premount \
$D/usr/share/initramfs-tools/scripts/init-premount/udev
install --mode=755 extra/initramfs.bottom \
$D/usr/share/initramfs-tools/scripts/init-bottom/udev
ifdef BUILD_UDEB
$(MAKE) -f debian/sys-build.mk source.command SOURCE_CMD=" \
cd udev-udeb/ && \
$(MAKE) install-bin $(MAKE_VARIABLES) DESTDIR=$(DU) \
"
cd $(DU) && rm -r dev/ lib/udev/udev_run_* lib/libvolume_id.* \
sbin/scsi_id sbin/udevcontrol usr/sbin/ \
usr/bin/udevtest usr/include/ usr/lib/ etc/udev/rules.d/*
grep '^[[:alnum:]]' extra/links.conf > $(DU)/etc/udev/links.conf
grep '^[[:alnum:]]' $B/etc/udev/udev.conf > $(DU)/etc/udev/udev.conf
cp rules/devfs.rules rules/run.rules extra/020_id.rules \
$D/etc/udev/compat-full.rules $(DU)/etc/udev/rules.d/
egrep -v '="(net|ide)\.agent"' rules/hotplug.rules \
> $(DU)/etc/udev/rules.d/z55_hotplug.rules
cp rules/persistent.rules $(DU)/etc/udev/rules.d/z20_persistent.rules
cp rules/cd-aliases-generator.rules \
$(DU)/etc/udev/rules.d/z75_cd-aliases-generator.rules
ifneq ($(DEB_BUILD_ARCH),s390)
cp rules/persistent-net-generator.rules \
$(DU)/etc/udev/rules.d/z45_persistent-net-generator.rules
endif
install --mode=755 hotplug/firmware.agent \
extra/*-devfs.sh extra/write_*_rules $(DU)/lib/udev/
install --mode=644 hotplug/hotplug.functions $(DU)/lib/udev/
install --mode=644 hotplug/modprobe.d/* $(DU)/etc/modprobe.d/
install --mode=755 extra/udev.startup \
$(DU)/lib/debian-installer-startup.d/S02udev
mkdir -p $(DU)/usr/lib/post-base-installer.d/
install --mode=755 extra/udev.post-base-installer \
$(DU)/usr/lib/post-base-installer.d/05udev
endif
dh_installchangelogs $B/ChangeLog
dh_installdocs $(addprefix $B/,$(DOCS))
cp $B/extras/volume_id/README $D/usr/share/doc/udev/README.vol_id
dh_installexamples \
extra/udev.vim extra/udevtest-all
cp $B/etc/udev/gentoo/udev.rules $(UEX)/gentoo.rules
cp -a $B/etc/udev/suse/ $B/etc/udev/redhat/ $(UEX)/
dh_installdebconf
dh_installinit --no-start --update-rcd-params='start 03 S .'
dh_installinit --no-start --update-rcd-params='start 36 S .' \
--name=udev-mtab
# remove duplicate changelogs
rm -rf $(DD)/usr/share/doc/libvolume-id-dev/
cd $(DD)/usr/share/doc/ && ln -s libvolume-id0 libvolume-id-dev
dh_strip
dh_compress
dh_fixperms
dh_makeshlibs --version-info='libvolume-id0 (>= 0.103-1)'
dh_shlibdeps --libpackage=libvolume-id0 -l $(DL)/lib/
dh_installdeb
dh_gencontrol $(NO_PACKAGE)
dh_builddeb $(NO_PACKAGE)
binary: binary-arch
checkroot:
test root = "`whoami`"
.PHONY: binary binary-arch binary-indep unpack configure build clean checkroot
|