Added gst-plugins-base-subtitles0.10-0.10.34 for Meego Harmattan 1.2
[mafwsubrenderer] / gst-plugins-base-subtitles0.10 / debian / rules
1 #!/usr/bin/make -f
2
3 -include /usr/share/cdbs/1/rules/debhelper.mk
4 -include /usr/share/cdbs/1/rules/simple-patchsys.mk
5 -include /usr/share/cdbs/1/class/gnome.mk
6 -include /usr/share/cdbs/1/rules/utils.mk
7
8 LDFLAGS += -Wl,-z,defs -Wl,-O1 -Wl,--as-needed
9
10 CFLAGS += -Wno-error
11
12 ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
13     CFLAGS += -O0
14 else
15     CFLAGS += -O2
16 endif
17
18 ifneq (,$(findstring nodocs,$(DEB_BUILD_OPTIONS)))
19     DEB_CONFIGURE_EXTRA_FLAGS += --disable-gtk-doc --disable-docbook
20     common-install-indep::
21         mkdir -p debian/tmp/usr/share/gtk-doc
22 else
23     DEB_CONFIGURE_EXTRA_FLAGS += --enable-gtk-doc --enable-docbook
24 endif
25
26 ifeq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
27     CFLAGS += -DG_DISABLE_CAST_CHECKS -DGST_DISABLE_GST_DEBUG=1
28     DEB_CONFIGURE_EXTRA_FLAGS += --enable-glib-asserts=no
29 else
30     DEB_CONFIGURE_EXTRA_FLAGS += --enable-glib-asserts=yes
31 endif
32
33 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
34     NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
35     MAKEFLAGS += -j$(NUMJOBS)
36 endif
37
38 DEB_MAKE_CHECK_TARGET = check GST_CHECKS=disable ORC_CODE=debug || true
39
40 # upstream version with epoch
41 gst_version := $(shell echo $(DEB_VERSION) | cut -d '-' -f 1)
42 gst_major := 0
43 gst_minor := 10
44 gst_abi := $(gst_major).$(gst_minor)
45 # gstreamer library package names
46 gst_lib := libgstreamer$(gst_abi)-0
47 gst_lib_dev := libgstreamer$(gst_abi)-dev
48 # what gstreamer version is needed
49 gst_lib_dev_dep := $(gst_lib_dev) (>= 0.10.22)
50
51 gst_pkgname := gstreamer$(gst_abi)
52 gst_deb_abi := $(gst_abi)-0
53
54 # gst-plugins-base library package names
55 gst_plugins_base_lib := libgstreamer-plugins-base$(gst_deb_abi)
56 gst_plugins_base_lib_dev := libgstreamer-plugins-base$(gst_abi)-dev
57 # gst-plugins-base library shlibs
58 gst_plugins_base_lib_dep := "$(gst_plugins_base_lib) (>= $(gst_version))"
59
60 # debug package
61 DEB_DH_STRIP_ARGS += --dbg-package=$(gst_pkgname)-plugins-base-dbg
62
63 DEB_COMPRESS_EXCLUDE = .sgml .devhelp .ps .pdf
64
65 # The plugins are basically the same.
66 # Link special names to a template file.
67 # still need "*.install" to be done by hand
68
69 PLUGINS += plugins-base x alsa plugins-base-extra plugins-base-subtitles
70 VERSIONIZE += \
71         plugins-base-apps.install \
72         plugins-base-apps.manpages \
73         plugins-base-doc.install \
74
75 # setup links for packages
76 pre-build::
77         for p in $(PLUGINS); do \
78                 rm -f debian/$(gst_pkgname)-$$p.install; \
79                 cat debian/gstreamer-$$p.install | \
80                         sed 's/@GST_ABI@/$(gst_abi)/g' \
81                         >debian/$(gst_pkgname)-$$p.install; \
82         done
83         for f in $(VERSIONIZE); do \
84                 cat debian/gstreamer-$$f | \
85                         sed 's/@GST_ABI@/$(gst_abi)/g' \
86                         >debian/$(gst_pkgname)-$$f; \
87         done
88         rm -f debian/libgstreamer-plugins-base$(gst_deb_abi).install
89         cat debian/libgstreamer-plugins-base.install | \
90                 sed 's/@GST_ABI@/$(gst_abi)/g' \
91                 >debian/libgstreamer-plugins-base$(gst_deb_abi).install
92         rm -f debian/libgstreamer-plugins-base$(gst_abi)-dev.install
93         cat debian/libgstreamer-plugins-base-dev.install | \
94                 sed 's/@GST_ABI@/$(gst_abi)/g' \
95                 >debian/libgstreamer-plugins-base$(gst_abi)-dev.install
96
97 maint: debian/control
98
99 debian/stamp-autogen:
100         ./autogen.sh --noconfigure
101         touch $@
102
103 post-patches:: debian/stamp-autogen
104
105 debian/control:: debian/control.in debian/rules debian/changelog force
106         cat debian/control.in | \
107                 sed 's/@GST_VERSION@/$(gst_version)/g' | \
108                 sed 's/@GST_ABI@/$(gst_abi)/g' | \
109                 sed 's/@GST_PKGNAME@/$(gst_pkgname)/g' | \
110                 sed 's/@GST_LIB@/$(gst_lib)/g' | \
111                 sed 's/@GST_LIB_DEV@/$(gst_lib_dev)/g' | \
112                 sed 's/@GST_LIB_DEV_DEP@/$(gst_lib_dev_dep)/g' | \
113                 sed 's/@GST_PLUGINS_BASE_LIB@/$(gst_plugins_base_lib)/g' | \
114                 sed 's/@GST_PLUGINS_BASE_LIB_DEV@/$(gst_plugins_base_lib_dev)/g' >$@
115
116 DEB_CONFIGURE_EXTRA_FLAGS += \
117         --enable-introspection=no \
118         --disable-nls \
119         --enable-debug \
120         --enable-experimental \
121         --with-audioresample-format=int \
122         --with-package-name=$(GST_PACKAGE_NAME) \
123         --with-package-origin=$(GST_PACKAGE_ORIGIN) \
124         --with-install-plugins-helper="/usr/bin/gstreamer-codec-install"
125
126 clean::
127         # get rid of the symlinks
128         for i in $(PLUGINS); do \
129                 rm -f debian/$(gst_pkgname)-$$i.install; \
130                 rm -f debian/$(gst_pkgname)-$$i.preinst; \
131         done
132         for f in $(VERSIONIZE); do \
133                 rm -f debian/$(gst_pkgname)-$$f; \
134         done
135         rm -f debian/libgstreamer-plugins-base$(gst_deb_abi).install
136         rm -f debian/libgstreamer-plugins-base$(gst_abi)-dev.install
137
138 binary-post-install/$(gst_pkgname)-plugins-base-apps::
139         dh_perl
140
141 DEB_DH_MAKESHLIBS_ARGS_$(gst_plugins_base_lib) += -V $(gst_plugins_base_lib_dep) -- -c4
142 DEB_INSTALL_DOCS_ALL += debian/README.Debian NEWS
143 DEB_SHLIBDEPS_INCLUDE += debian/libgstreamer-plugins-base$(gst_deb_abi)/usr/lib
144 # Disable inclusion of large upstream ChangeLog
145 DEB_INSTALL_CHANGELOGS_ALL :=
146
147 # override shlibs for libraries from this source before computing dependencies
148 # of packages generated from this source; we already have inter-dependencies
149 # expressed manually in the control file, we do not need the shlibs to add
150 # duplicates
151 # (this rule runs just before the dh_shlibdeps)
152 common-binary-fixup-arch::
153         mkdir -p $(CURDIR)/fake-home
154         HOME=$(CURDIR)/fake-home \
155         LD_LIBRARY_PATH=debian/libgstreamer-plugins-base0.10-0/usr/lib:$(LD_LIBRARY_PATH) \
156             dh_gstscancodecs
157         -rm -f debian/shlibs.local
158         rm -rf $(CURDIR)/fake-home
159         cat debian/*/DEBIAN/shlibs | \
160                 sed -n -r -e 's/(([^ ]+: )?([^ ]+) ([^ ]+)) .*/\1/p' \
161                         >debian/shlibs.local
162
163 # (this rules runs just after the dh_shlibdeps)
164 common-binary-predeb-arch::
165         -rm -f debian/shlibs.local
166
167 force:
168
169 .PHONY: maint force
170
171 UPSTREAM_REF=master
172 PATCHES_REF=maemo-patches
173
174 update-patch-series:
175         mkdir -p $(CURDIR)/debian/patches
176         rm -f $(CURDIR)/debian/patches/*.patch
177         git format-patch -N -o $(CURDIR)/debian/patches $(PATCHES_REF) ^$(UPSTREAM_REF) | \
178                 xargs -n 1 basename > $(CURDIR)/debian/patches/series
179         for patch in $$(ls $(CURDIR)/debian/patches/*.patch) ; \
180         do \
181                 lines=$$(cat $$patch | wc -l) ; \
182                 head -n $$(($$lines - 3)) $$patch > $${patch}.chomped ; \
183                 mv $${patch}.chomped $$patch ; \
184         done
185
186 update-common: COMMIT = $(shell git rev-parse $(shell git rev-parse --verify MERGE_HEAD || git merge-base $(UPSTREAM_REF) HEAD):common)
187 update-common:
188         @if ! git diff-files --ignore-submodules --quiet common || \
189                 ! git diff-index --ignore-submodules --cached --quiet HEAD -- common; then \
190                         echo "your common/ directory state is dirty"; \
191                         exit 1; \
192                 fi
193         if test -d $(CURDIR)/common ; then rm -rfv $(CURDIR)/common ; git rm -r --cached --ignore-unmatch $(CURDIR)/common ; fi
194         git clone -n git://anongit.freedesktop.org/gstreamer/common $(CURDIR)/common
195         cd $(CURDIR)/common && git checkout -f $(COMMIT)
196         rm -rfv $(CURDIR)/common/.git
197         git add $(CURDIR)/common
198         @echo "common update staged, git commit to proceed"