~ubuntu-branches/ubuntu/jaunty/xvidcap/jaunty-proposed

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Bazaar Package Importer
  • Author(s): John Dong
  • Date: 2008-02-25 15:47:12 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080225154712-qvr11ekcea4c9ry8
Tags: 1.1.6-0.1ubuntu1
* Merge from debian-multimedia (LP: #120003), Ubuntu Changes:
 - For ffmpeg-related build-deps, remove cvs from package names.
 - Standards-Version 3.7.3
 - Maintainer Spec

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/make -f
2
 
# Sample debian/rules that uses debhelper.
3
 
# GNU copyright 1997 to 1999 by Joey Hess.
4
2
 
5
3
#export DH_VERBOSE=1
6
4
 
 
5
include /usr/share/dpatch/dpatch.make
 
6
 
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)
9
9
 
10
 
CFLAGS = -Wall -g -DHAVE_FFMPEG_AUDIO
 
10
NCPUS := $(shell getconf _NPROCESSORS_ONLN 2>/dev/null || echo 1)
 
11
 
 
12
ifeq ($(NCPUS),-1)
 
13
        NCPUS:=1
 
14
endif
 
15
 
 
16
ifeq ($(NCPUS),0)
 
17
        NCPUS:=1
 
18
endif
 
19
 
 
20
CFLAGS = -Wall -g
11
21
 
12
22
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
13
23
        CFLAGS += -O0
19
29
configure-stamp: patch-stamp
20
30
        dh_testdir
21
31
 
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
25
35
 
26
36
        touch configure-stamp
27
37
 
29
39
build-stamp: configure-stamp
30
40
        dh_testdir
31
41
 
32
 
        $(MAKE)
 
42
        $(MAKE) -j $(NCPUS)
33
43
 
34
44
        touch build-stamp
35
45
 
39
49
        rm -f build-stamp configure-stamp
40
50
 
41
51
        [ ! -f Makefile ] || $(MAKE) distclean
 
52
        [ ! -f config.mak: ] || [ ! -f ffmpeg/common.mak ] || $(MAKE) -C ffmpeg distclean
 
53
 
 
54
        -rm ffmpeg/*.pc
 
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}
 
59
 
 
60
        find ffmpeg -type l | xargs -r rm 
42
61
 
43
62
        debian/rules unpatch
44
63
 
45
 
        dh_clean src/XVidcap.ad
 
64
        dh_clean intltool-extract intltool-update intltool-merge \
 
65
        ffmpeg/version.h
46
66
 
47
67
install: build
48
68
        dh_testdir
49
69
        dh_testroot
50
70
        dh_clean -k
51
 
        dh_installdirs -A usr/share/bug/xvidcap usr/share/bug/gvidcap
52
 
        dh_installdirs -pxvidcap etc/X11/app-defaults
 
71
        dh_installdirs
53
72
 
54
73
        $(MAKE) install prefix=$(CURDIR)/debian/xvidcap/usr
55
74
 
56
 
        dh_movefiles --sourcedir=debian/xvidcap
57
 
 
58
 
        rm -rf debian/xvidcap/usr/share/doc/xvidcap_1.1.3
59
 
 
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
63
77
 
64
78
# Prune empty directories
65
79
        find debian -type d | xargs rmdir -p --ignore-fail-on-non-empty
71
85
binary-arch: build install
72
86
        dh_testdir
73
87
        dh_testroot
74
 
        dh_installdocs -A README TODO README AUTHORS
 
88
        dh_installdocs
75
89
        dh_installmenu
76
 
#       dh_installman
77
90
        dh_installchangelogs ChangeLog
78
91
        dh_link
79
92
        dh_strip
87
100
 
88
101
binary: binary-indep binary-arch
89
102
.PHONY: build clean binary-indep binary-arch binary install configure patch unpatch
90
 
 
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})
96
 
 
97
 
UNPATCHLIST      = $(shell echo ${PATCHLIST} | tr ' ' '\n' | tac)
98
 
 
99
 
# Expand them right now
100
 
PATCHLIST       := ${PATCHLIST}
101
 
UNPATCHLIST     := ${UNPATCHLIST}
102
 
 
103
 
patch: patch-stamp
104
 
patch-stamp:
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; \
120
 
                else \
121
 
                        echo -n "applying patch $$patch..."; \
122
 
                        if $$patch -patch >$$stamp.new 2>&1; then \
123
 
                                mv $$stamp.new $$stamp; \
124
 
                                touch $$stamp; \
125
 
                                echo -e "\n$$patch ($$author):" >> $@T; \
126
 
                                sed -n 's/^#* *DP: */  /p' $$patch >> $@T; \
127
 
                                echo " ok."; \
128
 
                        else \
129
 
                                echo " failed."; \
130
 
                                exit 1; \
131
 
                        fi; \
132
 
                fi; \
133
 
        done
134
 
        mv -f $@T $@
135
 
 
136
 
unpatch:
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 \
145
 
                                rm -f $$stamp; \
146
 
                                echo " ok."; \
147
 
                        else \
148
 
                                echo " failed."; \
149
 
                                exit 1; \
150
 
                        fi; \
151
 
                fi; \
152
 
        done
153
 
        rm -rf patch-stamp patch-stampT debian/patched