systemd/debian/rules
Martin Pitt 27ff1ed810 Use dh_installinit's --noscript instead of --no-start for the upstart jobs
So that the postinst does not try and call update-rc.d on them; as there are no
corresponding sysvinit scripts, these trigger a lintian warning.
2014-12-28 12:31:13 +01:00

315 lines
11 KiB
Makefile
Executable File

#! /usr/bin/make -f
#export DH_VERBOSE=1
#export DEB_BUILD_OPTIONS="nostrip"
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
VERSION = $(shell dpkg-parsechangelog | sed -n -e '/^Version:/s/.*: //p')
ifneq (,$(findstring stage1,$(DEB_BUILD_PROFILES)))
BOOTSTRAP_DH_FLAGS := -Ngir1.2-gudev-1.0 -Nlibgudev-1.0-0 -Nlibgudev-1.0-dev
endif
CONFFLAGS = \
--with-rootprefix= \
--with-rootlibdir=/lib/$(DEB_HOST_MULTIARCH) \
--with-zshcompletiondir=/usr/share/zsh/vendor-completions \
--with-sysvinit-path=/etc/init.d \
--with-sysvrcnd-path=/etc \
--with-firmware-path=/lib/firmware \
--with-debug-shell=/bin/bash \
--with-telinit=/lib/sysvinit/telinit \
--enable-split-usr \
--disable-coredump \
--disable-efi \
--disable-myhostname \
--disable-vconsole \
--disable-microhttpd \
--disable-sysusers \
--disable-silent-rules \
--with-ntp-servers="0.debian.pool.ntp.org 1.debian.pool.ntp.org 2.debian.pool.ntp.org 3.debian.pool.ntp.org" \
--with-system-uid-max=999 \
--with-system-gid-max=999
ifeq (,$(findstring stage1,$(DEB_BUILD_PROFILES)))
CONFFLAGS += --enable-libcryptsetup
endif
CONFFLAGS_deb = \
--enable-selinux \
--enable-introspection \
--enable-gtk-doc \
--enable-compat-libs \
PYTHON=python3 \
$(NULL)
CONFFLAGS_udeb = \
--disable-libcryptsetup \
--disable-pam \
--disable-audit \
--disable-selinux \
--disable-smack \
--disable-ima \
--disable-introspection \
--disable-gtk-doc \
--disable-binfmt \
--disable-bootchart \
--disable-quotacheck \
--disable-tmpfiles \
--disable-randomseed \
--disable-backlight \
--disable-logind \
--disable-machined \
--disable-hostnamed \
--disable-timedated \
--disable-networkd \
--disable-timesyncd \
--disable-localed \
--disable-resolved \
--disable-polkit \
--disable-acl \
--disable-gcrypt \
--disable-gudev \
--disable-rfkill \
--disable-multi-seat-x \
--disable-manpages \
--without-python
override_dh_auto_configure:
dh_auto_configure --builddirectory=build-deb \
-- $(CONFFLAGS) $(CONFFLAGS_deb)
dh_auto_configure --builddirectory=build-udeb \
-- $(CONFFLAGS) $(CONFFLAGS_udeb)
override_dh_auto_build:
dh_auto_build --builddirectory=build-deb
dh_auto_build --builddirectory=build-udeb
override_dh_auto_install:
dh_auto_install --builddirectory=build-deb \
--destdir=debian/install/deb
dh_auto_install --builddirectory=build-udeb \
--destdir=debian/install/udeb
override_dh_auto_clean:
dh_auto_clean --builddirectory=build-deb
dh_auto_clean --builddirectory=build-udeb
rm -rf debian/install/
# remove pre-generated man pages so they are rebuilt
rm -f man/*.[13578]
# remove pre-generated rules and unit files so they are rebuilt
rm -f rules/99-systemd.rules \
units/emergency.service \
units/systemd-udevd.service \
units/systemd-udev-settle.service \
units/systemd-udev-trigger.service
# remove Python byte code files
rm -f *.pyc
override_dh_install:
# remove unnecessary / unused files
rm -f debian/install/*/usr/share/doc/systemd/LICENSE.*
rm -f debian/install/*/var/log/README
rm -f debian/install/*/etc/init.d/README
rm -f debian/install/*/usr/share/man/man8/kernel-install.8
rm -f debian/install/*/usr/bin/kernel-install
rm -f debian/install/*/usr/share/zsh/vendor-completions/_kernel-install
rm -f debian/install/*/usr/share/bash-completion/completions/kernel-install
rm -rf debian/install/*/usr/lib/kernel/install.d
rm -rf debian/install/*/etc/rpm/
rm -rf debian/install/*/usr/lib/rpm/
rm -rf debian/install/*/etc/kernel/
rm -f debian/install/*/usr/lib/sysctl.d/50-default.conf
find debian/install/ -name '*.la' -delete
# remove files related to factory-reset feature
find debian/install/ \( -name 'systemd-update-done*' -o \
-name systemd-journal-catalog-update.service -o \
-name systemd-udev-hwdb-update.service -o \
-name ldconfig.service -o \
-name etc.conf \) -delete
rm -rf debian/install/*/usr/share/factory/
# don't ship systemd-firstboot for now; we rather want debconf, and
# this needs to be adjusted to Debian config files
rm -f debian/install/*/usr/share/man/man*/*firstboot*
rm -f debian/install/*/lib/systemd/system/*firstboot*
rm -f debian/install/*/lib/systemd/system/*.wants/*firstboot*
rm -f debian/install/*/bin/*firstboot*
# remove .so for deprecated compatibility libraries
rm -f debian/install/*/usr/lib/*/libsystemd-daemon.so
rm -f debian/install/*/usr/lib/*/libsystemd-login.so
rm -f debian/install/*/usr/lib/*/libsystemd-id128.so
rm -f debian/install/*/usr/lib/*/libsystemd-journal.so
# remove symlinks enabling default-on services
rm -rf debian/install/*/etc/systemd/system/*.target.wants/
dh_install -pudev-udeb -plibudev1-udeb --sourcedir=debian/install/udeb
# we disable machined for now, so don't ship nss-mymachines either
rm -f debian/install/*/usr/lib/*/libnss_mymachines*
# still needs to mature a bit, and packaging
rm -f debian/install/*/usr/lib/*/libnss_resolve*
dh_install $(BOOTSTRAP_DH_FLAGS) -Nudev-udeb -Nlibudev1-udeb --sourcedir=debian/install/deb --fail-missing
# install some files manually, --sourcedir makes that necessary
# udev-udeb
install -D --mode=755 debian/extra/udev.startup \
debian/udev-udeb/lib/debian-installer/start-udev
install -D --mode=755 debian/extra/udev.base-installer \
debian/udev-udeb/usr/lib/base-installer.d/05udev
mkdir -p debian/udev-udeb/lib/udev/rules.d/
install -D --mode=644 \
debian/extra/rules/50-firmware.rules \
debian/extra/rules/73-idrac.rules \
debian/extra/rules/75-persistent-net-generator.rules \
debian/udev-udeb/lib/udev/rules.d/
mkdir -p debian/udev-udeb/lib/udev
install -D --mode=644 \
debian/extra/hotplug.functions \
debian/extra/rule_generator.functions \
debian/udev-udeb/lib/udev/
install -D --mode=755 \
debian/extra/write_net_rules \
debian/udev-udeb/lib/udev/
# udev: initramfs-tools support
install -D --mode=755 debian/extra/initramfs.hook \
debian/udev/usr/share/initramfs-tools/hooks/udev
install -D --mode=755 debian/extra/initramfs.top \
debian/udev/usr/share/initramfs-tools/scripts/init-top/udev
install -D --mode=755 debian/extra/initramfs.bottom \
debian/udev/usr/share/initramfs-tools/scripts/init-bottom/udev
# udev: debian specific rules and helpers
install -D --mode=644 debian/extra/rules/* \
debian/udev/lib/udev/rules.d/
install -D --mode=644 debian/extra/fbdev-blacklist.conf \
debian/udev/etc/modprobe.d/fbdev-blacklist.conf
install -D --mode=644 \
debian/extra/hotplug.functions \
debian/extra/rule_generator.functions \
debian/udev/lib/udev/
install -D --mode=755 \
debian/extra/dsl-modem.agent \
debian/extra/logger.agent \
debian/extra/net.agent \
debian/extra/udev-finish \
debian/extra/write_net_rules \
debian/udev/lib/udev/
# systemd
cp -a debian/pam-configs debian/libpam-systemd/usr/share/
install -D --mode=644 debian/init-functions.d/40-systemd \
debian/systemd/lib/lsb/init-functions.d/40-systemd
install --mode=644 debian/tmpfiles.d/debian.conf \
debian/systemd/usr/lib/tmpfiles.d/
install --mode=644 debian/debian-fixup.service debian/ifup@.service \
debian/systemd/lib/systemd/system/
install --mode=644 debian/extra/udev-finish.service \
debian/udev/lib/systemd/system/
ln -s ../udev-finish.service debian/udev/lib/systemd/system/sysinit.target.wants/
install --mode=755 debian/debian-fixup \
debian/systemd/lib/systemd/
# Make sure the runlevel services are known by systemd so their targets
# get launches. See https://bugzilla.redhat.com/show_bug.cgi?id=1002806
for t in poweroff rescue multi-user graphical reboot; do \
mkdir -p debian/systemd/lib/systemd/system/$${t}.target.wants;\
ln -s ../systemd-update-utmp-runlevel.service \
debian/systemd/lib/systemd/system/$${t}.target.wants ;\
done
# man files for example code in /usr/share/doc
mkdir -p debian/systemd/usr/share/man/man3/
install --mode=755 debian/systemd-logind-launch \
debian/systemd/lib/systemd/
# remove duplicates
# files shipped by systemd-sysv / sysvinit
rm debian/systemd/usr/share/man/man1/init.1
rm debian/systemd/usr/share/man/man8/halt.8
rm debian/systemd/usr/share/man/man8/poweroff.8
rm debian/systemd/usr/share/man/man8/reboot.8
rm debian/systemd/usr/share/man/man8/shutdown.8
rm debian/systemd/usr/share/man/man8/telinit.8
rm debian/systemd/usr/share/man/man8/runlevel.8
# files shipped by libpam-systemd
rm debian/systemd/usr/share/man/man8/pam_systemd.8
# files shipped by udev
rm -r debian/systemd/etc/udev/
rm debian/systemd/lib/systemd/system/systemd-udev*
rm debian/systemd/lib/systemd/system/*.target.wants/systemd-udev*
rm debian/systemd/lib/systemd/systemd-udevd
rm debian/systemd/usr/share/man/man7/udev.7
rm debian/systemd/usr/share/man/man8/*udev*.8
# files shipped by udev / bash-completion
rm debian/systemd/usr/share/bash-completion/completions/udevadm
# files systemd by cryptsetup
ifeq (,$(findstring stage1,$(DEB_BUILD_PROFILES)))
rm debian/systemd/usr/share/man/man5/crypttab.5
endif
# files shipped by systemd
rm debian/udev/lib/udev/rules.d/70-uaccess.rules
rm debian/udev/lib/udev/rules.d/73-seat-late.rules
rm debian/udev/lib/udev/rules.d/71-seat.rules
rm debian/udev/lib/udev/rules.d/99-systemd.rules
# Ubuntu specific files
if dpkg-vendor --is ubuntu; then \
install -D --mode=644 debian/extra/udev.py debian/udev/usr/share/apport/package-hooks/udev.py; \
install -D --mode=644 debian/extra/systemd.py debian/systemd/usr/share/apport/package-hooks/systemd.py; \
install --mode=644 debian/extra/systemd-vconsole-setup.service debian/systemd/lib/systemd/system/; \
fi
# use symlinked doc directories on Debian as the old udev package did
override_dh_installdocs:
if ! dpkg-vendor --is ubuntu; then \
dh_installdocs -pudev -plibudev-dev --link-doc=libudev1; \
dh_installdocs -pgir1.2-gudev-1.0 -plibgudev-1.0-dev --link-doc=libgudev-1.0-0; \
fi
dh_installdocs --remaining-packages
override_dh_installinit:
dh_installinit --no-start
dh_installinit --name=udev-finish --no-start
# the following are only upstart jobs
dh_installinit --name=udevtrigger --noscripts
dh_installinit --name=udevmonitor --noscripts
dh_installinit --name=udev-fallback-graphics --noscripts
# The SysV compat tools (which are symlinks to systemctl) are
# quasi-essential, so add its dependencies to Pre-Depends
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=753589
override_dh_shlibdeps:
dh_shlibdeps -psystemd -- -dPre-Depends -edebian/systemd/bin/systemctl -dDepends
dh_shlibdeps --remaining-packages
override_dh_makeshlibs:
dh_makeshlibs -plibudev1 --add-udeb=libudev1-udeb -- -c4
dh_makeshlibs --remaining-packages -- -c4
autoreconf:
gtkdocize --copy --docdir docs/
intltoolize -f -c
autoreconf -f -i
override_dh_autoreconf:
dh_autoreconf debian/rules -- autoreconf
override_dh_strip:
dh_strip --dbg-package=systemd-dbg
override_dh_auto_test:
ifeq (, $(findstring nocheck, $(DEB_BUILD_OPTIONS)))
# some tests hang under fakeroot, so disable fakeroot
echo "01234567890123456789012345678901" > build-deb/machine-id
env -u LD_PRELOAD SYSTEMD_MACHINE_ID_PATH=$(CURDIR)/build-deb/machine-id \
make -C build-deb check || ( \
cd build-deb; \
for f in test-*.log; do echo "==== $$f ===="; cat $$f; done; \
exit 1; ) # replace with 1 to make failures fatal
endif
%:
ifeq (,$(findstring stage1,$(DEB_BUILD_PROFILES)))
dh $@ --with autoreconf,gir,python3 --parallel
else
dh $@ --with autoreconf,python3 $(BOOTSTRAP_DH_FLAGS)
endif
override_dh_gencontrol:
# Ubuntu has an epoch on gudev
if dpkg-vendor --is ubuntu; then \
dh_gencontrol -plibgudev-1.0-0 -plibgudev-1.0-dev -pgir1.2-gudev-1.0 -- "-v1:$(VERSION)"; \
fi
dh_gencontrol --remaining-packages