Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2
3 include /usr/share/dpkg/default.mk
4 include /usr/share/dpkg/pkg-info.mk
5
6 export HOME=$(CURDIR)/fake-home
7
8 # upstream version
9 gst_version=$(shell echo $(DEB_VERSION) | cut -d '-' -f 1)
10
11 CFLAGS += -Wno-error
12 CXXFLAGS += -Wno-error
13 LDFLAGS += -Wl,-z,defs -Wl,-O1
14 RUSTFLAGS += -Copt-level=3 -Cdebuginfo=2
15
16 # Let's decide the package name and url depending on the distribution
17 DISTRO = "$(shell dpkg-vendor --query vendor)"
18
19 GST_PACKAGE_NAME := "GStreamer (unknown Debian derivative)"
20 GST_PACKAGE_ORIGIN="https://tracker.debian.org/pkg/gstreamer1.0"
21
22 ifeq ($(DISTRO),"Debian")
23 GST_PACKAGE_NAME := "GStreamer (Debian)"
24 GST_PACKAGE_ORIGIN="https://tracker.debian.org/pkg/gstreamer1.0"
25 endif
26
27 ifeq ($(DISTRO),"Ubuntu")
28 GST_PACKAGE_NAME := "GStreamer (Ubuntu)"
29 GST_PACKAGE_ORIGIN="https://launchpad.net/ubuntu/+source/gstreamer1.0"
30 endif
31
32 conf_flags = --libexecdir=lib/$(DEB_HOST_MULTIARCH)/gstreamer1.0
33 conf_flags += -Dpackage-name=$(GST_PACKAGE_NAME) -Dpackage-origin=$(GST_PACKAGE_ORIGIN)
34 conf_flags += -Dauto_features=enabled -Ddbghelp=disabled -Ddoc=disabled -Dexamples=disabled
35
36 # Disable libunwind due to inconsistencies between different architectures
37 conf_flags += -Dlibunwind=disabled -Dlibdw=disabled
38
39 ifeq ($(DEB_HOST_ARCH_OS),linux)
40 conf_flags += -Dptp-helper-permissions=capabilities
41 else
42 conf_flags += -Dptp-helper-permissions=setuid-root \
43 -Dptp-helper-setuid-user=nobody -Dptp-helper-setuid-group=nobody
44 endif
45
46 ifneq (,$(filter $(DEB_HOST_ARCH),alpha hppa m68k sh4))
47 conf_flags += -Dptp-helper=disabled
48 endif
49
50 infiles := \
51 libgstreamer1.0-0.postinst
52
53 %:
54 dh $@
55
56 # Drop the libexecdir override when we're not in a Freeze?
57 # May need rebuilds or code changes to other packages to adapt
58 override_dh_auto_configure:
59 dh_auto_configure -- $(conf_flags)
60
61 execute_before_dh_auto_clean:
62 rm -rf $(CURDIR)/fake-home
63 set -e; for file in $(infiles); do \
64 rm -f debian/$$file; \
65 done
66
67 execute_after_dh_auto_install:
68 gcc -o debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/gstreamer1.0/gstreamer-1.0/gst-codec-info-1.0 -Wall debian/gst-codec-info.c $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) `pkg-config --libs --cflags glib-2.0 gthread-2.0 gmodule-no-export-2.0 gobject-2.0` debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libgstreamer-1.0.so -Idebian/tmp/usr/include/gstreamer-1.0 -Idebian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/gstreamer-1.0/include
69 perldoc -o man debian/dh_gstscancodecs > debian/tmp/usr/share/man/man1/dh_gstscancodecs.1
70
71 # Only make the tests fail for key architectures
72 override_dh_auto_test:
73 ifneq (,$(filter $(DEB_HOST_ARCH), amd64 arm64))
74 dh_auto_test
75 else
76 dh_auto_test || true
77 endif
78
79 override_dh_makeshlibs:
80 dh_makeshlibs -plibgstreamer1.0-0 -X "/usr/lib/$(DEB_HOST_MULTIARCH)/gstreamer-1.0" -V 'libgstreamer1.0-0 (>= $(gst_version))' -- -c4
81
82 execute_after_dh_install:
83 set -e; for file in $(infiles); do \
84 sed -e"s/@MULTIARCH@/$(DEB_HOST_MULTIARCH)/g" \
85 debian/$${file}.in > debian/$$file; \
86 done