Source: packagekit
Version: 0.6.12-2
Severity: wishlist
Tags: patch

Hi,

currently packagekit is not built on non-Linux architectures, as it
build-depends on Linux-only packages (like network-manager) (but that is just
the first issue).
The attached patch (which changes only the debian directory) fixes the following
issues:
- restrict Linux-only build-dependencies as linux-any
- explicitly disable network-mananger and connman (Linux-specific, and unlikely
  to be ported to OSes other than Linux anytime soon)
- packagekit.install refers a file installed by the now linux-any pm-utils;
  the trick used here is to autogenerate the install files for kfreebsd and hurd
  architectures by filtering out the pm-utils entries from packagekit.install
  (trick inspired by the pulseaudio packaging)

Thanks,
-- 
Pino
--- a/debian/control
+++ b/debian/control
@@ -19,7 +19,7 @@
                libglib2.0-dev (>= 2.24),
                libgstreamer-plugins-base0.10-dev,
                libgtk2.0-dev,
-               libnm-glib-dev,
+               libnm-glib-dev [linux-any],
                libnspr4-dev,
                libpam0g-dev,
                libpolkit-backend-1-dev,
@@ -28,8 +28,8 @@
                libsqlite3-dev,
                libtool,
                libxt-dev,
-               network-manager-dev,
-               pm-utils,
+               network-manager-dev [linux-any],
+               pm-utils [linux-any],
                policykit-1,
                python-apt (>= 0.7.13.2),
                python-dev (>= 2.6.6-3+squeeze4),
--- a/debian/rules
+++ b/debian/rules
@@ -1,6 +1,8 @@
 #!/usr/bin/make -f
 #export DH_VERBOSE=1
 
+DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
+
 # Use this variable to set the PackageKit configure flags
 # We set aptcc as default backend
 PK_CONFIGURE_FLAGS = --disable-static \
@@ -15,6 +17,10 @@
                --enable-gtk-module \
                --enable-gstreamer-plugin \
                --enable-command-not-found
+ifneq ($(DEB_HOST_ARCH_OS),linux)
+       PK_CONFIGURE_FLAGS += --disable-networkmanager \
+               --disable-connman
+endif
 
 LDFLAGS += -Wl,--as-needed
 
@@ -30,6 +36,11 @@
 %:
        dh $@ --parallel --with autotools_dev --with python2
 
+extrainstallfiles-stamp:
+       cat debian/packagekit.install | grep -v '/pm-utils/' > 
debian/packagekit.install.kfreebsd
+       cat debian/packagekit.install | grep -v '/pm-utils/' > 
debian/packagekit.install.hurd
+       touch $@
+
 override_dh_auto_configure:
        cp -dpr $(CURDIR)/docs/api $(CURDIR)/docs/api.orig
        dh_auto_configure -- $(PK_CONFIGURE_FLAGS)
@@ -48,7 +59,7 @@
                sed -i "/dependency_libs/ s/'.*'/''/" $$file ; \
        done
 
-override_dh_install:
+override_dh_install: extrainstallfiles-stamp
        dh_install --list-missing
 
 override_dh_makeshlibs:
@@ -57,6 +68,9 @@
 
 override_dh_auto_clean:
        dh_auto_clean
+       # Remove the autogenerated .install files
+       rm -f debian/packagekit.install.kfreebsd
+       rm -f debian/packagekit.install.hurd
        # Restore documentation
        if test -d $(CURDIR)/docs/api.orig; then \
                rm -rf $(CURDIR)/docs/api; \

Reply via email to