| 1 |
#!/usr/bin/make -f
|
| 2 |
|
| 3 |
-include /usr/share/gnome-pkg-tools/1/rules/gnome-get-source.mk
|
| 4 |
|
| 5 |
GS_CONFIGURE_FLAGS = \
|
| 6 |
-Denable-gnome-desktop=true \
|
| 7 |
-Denable-odrs=true \
|
| 8 |
-Denable-ostree=false \
|
| 9 |
-Denable-packagekit=true \
|
| 10 |
-Denable-rpm=false \
|
| 11 |
|
| 12 |
# these are conditionally re-enabled later
|
| 13 |
GS_CONFIGURE_FLAGS += \
|
| 14 |
-Denable-fwupd=false \
|
| 15 |
-Denable-flatpak=false \
|
| 16 |
-Denable-limba=false \
|
| 17 |
-Denable-gudev=false \
|
| 18 |
-Denable-ubuntu-reviews=true \
|
| 19 |
-Denable-valgrind=false
|
| 20 |
|
| 21 |
ifeq ($(DEB_HOST_ARCH_OS), linux)
|
| 22 |
# Enable Flatpak and Limba support on Linux
|
| 23 |
GS_CONFIGURE_FLAGS += -Denable-limba=true -Denable-flatpak=true
|
| 24 |
|
| 25 |
# Enable GUdev support on Linux
|
| 26 |
GS_CONFIGURE_FLAGS += -Denable-gudev=true
|
| 27 |
|
| 28 |
# Enable fwupd support on supported architectures
|
| 29 |
ifneq (,$(findstring $(DEB_HOST_ARCH), amd64 arm64 armhf i386))
|
| 30 |
GS_CONFIGURE_FLAGS += -Denable-fwupd=true
|
| 31 |
endif
|
| 32 |
|
| 33 |
# Enable snap support on supported architectures
|
| 34 |
ifneq (,$(findstring $(DEB_HOST_ARCH), amd64 arm64 armel armhf i386 ppc64 ppc64el s390x))
|
| 35 |
GS_CONFIGURE_FLAGS += -Denable-snap=true
|
| 36 |
endif
|
| 37 |
|
| 38 |
# Enable valgrind support on supported architectures
|
| 39 |
ifneq (,$(findstring $(DEB_HOST_ARCH), amd64 arm64 armhf i386 mips mips64 mips64el mipsel powerpc ppc64 ppc64el s390x))
|
| 40 |
GS_CONFIGURE_FLAGS += -Denable-valgrind=true
|
| 41 |
endif
|
| 42 |
endif
|
| 43 |
|
| 44 |
DISTRO_ID = debian
|
| 45 |
FREE_URL = https:\/\/www.debian.org\/social_contract\#guidelines
|
| 46 |
ifeq (yes,$(shell dpkg-vendor --derives-from Ubuntu && echo yes))
|
| 47 |
DISTRO_ID = ubuntu
|
| 48 |
FREE_URL = https:\/\/www.ubuntu.com\/about\/about-ubuntu\/licensing
|
| 49 |
GS_CONFIGURE_FLAGS += -Denable-ubuntu-reviews=true
|
| 50 |
else ifeq (yes,$(shell dpkg-vendor --derives-from Tanglu && echo yes))
|
| 51 |
DISTRO_ID = tanglu
|
| 52 |
else ifeq (yes,$(shell dpkg-vendor --derives-from PureOS && echo yes))
|
| 53 |
DISTRO_ID = pureos
|
| 54 |
endif
|
| 55 |
|
| 56 |
# Fix the Flatpak plugin: https://launchpad.net/bugs/1650783
|
| 57 |
export DEB_LDFLAGS_MAINT_STRIP := -Wl,-Bsymbolic-functions
|
| 58 |
|
| 59 |
%:
|
| 60 |
dh $@ --with gnome --buildsystem=meson
|
| 61 |
|
| 62 |
override_dh_auto_configure:
|
| 63 |
dh_auto_configure -- --libexecdir=/usr/lib/$(DEB_HOST_MULTIARCH)/gnome-software/ \
|
| 64 |
$(GS_CONFIGURE_FLAGS)
|
| 65 |
|
| 66 |
override_dh_auto_install:
|
| 67 |
dh_auto_install
|
| 68 |
ifneq (yes,$(shell dpkg-vendor --derives-from Ubuntu && echo yes))
|
| 69 |
rm -f debian/tmp/usr/lib/*/gs-plugins-*/libgs_plugin_ubuntu*
|
| 70 |
endif
|
| 71 |
|
| 72 |
override_dh_installdocs:
|
| 73 |
dh_installdocs
|
| 74 |
mkdir -p debian/gnome-software/usr/share/doc/gnome-software
|
| 75 |
appstream-util appdata-to-news $(CURDIR)/*/data/appdata/org.gnome.Software.appdata.xml \
|
| 76 |
> debian/gnome-software/usr/share/doc/gnome-software/NEWS
|
| 77 |
|
| 78 |
override_dh_installgsettings:
|
| 79 |
sed 's/@DISTRO@/$(DISTRO_ID)/g' debian/gnome-software.gsettings-override.in > debian/gnome-software.gsettings-override
|
| 80 |
sed -i 's/@URL@/$(FREE_URL)/g' debian/gnome-software.gsettings-override
|
| 81 |
dh_installgsettings
|
| 82 |
|
| 83 |
override_dh_install-arch:
|
| 84 |
# Remove unused files
|
| 85 |
rm -f debian/tmp/usr/lib/*/gs-plugins-*/*.a
|
| 86 |
rm -f debian/tmp/usr/lib/*/gs-plugins-*/*.la
|
| 87 |
rm -f debian/tmp/usr/lib/*/gs-plugins-*/libgs_plugin_fedora*
|
| 88 |
dh_install
|
| 89 |
|
| 90 |
override_dh_missing:
|
| 91 |
dh_missing --fail-missing
|
| 92 |
|
| 93 |
# These files are split out to separate packages
|
| 94 |
rm -f debian/gnome-software/usr/lib/*/gs-plugins-*/libgs_plugin_flatpak*
|
| 95 |
rm -f debian/gnome-software/usr/lib/*/gs-plugins-*/libgs_plugin_limba*
|
| 96 |
rm -f debian/gnome-software/usr/lib/*/gs-plugins-*/libgs_plugin_ostree*
|
| 97 |
rm -f debian/gnome-software/usr/lib/*/gs-plugins-*/libgs_plugin_snap*
|
| 98 |
rm -f debian/gnome-software/usr/share/metainfo/org.gnome.Software.Plugin.Flatpak.metainfo.xml
|
| 99 |
rm -f debian/gnome-software/usr/share/metainfo/org.gnome.Software.Plugin.Limba.metainfo.xml
|
| 100 |
rm -f debian/gnome-software/usr/share/metainfo/org.gnome.Software.Plugin.Snap.metainfo.xml
|
| 101 |
|
| 102 |
override_dh_makeshlibs:
|
| 103 |
dh_makeshlibs -Xlibgs_plugin
|
| 104 |
|
| 105 |
override_dh_auto_test:
|
| 106 |
# DISABLED
|
| 107 |
|
| 108 |
override_dh_clean:
|
| 109 |
rm -f debian/gnome-software.gsettings-override
|
| 110 |
dh_clean
|
| 111 |
|
| 112 |
# Needed by Ubuntu
|
| 113 |
override_dh_translations:
|
| 114 |
ninja -C obj-$(DEB_HOST_GNU_TYPE) gnome-software-pot
|
| 115 |
dh_translations
|