File: rules

package info (click to toggle)
packagekit 1.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 11,000 kB
  • sloc: ansic: 52,504; cpp: 13,763; xml: 4,945; python: 4,240; sh: 280; perl: 60; makefile: 56
file content (85 lines) | stat: -rwxr-xr-x 2,930 bytes parent folder | download
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
#!/usr/bin/make -f
#export DH_VERBOSE=1

DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

# Use this variable to set the PackageKit configure flags
PK_CONFIGURE_FLAGS = \
			-Ddaemon_tests=false \
			-Dpackaging_backend=apt \
			-Dsystemd=true \
			-Doffline_update=true \
			-Dgobject_introspection=true \
			-Dman_pages=true \
			-Dgtk_doc=true \
			-Dbash_completion=true \
			-Dbash_command_not_found=true \
			-Dgstreamer_plugin=true \
			-Dgtk_module=true \
			-Dcron=false \
			-Dpython_backend=false

ifneq ($(DEB_HOST_ARCH_OS), linux)
	PK_CONFIGURE_FLAGS += -Dsystemd=false -Doffline_update=false
else
	export deb_systemdsystemunitdir = $(shell pkg-config --variable=systemdsystemunitdir systemd | sed s,^/,,)
endif

LDFLAGS += -Wl,--as-needed

# Define install target dir
INSTALLDIR = $(CURDIR)/debian/tmp

%:
	dh $@ --with gir

extrainstallfiles-stamp:
	grep -E -v 'systemdsystemunitdir|pk-offline-update|pk-debconf-helper' debian/packagekit.install > debian/packagekit.install.kfreebsd
	grep -E -v 'systemdsystemunitdir|pk-offline-update|pk-debconf-helper' debian/packagekit.install > debian/packagekit.install.hurd
	touch $@

override_dh_auto_configure:
	cp -dpr $(CURDIR)/docs/api $(CURDIR)/docs/api.orig
	dh_auto_configure -- $(PK_CONFIGURE_FLAGS)

override_dh_auto_install:
	dh_auto_install --destdir=$(INSTALLDIR)

	# These files do not need to be installed
	rm -f $(INSTALLDIR)/usr/share/PackageKit/pk-upgrade-distro.sh
	rm -f $(INSTALLDIR)/usr/bin/packagekit-bugreport.sh
	rm -f $(INSTALLDIR)/var/lib/PackageKit/transactions.db

	rm $(INSTALLDIR)/etc/PackageKit/Vendor.conf
ifeq ($(shell dpkg-vendor --query vendor),Ubuntu)
	cp $(CURDIR)/debian/vendor/Vendor.ubuntu.conf $(INSTALLDIR)/etc/PackageKit/Vendor.conf
else
	cp $(CURDIR)/debian/vendor/Vendor.debian.conf $(INSTALLDIR)/etc/PackageKit/Vendor.conf
endif

override_dh_install: extrainstallfiles-stamp
	dh_install

override_dh_makeshlibs:
	dh_makeshlibs -Xlibpk-gtk-module -Xlibpk_
	dh_girepository

override_dh_auto_clean:
	dh_auto_clean
	# Remove the autogenerated .install files for non-linux architectures
	rm -f debian/packagekit.install.kfreebsd
	rm -f debian/packagekit.install.hurd

override_dh_gencontrol:
	dh_gencontrol -- $(SUBSTVARS)

override_dh_installsystemd:
	# We don't want to stop/restart the packagekit service and especially not the
	# packagekit-offline-update service, as PackageKit might be performing the
	# package upgrade right now and would kill the running APT/dpkg transaction,
	# leaving the system in a broken state.
	# The PackageKit daemon is fine with being upgraded while running, and we do
	# send it the `SuggestDaemonQuit` command to have it reload itself when it is
	# able to (ensuring it doesn't crash after ejecting the backend and reloading it).
	dh_installsystemd --no-start --no-restart-after-upgrade --no-stop-on-upgrade