2
# Sample debian/rules that uses debhelper.
3
# GNU copyright 1997 to 1999 by Joey Hess.
5
include /usr/share/dpatch/dpatch.make
7
7
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
8
8
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
10
CFLAGS = -Wall -g -DHAVE_FFMPEG_AUDIO
10
NCPUS := $(shell getconf _NPROCESSORS_ONLN 2>/dev/null || echo 1)
12
22
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
19
29
configure-stamp: patch-stamp
22
CFLAGS="$(CFLAGS)" ./configure --prefix=/usr --with-gtk2 \
32
CFLAGS="$(CFLAGS)" ./configure --prefix=/usr \
23
33
--mandir=\$${prefix}/share/man --host=$(DEB_HOST_GNU_TYPE) \
24
--build=$(DEB_BUILD_GNU_TYPE)
34
--build=$(DEB_BUILD_GNU_TYPE) --without-forced-embedded-ffmpeg
26
36
touch configure-stamp
39
49
rm -f build-stamp configure-stamp
41
51
[ ! -f Makefile ] || $(MAKE) distclean
52
[ ! -f config.mak: ] || [ ! -f ffmpeg/common.mak ] || $(MAKE) -C ffmpeg distclean
55
find -name *.omf.out | xargs -r rm
56
find -name *.o | xargs -r rm
57
find -name *.a | xargs -r rm
58
-rm ffmpeg/config.{log,h,err}
60
find ffmpeg -type l | xargs -r rm
43
62
debian/rules unpatch
45
dh_clean src/XVidcap.ad
64
dh_clean intltool-extract intltool-update intltool-merge \
51
dh_installdirs -A usr/share/bug/xvidcap usr/share/bug/gvidcap
52
dh_installdirs -pxvidcap etc/X11/app-defaults
54
73
$(MAKE) install prefix=$(CURDIR)/debian/xvidcap/usr
56
dh_movefiles --sourcedir=debian/xvidcap
58
rm -rf debian/xvidcap/usr/share/doc/xvidcap_1.1.3
60
cp src/XVidcap.ad debian/xvidcap/etc/X11/app-defaults/XVidcap
61
cp debian/bts debian/xvidcap/usr/share/bug/xvidcap/control
62
cp debian/bts debian/gvidcap/usr/share/bug/gvidcap/control
75
rm debian/xvidcap/usr/share/doc/xvidcap/ChangeLog
76
rm debian/xvidcap/usr/share/doc/xvidcap/COPYING
64
78
# Prune empty directories
65
79
find debian -type d | xargs rmdir -p --ignore-fail-on-non-empty
88
101
binary: binary-indep binary-arch
89
102
.PHONY: build clean binary-indep binary-arch binary install configure patch unpatch
91
DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
92
DPATCH_ARCH := ${DEB_BUILD_ARCH}
93
PATCHLIST_ALL = $(shell test -f debian/patches/00list && grep -v ^\# debian/patches/00list)
94
PATCHLIST_ARCH = $(shell test -f debian/patches/00list.${DPATCH_ARCH} && grep -v ^\# debian/patches/00list.${DPATCH_ARCH})
95
PATCHLIST ?= $(shell echo ${PATCHLIST_ALL} ${PATCHLIST_ARCH})
97
UNPATCHLIST = $(shell echo ${PATCHLIST} | tr ' ' '\n' | tac)
99
# Expand them right now
100
PATCHLIST := ${PATCHLIST}
101
UNPATCHLIST := ${UNPATCHLIST}
105
test -d debian/patched || install -d debian/patched
106
@echo "Patches applied in the Debian version of ${PACKAGE}:" > $@T
107
@for patch in ${PATCHLIST}; do \
108
patchdir=$${patch%/*}; \
109
test "x$$patchdir" = "x$$patch" || \
110
install -d debian/patched/$$patchdir; \
111
stamp=debian/patched/$${patch%%.dpatch}.dpatch; \
112
test -e debian/patches/$$patch || ext=.dpatch; \
113
patch=debian/patches/$$patch$$ext; \
114
author=`sed -n "s,^#* *.*dpatch by *,,p" $$patch`; \
115
test -x $$patch || chmod +x $$patch; \
116
if test -f $$stamp; then \
117
echo "$$patch already applied."; \
118
echo -e "\n$$patch ($$author):" >> $@T; \
119
sed -n 's/^#* *DP: */ /p' $$patch >> $@T; \
121
echo -n "applying patch $$patch..."; \
122
if $$patch -patch >$$stamp.new 2>&1; then \
123
mv $$stamp.new $$stamp; \
125
echo -e "\n$$patch ($$author):" >> $@T; \
126
sed -n 's/^#* *DP: */ /p' $$patch >> $@T; \
137
@for patch in ${UNPATCHLIST}; do \
138
stamp=debian/patched/$${patch%%.dpatch}.dpatch; \
139
test -e debian/patches/$$patch || ext=.dpatch; \
140
patch=debian/patches/$$patch$$ext; \
141
test -x $$patch || chmod +x $$patch; \
142
if test -f $$stamp; then \
143
echo -n "reverting patch $$patch..."; \
144
if $$patch -unpatch 2>&1 >/dev/null; then \
153
rm -rf patch-stamp patch-stampT debian/patched