6
include /usr/share/gnome-pkg-tools/1/rules/uploaders.mk
7
DEB_VERSION := $(shell dpkg-parsechangelog | sed -n -e 's/^Version: //p')
8
include /usr/share/gnome-pkg-tools/1/rules/gnome-version.mk
9
-include /usr/share/gnome-pkg-tools/1/rules/gnome-get-source.mk
11
STAMP_DIR := debian/stamp
12
BUILD_DIR := debian/build
13
PATCH_DIR := debian/patches
15
COMPKG := totem-common
16
PLUGPKG := totem-plugins
17
PLUGEXTRAPKG := totem-plugins-extra
19
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
20
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
22
FLAVORS := xine gstreamer
24
PRIORITY_gstreamer := 40
25
export PRIORITY_xine PRIORITY_gstreamer
27
CFLAGS += -Wall -g -O$(if $(findstring noopt,$(DEB_BUILD_OPTIONS)),0,2)
29
COMMON_CONFIGURE_FLAGS += \
32
--mandir=\$${prefix}/share/man \
33
--disable-maintainer-mode \
34
--with-gecko=mozilla \
35
--disable-run-in-source-tree \
36
--disable-scrollkeeper
38
ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
39
COMMON_CONFIGURE_FLAGS += --build=$(DEB_BUILD_GNU_TYPE)
41
COMMON_CONFIGURE_FLAGS += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
44
xine_CONFIGURE_FLAGS := $(COMMON_CONFIGURE_FLAGS) \
45
--libexecdir=\$${prefix}/lib/totem/xine \
48
gstreamer_CONFIGURE_FLAGS := $(COMMON_CONFIGURE_FLAGS) \
49
--libexecdir=\$${prefix}/lib/totem/gstreamer
51
patch: $(STAMP_DIR)/patch-stamp
52
$(STAMP_DIR)/patch-stamp:
55
QUILT_PATCHES=$(PATCH_DIR) quilt --quiltrc /dev/null push -a || test $$? = 2
58
builddir = $(BUILD_DIR)/$*
60
configure: $(addprefix $(STAMP_DIR)/configure-stamp-, $(FLAVORS))
61
$(STAMP_DIR)/configure-stamp-%: $(STAMP_DIR)/patch-stamp
63
ifneq "$(wildcard /usr/share/misc/config.sub)" ""
64
cp -f /usr/share/misc/config.sub config.sub
66
ifneq "$(wildcard /usr/share/misc/config.guess)" ""
67
cp -f /usr/share/misc/config.guess config.guess
71
CFLAGS="$(CFLAGS)" $(CURDIR)/configure $($*_CONFIGURE_FLAGS)
74
build: $(addprefix $(STAMP_DIR)/build-stamp-, $(FLAVORS))
75
$(STAMP_DIR)/build-stamp-%: $(STAMP_DIR)/configure-stamp-%
77
$(MAKE) -C $(builddir)
79
cd po; intltool-update -p
81
installdir = $(CURDIR)/debian/totem-$*
88
install-%: $(STAMP_DIR)/build-stamp-%
89
GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 \
90
$(MAKE) -C $(builddir) install DESTDIR=$(installdir)
91
cd $(installdir)/usr/bin && for i in totem*; do \
92
mv $$i totem-$*$${i#totem} ; done
93
cd $(installdir)/$$(pkg-config libnautilus-extension --variable=extensiondir) && \
94
mv libtotem-properties-page.so libtotem-properties-page.so.$*
95
# hide the mozilla plugin in a specific directory
96
cd $(installdir)/usr/lib/mozilla/plugins && \
97
mv *.so $(installdir)/usr/lib/totem/$*/
99
rm -rf $(installdir)/usr/lib/xulrunner
100
# drop *.a and *.la files
101
find debian/totem-$*/usr/lib -mindepth 2 -name '*.a' -exec rm {} \;
102
find debian/totem-$*/usr/lib -name '*.la' -exec rm {} \;
103
echo gnome:Version=$(DEB_GNOME_VERSION) >> debian/totem-$*.substvars
104
echo gnome:NextVersion=$(DEB_GNOME_NEXTVERSION) >> debian/totem-$*.substvars
106
TOTEM_XINE_ONLY_MIMES := x-content/video-dvd;x-content/video-vcd;x-content/video-svcd;
108
install: install-clean $(addprefix install-, $(FLAVORS))
110
mkdir -p debian/$(COMPKG)/usr
111
mv debian/totem-gstreamer/etc debian/$(COMPKG)/
112
mv debian/totem-gstreamer/usr/share debian/$(COMPKG)/usr/
113
mkdir -p debian/$(PLUGPKG)/usr/lib/totem
114
mv debian/totem-gstreamer/usr/lib/totem/plugins debian/$(PLUGPKG)/usr/lib/totem/
115
find debian/$(PLUGPKG) -name '*.py[co]' -delete
116
mkdir -p debian/$(PLUGEXTRAPKG)/usr/lib/totem/plugins
117
mv debian/$(PLUGPKG)/usr/lib/totem/plugins/gromit debian/$(PLUGEXTRAPKG)/usr/lib/totem/plugins
118
find debian/$(PLUGEXTRAPKG) -name '*.py[co]' -delete
119
cd debian/totem-xine && rm -rf etc usr/share usr/lib/totem/plugins
120
# Make both totems installable together
121
for f in $(FLAVORS); do \
122
F=`echo $$f | sed -r 's/^([a-z])/\U\1/'` ; \
123
mkdir -p debian/totem-$$f/usr/share/applications ; \
124
( sed -r "s/^Name(.*)$$/Name\1 ($$F)/" \
125
debian/$(COMPKG)/usr/share/applications/totem.desktop \
126
| sed -r "s,^(Exec=.*totem),\1-$$f," \
127
| grep -v ^MimeType ; \
128
echo NoDisplay=true ) \
129
> debian/totem-$$f/usr/share/applications/totem-$$f.desktop ; \
130
sed -e"s/@FLAVOUR@/$$f/" \
131
-e"s/@PRIORITY@/$$(eval echo \$$PRIORITY_$$f)/" \
132
-e"s,@NAUTILUS_EXTDIR@,$$(pkg-config libnautilus-extension --variable=extensiondir)," \
133
< debian/totem-flavor.postinst.in \
134
> debian/totem-$${f}.postinst ; \
136
printf "\nTryExec=/usr/bin/totem" >> debian/$(COMPKG)/usr/share/applications/totem.desktop
138
# only totem-xine can play DVDs and VCDs satisfactorily (for now)
139
grep -q '^MimeType=.*$(TOTEM_XINE_ONLY_MIMES)' debian/$(COMPKG)/usr/share/applications/totem.desktop
140
sed -i 's,$(TOTEM_XINE_ONLY_MIMES),,' debian/$(COMPKG)/usr/share/applications/totem.desktop
141
printf '\nMimeType=$(TOTEM_XINE_ONLY_MIMES)' >> debian/totem-xine/usr/share/applications/totem-xine.desktop
148
QUILT_PATCHES=$(PATCH_DIR) quilt --quiltrc /dev/null pop -a -R || test $$? = 2
149
rm -f $(foreach f,$(FLAVORS),debian/totem-$(f).postinst)
151
rm -rf $(INSTALL_DIR) $(BUILD_DIR) $(STAMP_DIR)
152
-rm -f po/totem.pot config.sub config.guess
155
binary: binary-arch binary-indep
157
# Build architecture-independent files here.
158
binary-indep: build install
161
dh_installdocs -i -A NEWS README
162
dh_installchangelogs -i ChangeLog
171
: # symlink identical Gnome help files within packages
172
for p in $$(dh_listpackages -i); do \
173
if [ -d debian/$$p/usr/share/gnome/help ]; then \
174
(cd debian/$$p && LC_ALL=C fdupes -r1nq usr/share/gnome/help \
176
set -- $$(echo $$s | tr ' ' '\n' | sort); \
179
echo "symlinking duplicate Gnome help file $$d to $$f"; \
180
rm $$d; ln -s /$$f $$d; \
193
# Build architecture-dependent files here.
194
binary-arch: build install
197
dh_installdocs -a -A NEWS README
199
dh_installchangelogs -a ChangeLog
204
: # symlink identical Gnome help files within packages
205
for p in $$(dh_listpackages -a); do \
206
if [ -d debian/$$p/usr/share/gnome/help ]; then \
207
(cd debian/$$p && LC_ALL=C fdupes -r1nq usr/share/gnome/help \
209
set -- $$(echo $$s | tr ' ' '\n' | sort); \
212
echo "symlinking duplicate Gnome help file $$d to $$f"; \
213
rm $$d; ln -s /$$f $$d; \
221
dh_strip -a --dbg-package=totem-dbg
224
dh_pysupport -a /usr/lib/totem/plugins/totem \
225
/usr/lib/totem/plugins/bbc \
226
/usr/lib/totem/plugins/pythonconsole \
227
/usr/lib/totem/plugins/youtube
233
.PHONY: patch configure build install clean install-clean binary-indep binary-arch binary