~ubuntu-branches/ubuntu/karmic/iaxmodem/karmic

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Bazaar Package Importer
  • Author(s): Julien BLACHE
  • Date: 2006-06-12 17:49:03 UTC
  • Revision ID: james.westby@ubuntu.com-20060612174903-k5nzvmdzrcgzh1bn
Tags: 0.1.9.dfsg-1
* New upstream release.
* debian/patches/11_iax2_CORE-2006-0327.dpatch:
  + Removed; merged upstream.
* debian/patches/11_build_configure-stamp.dpatch:
  + Added; do not build libraries if configure-stamp exists (debian/rules
    takes care of that).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/make -f
 
2
# -*- makefile -*-
 
3
# Sample debian/rules that uses debhelper.
 
4
# This file was originally written by Joey Hess and Craig Small.
 
5
# As a special exception, when this file is copied by dh-make into a
 
6
# dh-make output file, you may use that output file without restriction.
 
7
# This special exception was added by Craig Small in version 0.37 of dh-make.
 
8
 
 
9
# Uncomment this to turn on verbose mode.
 
10
#export DH_VERBOSE=1
 
11
 
 
12
# Include dpatch rules
 
13
include /usr/share/dpatch/dpatch.make
 
14
 
 
15
# These are used for cross-compiling and for saving the configure script
 
16
# from having to guess our platform (since we know it already)
 
17
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 
18
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 
19
 
 
20
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
 
21
  confflags += --build $(DEB_HOST_GNU_TYPE)
 
22
else
 
23
  confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
 
24
endif
 
25
 
 
26
 
 
27
CFLAGS = -Wall -g
 
28
 
 
29
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
 
30
        CFLAGS += -O0
 
31
else
 
32
        CFLAGS += -O2
 
33
endif
 
34
 
 
35
DEBVERSION:=$(shell head -n 1 debian/changelog \
 
36
                    | sed -e 's/^[^(]*(\([^)]*\)).*/\1/')
 
37
UPVERSION:=$(shell echo $(DEBVERSION) | sed -e 's/^.*://' -e 's/-[0-9.]*$$//' -e 's/.dfsg$$//')
 
38
 
 
39
FILENAME := iaxmodem_$(UPVERSION).dfsg.orig.tar.gz
 
40
UPFILENAME := iaxmodem_$(UPVERSION).orig.tar.gz
 
41
URL := http://switch.dl.sourceforge.net/iaxmodem/iaxmodem-$(UPVERSION).tar.gz
 
42
 
 
43
autotools-stamp:
 
44
        -rm -f ./lib/libiax2/config.sub ./lib/libiax2/config.guess
 
45
        ln -s /usr/share/misc/config.sub ./lib/libiax2/config.sub
 
46
        ln -s /usr/share/misc/config.guess ./lib/libiax2/config.guess
 
47
 
 
48
        -rm -f ./lib/spandsp/config/config.sub ./lib/spandsp/config/config.guess
 
49
        ln -s /usr/share/misc/config.sub ./lib/spandsp/config/config.sub
 
50
        ln -s /usr/share/misc/config.guess ./lib/spandsp/config/config.guess
 
51
 
 
52
        touch autotools-stamp
 
53
 
 
54
 
 
55
configure-stamp: autotools-stamp
 
56
        dh_testdir
 
57
 
 
58
        # Check that problematic files have been removed prior to packaging
 
59
        ( grep -q Debian lib/spandsp/src/spandsp/mmx.h && \
 
60
                [ ! -d lib/spandsp/src/msvc ] && [ ! -f lib/spandsp/libspandsp.vcproj ] && \
 
61
                [ ! -d lib/spandsp/autom4te.cache ] && [ ! -d lib/libiax2/autom4te.cache ] ) || \
 
62
                (echo "WARNING: sources are not clean!"; false)
 
63
 
 
64
        # Add here commands to configure the package.
 
65
        (cd lib/libiax2 && ./configure $(confflags) --disable-shared)
 
66
        (cd lib/spandsp && ./configure $(confflags) --disable-shared)
 
67
 
 
68
        touch configure-stamp
 
69
 
 
70
 
 
71
build: build-stamp
 
72
 
 
73
build-stamp: patch-stamp configure-stamp 
 
74
        dh_testdir
 
75
 
 
76
        # Add here commands to compile the package.
 
77
        $(MAKE) -C ./lib/libiax2
 
78
        $(MAKE) -C ./lib/spandsp
 
79
 
 
80
        ./build static
 
81
 
 
82
        touch build-stamp
 
83
 
 
84
clean: real-clean unpatch
 
85
real-clean:
 
86
        dh_testdir
 
87
        dh_testroot
 
88
        rm -f build-stamp configure-stamp autotools-stamp
 
89
 
 
90
        # Add here commands to clean up after the build process.
 
91
        -$(MAKE) -C ./lib/libiax2 distclean
 
92
        -rm -f ./lib/libiax2/config.sub ./lib/libiax2/config.guess
 
93
        -$(MAKE) -C ./lib/spandsp distclean
 
94
        rm -rf ./lib/spandsp/autom4te.cache
 
95
        -rm -f ./lib/spandsp/config/config.sub ./lib/spandsp/config/config.guess
 
96
 
 
97
        -rm -f iaxmodem iaxmodem.o
 
98
 
 
99
        dh_clean 
 
100
 
 
101
install: build
 
102
        dh_testdir
 
103
        dh_testroot
 
104
        dh_clean -k 
 
105
        dh_installdirs
 
106
 
 
107
        # Add here commands to install the package into debian/iaxmodem.
 
108
        cp iaxmodem debian/iaxmodem/usr/bin
 
109
 
 
110
 
 
111
# Build architecture-independent files here.
 
112
binary-indep: build install
 
113
# We have nothing to do by default.
 
114
 
 
115
# Build architecture-dependent files here.
 
116
binary-arch: build install
 
117
        dh_testdir
 
118
        dh_testroot
 
119
        dh_installchangelogs CHANGES
 
120
        dh_installdocs
 
121
        dh_installexamples
 
122
#       dh_install
 
123
        dh_installlogrotate
 
124
        # start before hylafax (20), stop after hylafax (20) and before asterisk (21)
 
125
        dh_installinit -- defaults 19 20
 
126
        dh_installman iaxmodem.1
 
127
#       dh_link
 
128
        dh_strip
 
129
        dh_compress
 
130
        dh_fixperms
 
131
#       dh_makeshlibs
 
132
        dh_installdeb
 
133
        dh_shlibdeps
 
134
        dh_gencontrol
 
135
        dh_md5sums
 
136
        dh_builddeb
 
137
 
 
138
print-version:
 
139
        @@echo "Debian version:          $(DEBVERSION)"
 
140
        @@echo "Upstream version:        $(UPVERSION)"
 
141
 
 
142
get-orig-source:
 
143
        @@dh_testdir
 
144
        @@[ -d ../tarballs/. ]||mkdir -p ../tarballs
 
145
        @@echo Downloading $(UPFILENAME) from $(URL) ...
 
146
        @@wget -N -nv -T10 -t3 -O ../tarballs/$(UPFILENAME) $(URL)
 
147
        @@echo Repacking as DFSG-free...
 
148
        @@rm -rf ../tarballs/iaxmodem-$(UPVERSION).tmp
 
149
        @@mkdir -p ../tarballs/iaxmodem-$(UPVERSION).tmp/;cd ../tarballs/iaxmodem-$(UPVERSION).tmp && \
 
150
        tar xfz ../$(UPFILENAME) && \
 
151
        for file in lib/spandsp/src/spandsp/mmx.h lib/spandsp/src/msvc/\
 
152
          lib/spandsp/libspandsp.vcproj lib/libiax2/autom4te.cache/ \
 
153
          lib/spandsp/autom4te.cache/ lib/spandsp/config/config.sub \
 
154
          lib/spandsp/config/config.guess lib/libiax2/config.sub \
 
155
          lib/libiax2/config.guess lib/libiax2/CVS lib/libiax2/src/CVS; do rm -rf iaxmodem-$(UPVERSION)/$$file; done && \
 
156
        tar cfz ../$(FILENAME) *
 
157
        @@echo Cleaning up...
 
158
        @@$(RM) -rf ../tarballs/iaxmodem-$(UPVERSION).tmp
 
159
 
 
160
binary: binary-indep binary-arch
 
161
.PHONY: build clean binary-indep binary-arch binary install patch unpatch real-clean