debian/: support parallel in DEB_BUILD_OPTIONS.
[mplayer.git] / debian / rules
blobfc93c221640f778a71893db88e0dcaa2c7ef35af
1 #!/usr/bin/make -f
2 # Made with the aid of debmake, by Christoph Lameter,
3 # based on the sample debian/rules file for GNU hello by Ian Jackson.
4 #export DH_VERBOSE=1
5 # This is the debhelper compatability version to use.
6 export DH_COMPAT=4
8 # do not run the actual rules of this makefile in parallel. sub-makes
9 # can go in parallel
10 .NOTPARALLEL:
12 package := mplayer
13 prefix := $(shell pwd)/debian/$(package)
15 arch := $(shell dpkg --print-architecture)
17 # See http://wiki.debian.org/Teams/Dpkg/DebianRules; #465282 and
18 # https://wiki.ubuntu.com/DistCompilerFlags
19 CLEAN_ENV=env -u CFLAGS -u CPPFLAGS -u LDFLAGS -u FFLAGS -u CXXFLAGS
21 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
22 NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
23 MAKEFLAGS += -j$(NUMJOBS)
24 endif
26 configure: configure-stamp
27 configure-stamp:
28 dh_testdir
29 # Add here commands to configure the package.
30 $(checkdir)
31 # If you plan to install the target .deb on a wide variety of machines,
32 # you may want to add the "--enable-runtime-cpudetection" option to
33 # the line below, but beware: the resulting binary will run slower
34 $(CLEAN_ENV) \
35 ./configure --prefix=/usr --confdir=/etc/mplayer $(DEB_BUILD_CONFIGURE)
37 touch configure-stamp
39 build: configure-stamp build-stamp
40 build-stamp:
41 dh_testdir
43 # commands to compile the package.
44 $(CLEAN_ENV) \
45 ${MAKE}
47 touch build-stamp
49 clean:
50 dh_testdir
51 dh_testroot
52 rm -f build-stamp configure-stamp
54 # commands to clean up after the build process.
55 -$(MAKE) distclean
56 rm -f help_mp.h config.h config.mak
57 dh_clean
59 # Build architecture-independent files here.
60 binary-indep: build
61 # We have nothing to do by default.
63 # Build architecture-dependent files here.
64 binary-arch: build
65 dh_testdir
66 dh_testroot
67 dh_clean -k
68 dh_installdirs
70 # commands to install the package into debian/<packagename>
71 $(MAKE) prefix=$(prefix)/usr BINDIR=$(prefix)/usr/bin CONFDIR=$(prefix)/etc/mplayer LIBDIR=$(prefix)/usr/lib DATADIR=$(prefix)/usr/share/mplayer MANDIR=$(prefix)/usr/share/man install
73 install -D -m 644 etc/example.conf $(prefix)/etc/mplayer/mplayer.conf
74 dh_installdocs -X.svn -Xmplayer.1 DOCS/*
75 dh_installexamples etc/example.conf etc/dvb-menu.conf etc/input.conf etc/menu.conf
76 dh_installmime
77 dh_installinfo
78 dh_installchangelogs
79 #ChangeLog
80 dh_link
81 dh_strip
82 dh_compress
83 dh_fixperms
84 dh_makeshlibs
85 dh_installdeb
86 dh_perl
87 dh_shlibdeps
88 dh_gencontrol
89 dh_md5sums
90 dh_builddeb
94 #binary-arch: checkroot build
95 # $(checkdir)
96 # -rm -rf debian/tmp
97 # install -d debian/tmp
98 # cd debian/tmp && install -d `cat ../dirs`
101 # Must have debmake installed for this to work. Otherwise please copy
102 # /usr/bin/debstd into the debian directory and change debstd to debian/debstd
103 # debstd
104 # dpkg-gencontrol -isp
105 # chown -R root.root debian/tmp
106 # chmod -R go=rX debian/tmp
107 # dpkg --build debian/tmp ..
109 binary: binary-indep binary-arch
111 .PHONY: binary binary-arch binary-indep clean checkroot