~ubuntu-desktop/transmission/ubuntu

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Jeremy Bicha
  • Date: 2011-09-18 17:52:11 UTC
  • Revision ID: jbicha@ubuntu.com-20110918175211-scixye6rbbvc078l
Tags: 2.33-0ubuntu2, upstream-2.33
releasing version 2.33-0ubuntu2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/make -f
2
 
# -*- makefile -*-
3
2
 
4
 
# Uncomment this to turn on verbose mode.
5
3
#export DH_VERBOSE=1
6
 
 
7
 
CFLAGS = -Wall -g
8
 
 
9
 
# These are used for cross-compiling and for saving the configure script
10
 
# from having to guess our platform (since we know it already)
11
 
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
12
 
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
13
 
 
14
 
# DEB_BUILD_OPTIONS
15
 
################################################################################
16
 
 
17
 
# noop
18
 
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
19
 
 CFLAGS += -O0
20
 
else
21
 
 CFLAGS += -O2
22
 
endif
23
 
 
24
 
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
25
 
 CFLAGS += --ggdb3
26
 
endif
27
 
 
28
 
# parallel
29
 
ifneq (,$(findstring parallel,$(DEB_BUILD_OPTIONS)))
30
 
 TRANSMISSION_MAKEFLAGS += -j$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
31
 
endif
32
 
 
33
 
# nostrip is handled by dh_strip
34
 
 
35
 
################################################################################
36
 
 
37
 
config: config-stamp
38
 
config-stamp:
39
 
        dh_testdir
40
 
 
41
 
        if [ -r /usr/share/misc/config.sub ] && [ ! -f config.sub.backup ]; then \
42
 
                mv -v config.sub config.sub.backup; \
43
 
                cp -f /usr/share/misc/config.sub $(CURDIR)/config.sub; \
44
 
        fi
45
 
 
46
 
        if [ -r /usr/share/misc/config.guess ] && [ ! -f config.guess.backup ]; then \
47
 
                mv -v config.guess config.guess.backup; \
48
 
                cp -f /usr/share/misc/config.guess $(CURDIR)/config.guess; \
49
 
        fi
50
 
 
51
 
        touch $@
52
 
 
53
 
config-clean:
54
 
        dh_testdir
55
 
        dh_testroot
56
 
 
57
 
        if [ -f config.sub.backup ]; then \
58
 
                mv -fv config.sub.backup config.sub; \
59
 
        fi
60
 
 
61
 
        if [ -f config.guess.backup ]; then \
62
 
                mv -fv config.guess.backup config.guess; \
63
 
        fi
64
 
 
65
 
        $(RM) config-stamp
66
 
 
67
 
configure: configure-stamp
68
 
configure-stamp:
69
 
        dh_testdir
70
 
        dh_autoreconf
71
 
 
72
 
        ./configure \
73
 
                --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
74
 
                --prefix=/usr \
75
 
                --mandir=/usr/share/man \
76
 
                CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs,--as-needed"
77
 
 
78
 
        # Qt client
79
 
        ( cd qt && qmake-qt4 qtr.pro )
80
 
 
81
 
        touch $@
82
 
 
83
 
build: config build-stamp
84
 
build-stamp: configure
85
 
        dh_testdir
86
 
 
87
 
        $(MAKE) $(TRANSMISSION_MAKEFLAGS)
88
 
        cd po; intltool-update -p --verbose
89
 
        # Qt client
90
 
        ( cd qt && $(MAKE) )
91
 
 
92
 
        touch $@
93
 
 
94
 
distclean:
95
 
#       # touch config.status to prevent execution of autoconf
96
 
        [ ! -f Makefile ] || ( touch config.status && $(MAKE) distclean )
97
 
 
98
 
clean: config-clean distclean
99
 
        dh_testdir
100
 
        dh_testroot
101
 
        
102
 
        # QT client
103
 
        [ ! -f qt/Makefile ] || ( cd qt && $(MAKE) clean )
104
 
        
105
 
        dh_clean 
106
 
 
107
 
install: build
108
 
        dh_testdir
109
 
        dh_testroot
110
 
        dh_prep
111
 
        dh_installdirs
112
 
 
113
 
        $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
114
 
 
115
 
        # Qt client
116
 
        ( cd qt && INSTALL_ROOT=$(CURDIR)/debian/tmp/usr $(MAKE) install )
117
 
 
118
 
#       # clean RPATH from transmission binary (costela - 2007-10-27)
119
 
        chrpath -d $(CURDIR)/debian/tmp/usr/bin/transmission
120
 
        chrpath -d $(CURDIR)/debian/tmp/usr/bin/transmission-daemon
121
 
        chrpath -d $(CURDIR)/debian/tmp/usr/bin/transmission-remote
122
 
        chrpath -d $(CURDIR)/debian/tmp/usr/bin/transmissioncli
123
 
 
124
 
UPSTREAM_VERSION=$(shell dpkg-parsechangelog | perl -ne '{ print $$1."\n" if /Version: (.*)-.*/; }')
125
 
 
126
 
get-orig-source:
127
 
        [ ! -f transmission-$(UPSTREAM_VERSION).tar.bz2 ] \
128
 
                && wget http://download.m0k.org/transmission/files/transmission-$(UPSTREAM_VERSION).tar.bz2
129
 
 
130
 
# Build architecture-independent files here.
131
 
binary-indep: build install
132
 
        dh_testdir
133
 
        dh_testroot
134
 
        dh_link -i
 
4
LDFLAGS=-Wl,--as-needed,--no-undefined,--no-add-needed
 
5
 
 
6
%:
 
7
        dh $@ --with autotools-dev --with autoreconf
 
8
 
 
9
override_dh_auto_configure:
 
10
        dh_auto_configure -- \
 
11
                --enable-libappindicator --enable-notify
 
12
        # qt client has a separate build-system
 
13
        dh_auto_configure -Dqt
 
14
 
 
15
override_dh_auto_build:
 
16
        dh_auto_build
 
17
        dh_auto_build -Dqt
 
18
        (cd qt && lrelease qtr.pro)
 
19
 
 
20
override_dh_auto_clean:
 
21
        dh_auto_clean
 
22
        dh_auto_clean -Dqt
 
23
        rm -f qt/translations/*.qm
 
24
 
 
25
override_dh_installchangelogs:
135
26
        dh_installchangelogs -p transmission-common NEWS
 
27
override_dh_installdocs:
136
28
        dh_installdocs -p transmission-common
 
29
override_dh_installexamples:
137
30
        dh_installexamples -p transmission-common
138
 
        dh_install -i -X LICENSE # extra copy in web dir - costela 2008-08-15
139
 
        dh_compress -i
140
 
        dh_fixperms -i
141
 
        dh_installdeb -i
142
 
        dh_gencontrol -i
143
 
        dh_md5sums -i
144
 
        dh_builddeb -i
145
 
 
146
 
# Build architecture-dependent files here.
147
 
binary-arch: build install
148
 
        dh_testdir
149
 
        dh_testroot
150
 
        dh_link -a
151
 
        dh_installinit -a
152
 
        dh_installmenu -a
153
 
        dh_installman -a
154
 
        dh_installmime -a
155
 
        dh_install --list-missing -a
156
 
        dh_icons -a
157
 
        dh_strip -a
158
 
        dh_compress -a
159
 
        dh_fixperms -a
160
 
        dh_installdeb -a
161
 
        dh_shlibdeps -a
162
 
        dh_gencontrol -a
163
 
        dh_md5sums -a
164
 
        dh_builddeb -a
165
 
 
166
 
binary: binary-indep binary-arch
167
 
.PHONY: config config-clean configure build clean binary-indep binary-arch binary install
 
31
 
 
32
override_dh_install:
 
33
        dh_install --list-missing -X LICENSE # extra copy in web dir - costela 2008-08-15
 
34
 
 
35
override_dh_auto_install:
 
36
        dh_auto_install
 
37
        dh_auto_install -Dqt -- INSTALL_ROOT=$(CURDIR)/debian/tmp/usr
 
38
 
 
39
override_dh_strip:
 
40
        dh_strip --dbg-package=transmission-dbg