2
# The template for this file was originally written by Joey Hess and
3
# Craig Small. Then further work was done by Miriam Ruiz for Debian, and
4
# Alexander Sack for Ubuntu.
5
# Many more modifications were made by Rob Savoye for Gnash and Petter
6
# Reinholdtsen for Debian Edu.
8
# Uncomment this to turn on verbose mode.
11
# These are used for cross-compiling and for saving the configure script
12
# from having to guess our platform (since we know it already)
13
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
14
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
16
SNAPSHOT_VERSION = $(shell head -n 1 debian/changelog | cut '-d ' -f 2 | sed 's/[()]//g')
17
MAIN_VERSION = $(shell head -n 1 debian/changelog | cut '-d ' -f 2 | sed 's/[()]//g' | cut -d '.' -f 1-3)
18
BUILD_VERSION = $(shell head -n 1 debian/changelog | cut '-d ' -f 2 | sed 's/[()]//g' | cut -d '.' -f 4)
20
INFILES := $(wildcard debian/*.desktop.in)
21
OUTFILES := $(INFILES:.desktop.in=.desktop)
23
%.desktop: %.desktop.in
24
intltool-merge -d debian/po $< $@
26
# Set defaults for the compiler and linker flags
27
CFLAGS = -Wall -g -Werror-implicit-function-declaration
29
# Look for the standard build options
31
# Sometimes we want to build without optimization, usually only when
32
# testing package building.
33
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
39
# Enable debugging in the package instead of using the debug package
40
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
43
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
47
# Do parallel builds, ie.. the -jN option to make
48
ifneq (,$(findstring parallel=,$(DEB_BUILD_OPTIONS)))
49
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
50
MAKEFLAGS += -j$(NUMJOBS)
53
DEB_DH_SHLIBDEPS_ARGS_ALL := -X* /usr/lib/gnash
58
printf "\n == APPLYING PATCHES == \n\n"
59
"we have no patches, we're the developers!"
60
# $(MAKE) -f /usr/share/quilt/quilt.make patch
61
printf "\n ---- End of APPLYING PATCHES ---- \n\n"
66
# Handle optional configurarions
68
# These flags are the defaults Gnash uses when configuring, but we pass
69
# them here explicitly because it makes it easier for non Gnash developers
70
# to know what those defaults are.
71
BUILD_FLAGS = --enable-jemalloc
73
# this is where all the objects and executables go. We have to
74
# redfine this, instead of just appending the path elements, as
75
# make insists on putting a space between each element, which
76
# produces a path that doens't work.
77
BUILD_DIRECTORY = _build
79
# Optionally build an OpenGL enabled package, AGG is the default
80
ifneq (,$(findstring ogl,$(DEB_BUILD_OPTIONS)))
81
BUILD_FLAGS += --enable-renderer=ogl
82
BUILD_DIRECTORY = _build.ogl
84
BUILD_VERSION = $(MAIN_VERSION).ogl.$(BUILD_VERSION)
87
# Optionally build an ffmpeg enabled package, Gstreamer is the default
88
ifneq (,$(findstring ffmpeg,$(DEB_BUILD_OPTIONS)))
89
BUILD_FLAGS += --enable-media=ffmpeg
90
BUILD_VERSION = $(MAIN_VERSION).ffmpeg.$(BUILD_VERSION)
91
ifneq (,$(findstring ogl,$(DEB_BUILD_OPTIONS)))
92
BUILD_DIRECTORY = _build.ogl.ffmpeg
93
BUILD_VERSION = $(MAIN_VERSION).ogl.ffmpeg.$(BUILD_VERSION)
94
BUILD_DEBUG = -opengl-ffmpeg
96
BUILD_DIRECTORY = _build.ffmpeg
100
BUILD_FLAGS += --enable-media=gst,ffmpeg
103
# Optionally build the older kde3 package, Qt4 is the default
104
ifneq (,$(findstring kde3,$(DEB_BUILD_OPTIONS)))
105
BUILD_FLAGS += --enable-gui=gtk,kde3
106
BUILD_VERSION = $(MAIN_VERSION).kde3.$(BUILD_VERSION)
107
ifneq (,$(findstring ogl,$(DEB_BUILD_OPTIONS)))
108
BUILD_DIRECTORY = _build.ogl.kde3
109
BUILD_VERSION = $(MAIN_VERSION).ogl.kde3.$(BUILD_VERSION)
110
BUILD_DEBUG = -opengl-kde3
112
BUILD_DIRECTORY = _build.kde3
116
BUILD_FLAGS += --enable-gui=gtk,qt4
119
# Configure Gnash. We use a different set of options, as when building
120
# packages, we want to enable everything that Gnash can do, like
121
# python support, the SDK cygnal, etc... These are not enabled by
122
# default to make it less complicated for end users building Gnash
124
# for now, only build the qt4 support, as kde3 is being depreciated.
125
CONFIGURE_FLAGS = CFLAGS="$(CFLAGS)" \
126
CXXFLAGS="$(CXXFLAGS)" \
127
--host=$(DEB_HOST_GNU_TYPE) \
128
--build=$(DEB_BUILD_GNU_TYPE) \
131
--mandir=/usr/share/man \
132
--infodir=/usr/share/info \
133
--with-plugins-install=system \
134
--disable-dependency-tracking \
135
--disable-testsuite \
139
--enable-device=egl,x11 \
140
--enable-renderer=agg,cairo,opengl \
141
--enable-extensions=fileio,lirc,mysql \
145
config-stamp: patch-stamp
148
ifneq "$(wildcard /usr/share/misc/config.sub)" ""
149
cp -f /usr/share/misc/config.sub config.sub
151
ifneq "$(wildcard /usr/share/misc/config.guess)" ""
152
cp -f /usr/share/misc/config.guess config.guess
155
# Only run autogen.sh if there isn't a configure script. When
156
# building packages from within a configured build directory. In
157
# a freshly checked out source tree from bzr, there is no
158
# configure script. When building from a source tarball as made
159
# by 'make dist', then all the configure scripts are already
161
if test ! -e configure; then \
162
printf "\n == AUTOGEN == \n\n"; \
163
$(CURDIR)/autogen.sh; \
164
printf "\n ---- End of AUTOGEN ---- \n\n"; \
167
# Make a sub-directory to build all the objects and executables in.
168
if test ! -d $(BUILD_DIRECTORY); then \
169
mkdir $(BUILD_DIRECTORY); \
172
# Configure that build subdirectory.
173
printf "\n == CONFIGURE == \n\n"
174
cd $(BUILD_DIRECTORY) && $(CURDIR)/configure $(CONFIGURE_FLAGS);
175
printf "\n ---- End of CONFIGURE ---- \n\n"
181
# We don't run make check, as the testsuite takes a long time to build
182
# and run, and we just want a package. This of course requires the
183
# package builder to run make check before building packages if the
186
build-stamp: config-stamp $(OUTFILES)
189
@printf "\n == MAKE == \n\n"
190
$(MAKE) -C $(BUILD_DIRECTORY) LDFLAGS="$(LDFLAGS)"
191
@printf "\n ---- End of MAKE ---- \n\n"
192
cp cygnal/libamf/README README.amf
193
cp cygnal/README README.cygnal
194
# @printf "\n == CHECK ==\n\n"
195
# $(MAKE) -C $(BUILD_DIRECTORY) check
196
# @printf "\n ---- End of CHECK ---- \n\n"
202
# Remove anything that could be left from a previous build. Basically
203
# all temporary files or generated files. We also clean out the
204
# manpages, as these are the preformatted ones from the tarball, so
205
# they don't get rebuild by docbook unless we remove them.
211
rm -f README.amf README.cygnal
212
if test -d debian/po; then \
213
ls $(INFILES) | sed 's#^#../#' > debian/po/POTFILES.in; \
214
cd debian/po && intltool-update -g debian --pot && \
215
for i in *.po; do intltool-update -g debian --dist $${i%.po}; done; \
216
rm -f debian/po/POTFILES.in; \
218
rm -fr $(BUILD_DIRECTORY)
220
@printf "\n == CLEANING PATCHES ==\n\n"
221
echo " we have no patches, we're the developers!"
222
# $(MAKE) -f /usr/share/quilt/quilt.make unpatch
223
@printf "\n ---- End of CLEANING PATCHES ---- \n\n"
229
# Install gnash. This also builds the SDK, which isn't directly
230
# supported by the gnash Makefiles. We also have to compress the two
231
# man pages aliases, which don't get compressed as they're not part of
232
# the standard make target. These get generated when building gnash.1,
233
# and of course have no associated source file.
240
@printf "\n == INSTALL ==\n\n"
241
$(MAKE) -C $(BUILD_DIRECTORY) install DESTDIR=$(CURDIR)/debian/tmp
242
$(MAKE) -C $(BUILD_DIRECTORY) install-plugins DESTDIR=$(CURDIR)/debian/tmp
243
@printf "\n ---- End of INSTALL ---- \n\n"
245
install -d $(CURDIR)/debian/tmp/usr/include/gnash/libbase/
246
cp libbase/*.h $(CURDIR)/debian/tmp/usr/include/gnash/libbase/
247
install -d $(CURDIR)/debian/tmp/usr/include/gnash/libnet/
248
cp libbase/*.h $(CURDIR)/debian/tmp/usr/include/gnash/libnet/
249
install -d $(CURDIR)/debian/tmp/usr/include/gnash/libamf/
250
cp cygnal/libamf/*.h $(CURDIR)/debian/tmp/usr/include/gnash/libamf/
251
install -d $(CURDIR)/debian/tmp/usr/include/gnash/libcore/
252
cp cygnal/libnet/*.h $(CURDIR)/debian/tmp/usr/include/gnash/libnet/
253
install -d $(CURDIR)/debian/tmp/usr/include/gnash/libcore/
254
cp libcore/*.h $(CURDIR)/debian/tmp/usr/include/gnash/libcore/
255
install -d $(CURDIR)/debian/tmp/usr/include/gnash/libmedia/
256
cp libmedia/*.h $(CURDIR)/debian/tmp/usr/include/gnash/libmedia/
257
install -d $(CURDIR)/debian/tmp/usr/include/gnash/librender/
258
cp librender/*.h $(CURDIR)/debian/tmp/usr/include/gnash/librender/
259
install -d $(CURDIR)/debian/tmp/usr/include/gnash/gui/
260
cp gui/*.h $(CURDIR)/debian/tmp/usr/include/gnash/gui/
262
install -d $(CURDIR)/debian/tmp/usr/share/pixmaps/
263
cp packaging/*.xpm $(CURDIR)/debian/tmp/usr/share/pixmaps/
264
install -d $(CURDIR)/debian/tmp/usr/share/applications/
265
cp debian/*.desktop $(CURDIR)/debian/tmp/usr/share/applications/
266
#gzip -f9 $(CURDIR)/debian/tmp/usr/share/man/man1/gtk-gnash.1
267
#gzip -f9 $(CURDIR)/debian/tmp/usr/share/man/man1/qt4-gnash.1
271
# Build architecture-independent files here.
272
binary-indep: install
273
dh_install -i --sourcedir=$(CURDIR)/debian/tmp
275
# Build architecture-dependent files here.
279
dh_installchangelogs -XChangeLog
282
dh_install -a --list-missing --sourcedir=$(CURDIR)/debian/tmp
289
dh_strip --dbg-package=gnash-dbg$(BUILD_DEBUG)
293
[ ! -e /usr/bin/dh_buildinfo ] || dh_buildinfo
295
export LD_LIBRARY_PATH="$(CURDIR)/debian/gnash-common-opengl/usr/lib/gnash:$$LD_LIBRARY_PATH" ; \
296
dh_shlibdeps -Lgnash-common-opengl \
297
-pgnash-common-opengl \
298
-- -Ldebian/shlibs-opengl.local $(shell dpkg-shlibdeps --help | sed -ne "s/.*\(--ignore-missing-info\).*/\1/p")
299
export LD_LIBRARY_PATH="$(CURDIR)/debian/gnash-common-opengl/usr/lib/gnash:$$LD_LIBRARY_PATH" ; \
300
dh_shlibdeps -Lgnash-common-opengl \
301
-pgnash-opengl -pklash-opengl \
302
-- -Ldebian/shlibs-opengl.local
303
export LD_LIBRARY_PATH="$(CURDIR)/debian/gnash-common/usr/lib/gnash:$$LD_LIBRARY_PATH" ; \
304
dh_shlibdeps -Lgnash-common \
306
-- -Ldebian/shlibs-agg.local $(shell dpkg-shlibdeps --help | sed -ne "s/.*\(--ignore-missing-info\).*/\1/p")
307
export LD_LIBRARY_PATH="$(CURDIR)/debian/gnash-common/usr/lib/gnash:$$LD_LIBRARY_PATH" ; \
308
dh_shlibdeps -Lgnash-common \
310
-- -Ldebian/shlibs-agg.local
311
export LD_LIBRARY_PATH="$(CURDIR)/debian/gnash-common/usr/lib/gnash:$$LD_LIBRARY_PATH" ; \
312
dh_shlibdeps -Lgnash-common \
313
-pmozilla-plugin-gnash -pkonqueror-plugin-gnash -pgnash-tools -pgnash-cygnal \
314
-- -Ldebian/shlibs-both.local
319
VERSION_DATE = $(shell /bin/date --utc +%0Y%0m%0d.%0k%0M)
320
BRANCH_NICK = `grep "NICK" $(CURDIR)/revno.h | cut -d '"' -f 2`
321
BRANCH_REVNO = `grep "REVNO" $(CURDIR)/revno.h | cut -d '"' -f 2`
322
#VERSION_ID = 0.8.10+bzr.trunk$(VERSION_DATE)
323
VERSION_ID = 0.8.10+git.$(BRANCH_NICK)$(BRANCH_REVNO)
325
echo Downloading gnash $(VERSION_ID) from git...
326
git clone git://git.sv.gnu.org/gnash.git
327
# cd gnash; rm -rf `find . -name .git`
328
tar cvfz "gnash_$(VERSION_ID).orig.tar.gz" gnash
329
mv gnash "gnash-$(VERSION_ID)"
330
cp debian "gnash-$(VERSION_ID)" -a
331
cd "gnash-$(VERSION_ID)"; dch -v "$(VERSION_ID)-1" "New Upstream Release. Downloaded from Git."
333
binary: binary-indep binary-arch
334
.PHONY: config build clean binary-indep binary-arch binary install get-git-source patch