| 1 |
#!/usr/bin/make -f |
| 2 |
#export DH_VERBOSE=1 |
| 3 |
|
| 4 |
DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) |
| 5 |
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) |
| 6 |
|
| 7 |
# Use this variable to set the PackageKit configure flags |
| 8 |
PK_CONFIGURE_FLAGS = \ |
| 9 |
-Dpackaging_backend=apt \ |
| 10 |
-Ddaemon_tests=false \ |
| 11 |
-Dsystemd=true \ |
| 12 |
-Doffline_update=true \ |
| 13 |
-Dgobject_introspection=true \ |
| 14 |
-Dman_pages=true \ |
| 15 |
-Dgtk_doc=true \ |
| 16 |
-Dbash_completion=true \ |
| 17 |
-Dbash_command_not_found=true \ |
| 18 |
-Dgstreamer_plugin=true \ |
| 19 |
-Dgtk_module=true \ |
| 20 |
-Dcron=false \ |
| 21 |
-Dpython_backend=false |
| 22 |
|
| 23 |
ifneq ($(DEB_HOST_ARCH_OS), linux) |
| 24 |
PK_CONFIGURE_FLAGS += -Dsystemd=false -Doffline_update=false |
| 25 |
else |
| 26 |
export deb_systemdsystemunitdir = $(shell pkg-config --variable=systemdsystemunitdir systemd | sed s,^/,,) |
| 27 |
endif |
| 28 |
|
| 29 |
LDFLAGS += -Wl,--as-needed |
| 30 |
|
| 31 |
# Define install target dir |
| 32 |
INSTALLDIR = $(CURDIR)/debian/tmp |
| 33 |
|
| 34 |
%: |
| 35 |
dh $@ --with gir |
| 36 |
|
| 37 |
extrainstallfiles-stamp: |
| 38 |
grep -E -v 'systemdsystemunitdir|pk-offline-update|pk-debconf-helper' debian/packagekit.install > debian/packagekit.install.kfreebsd |
| 39 |
grep -E -v 'systemdsystemunitdir|pk-offline-update|pk-debconf-helper' debian/packagekit.install > debian/packagekit.install.hurd |
| 40 |
touch $@ |
| 41 |
|
| 42 |
override_dh_auto_configure: |
| 43 |
cp -dpr $(CURDIR)/docs/api $(CURDIR)/docs/api.orig |
| 44 |
dh_auto_configure -- $(PK_CONFIGURE_FLAGS) |
| 45 |
|
| 46 |
override_dh_auto_install: |
| 47 |
dh_auto_install --destdir=$(INSTALLDIR) |
| 48 |
|
| 49 |
# These files do not need to be installed |
| 50 |
rm -f $(INSTALLDIR)/usr/share/PackageKit/pk-upgrade-distro.sh |
| 51 |
rm -f $(INSTALLDIR)/usr/bin/packagekit-bugreport.sh |
| 52 |
rm -f $(INSTALLDIR)/var/lib/PackageKit/transactions.db |
| 53 |
|
| 54 |
rm $(INSTALLDIR)/etc/PackageKit/Vendor.conf |
| 55 |
ifeq ($(shell dpkg-vendor --query vendor),Ubuntu) |
| 56 |
cp $(CURDIR)/debian/vendor/Vendor.ubuntu.conf $(INSTALLDIR)/etc/PackageKit/Vendor.conf |
| 57 |
else |
| 58 |
cp $(CURDIR)/debian/vendor/Vendor.debian.conf $(INSTALLDIR)/etc/PackageKit/Vendor.conf |
| 59 |
endif |
| 60 |
|
| 61 |
override_dh_install: extrainstallfiles-stamp |
| 62 |
dh_install |
| 63 |
|
| 64 |
override_dh_makeshlibs: |
| 65 |
dh_makeshlibs -Xlibpk-gtk-module -Xlibpk_ |
| 66 |
dh_girepository |
| 67 |
|
| 68 |
override_dh_auto_clean: |
| 69 |
dh_auto_clean |
| 70 |
# Remove the autogenerated .install files for non-linux architectures |
| 71 |
rm -f debian/packagekit.install.kfreebsd |
| 72 |
rm -f debian/packagekit.install.hurd |
| 73 |
|
| 74 |
override_dh_gencontrol: |
| 75 |
dh_gencontrol -- $(SUBSTVARS) |
| 76 |
|
| 77 |
override_dh_installsystemd: |
| 78 |
# We don't want to stop/restart the packagekit service and especially not the |
| 79 |
# packagekit-offline-update service, as PackageKit might be performing the |
| 80 |
# package upgrade right now and would kill the running APT/dpkg transaction, |
| 81 |
# leaving the system in a broken state. |
| 82 |
# The PackageKit daemon is fine with being upgraded while running, and we do |
| 83 |
# send it the `SuggestDaemonQuit` command to have it reload itself when it is |
| 84 |
# able to (ensuring it doesn't crash after ejecting the backend and reloading it). |
| 85 |
dh_installsystemd --no-start --no-restart-after-upgrade --no-stop-on-upgrade |