2
-include /usr/share/gnome-pkg-tools/1/rules/gnome-get-source.mk
4
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
5
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
8
-Denable-gnome-desktop=true \
10
-Denable-ostree=false \
11
-Denable-packagekit=true \
12
-Denable-rpm-ostree=false \
14
# these are conditionally re-enabled later
15
GS_CONFIGURE_FLAGS += \
16
-Denable-fwupd=false \
17
-Denable-flatpak=false \
18
-Denable-limba=false \
19
-Denable-gudev=false \
20
-Denable-ubuntu-reviews=true \
21
-Denable-valgrind=false
23
ifeq ($(DEB_HOST_ARCH_OS), linux)
24
# Enable Flatpak and Limba support on Linux
25
GS_CONFIGURE_FLAGS += -Denable-limba=true -Denable-flatpak=true
27
# Enable GUdev support on Linux
28
GS_CONFIGURE_FLAGS += -Denable-gudev=true
30
# Enable fwupd support on supported architectures
31
ifneq (,$(findstring $(DEB_HOST_ARCH), amd64 arm64 armhf i386))
32
GS_CONFIGURE_FLAGS += -Denable-fwupd=true
35
# Enable snap support on supported architectures
36
ifneq (,$(findstring $(DEB_HOST_ARCH), amd64 arm64 armel armhf i386 ppc64 ppc64el s390x))
37
GS_CONFIGURE_FLAGS += -Denable-snap=true
40
# Enable valgrind support on supported architectures
41
ifneq (,$(findstring $(DEB_HOST_ARCH), amd64 arm64 armhf i386 mips mips64 mips64el mipsel powerpc ppc64 ppc64el s390x))
42
GS_CONFIGURE_FLAGS += -Denable-valgrind=true
47
FREE_URL = https:\/\/www.debian.org\/social_contract\#guidelines
48
ifeq (yes,$(shell dpkg-vendor --derives-from Ubuntu && echo yes))
50
FREE_URL = https:\/\/www.ubuntu.com\/about\/about-ubuntu\/licensing
51
GS_CONFIGURE_FLAGS += -Denable-ubuntu-reviews=true
52
else ifeq (yes,$(shell dpkg-vendor --derives-from Tanglu && echo yes))
54
else ifeq (yes,$(shell dpkg-vendor --derives-from PureOS && echo yes))
58
# Fix the Flatpak plugin: https://launchpad.net/bugs/1650783
59
export DEB_LDFLAGS_MAINT_STRIP := -Wl,-Bsymbolic-functions
62
dh $@ --with gnome --buildsystem=meson
64
override_dh_auto_configure:
65
dh_auto_configure -- --libexecdir=/usr/lib/$(DEB_HOST_MULTIARCH)/gnome-software/ \
68
override_dh_auto_install:
70
ifneq (yes,$(shell dpkg-vendor --derives-from Ubuntu && echo yes))
71
rm -f debian/tmp/usr/lib/*/gs-plugins-*/libgs_plugin_ubuntu*
74
override_dh_installgsettings:
75
sed 's/@DISTRO@/$(DISTRO_ID)/g' debian/gnome-software.gsettings-override.in > debian/gnome-software.gsettings-override
76
sed -i 's/@URL@/$(FREE_URL)/g' debian/gnome-software.gsettings-override
79
override_dh_install-arch:
81
rm -f debian/tmp/usr/lib/*/gs-plugins-*/*.a
82
rm -f debian/tmp/usr/lib/*/gs-plugins-*/*.la
83
rm -f debian/tmp/usr/lib/*/gs-plugins-*/libgs_plugin_fedora*
87
dh_missing --fail-missing
89
# These files are split out to separate packages
90
rm -f debian/gnome-software/usr/lib/*/gs-plugins-*/libgs_plugin_flatpak*
91
rm -f debian/gnome-software/usr/lib/*/gs-plugins-*/libgs_plugin_limba*
92
rm -f debian/gnome-software/usr/lib/*/gs-plugins-*/libgs_plugin_snap*
93
rm -f debian/gnome-software/usr/share/metainfo/org.gnome.Software.Plugin.Flatpak.metainfo.xml
94
rm -f debian/gnome-software/usr/share/metainfo/org.gnome.Software.Plugin.Limba.metainfo.xml
95
rm -f debian/gnome-software/usr/share/metainfo/org.gnome.Software.Plugin.Snap.metainfo.xml
97
override_dh_makeshlibs:
98
dh_makeshlibs -Xlibgs_plugin
100
override_dh_auto_test:
104
rm -f debian/gnome-software.gsettings-override
108
override_dh_translations:
109
ninja -C obj-$(DEB_HOST_GNU_TYPE) gnome-software-pot