[svn-inject] Applying Debian modifications (1:0.9.4+r4100.20090929-0.1) to trunk
[debian/madwifi.git] / debian / rules
1 #!/usr/bin/make -f
2
3 # Uncomment this to turn on verbose mode.
4 #export DH_VERBOSE=1
5
6 include /usr/share/quilt/quilt.make
7
8 build: build-stamp
9 build-stamp: $(QUILT_STAMPFN)
10         dh_testdir
11         touch $@
12
13 clean: unpatch
14         dh_testdir
15         dh_testroot
16         dh_clean build-stamp
17
18 install: build
19         dh_testdir
20         dh_testroot
21         dh_clean -k
22         
23         install -D -m 0755 debian/rules.modules \
24                 debian/tmp/modules/madwifi/debian/rules
25         
26         for f in *.modules.in control compat copyright changelog; do \
27                 install -m 0644 debian/$$f \
28                         debian/tmp/modules/madwifi/debian/; \
29         done
30         
31         find . -path ./debian/\* -type d -prune -o -printf "%P\n" | \
32                 egrep -v 'debian|contrib|regression|\.svn|\.pc|*-stamp' | \
33                 cpio -admp debian/tmp/modules/madwifi/
34         
35         mkdir -p debian/madwifi-source/usr/src/
36         tar jcf debian/madwifi-source/usr/src/madwifi.tar.bz2 \
37                 -C debian/tmp modules
38         
39 binary-arch:
40 # We have nothing to do by default.
41
42 binary-indep: build install
43         dh_testdir
44         dh_testroot
45         dh_install
46         dh_installdocs
47         dh_installchangelogs
48         dh_link
49         dh_compress
50         dh_fixperms
51         dh_installdeb
52         dh_gencontrol
53         dh_md5sums
54         dh_builddeb
55
56 binary: binary-indep binary-arch
57 .PHONY: build build-stamp clean install binary-indep binary-arch binary
58
59 DEBVERS := $(shell dpkg-parsechangelog | sed -n 's/^Version: .*:\(.*\)-.*/\1/p')
60 UPSVERS := $(shell echo $(DEBVERS) | cut -d'+' -f1 | tr '~' '-')
61 SVNVERS := $(shell echo $(DEBVERS) | sed -n 's/.*+\(.*\)/\1/p' | tr '.' '-')
62 ifneq "$(SVNVERS)" ""
63 #ORIGTAR := madwifi-trunk-$(SVNVERS).tar.gz
64 ORIGTAR := madwifi-hal-0.10.5.6-$(SVNVERS).tar.gz
65 #ORIGURL := http://snapshots.madwifi.org/madwifi-trunk/
66 ORIGURL := http://snapshots.madwifi.org/madwifi-hal-0.10.5.6/
67 else
68 ORIGTAR := madwifi-$(UPSVERS).tar.gz
69 ORIGURL := http://optusnet.dl.sourceforge.net/sourceforge/madwifi/
70 endif
71 DEBTAR := madwifi_$(DEBVERS).orig.tar.gz
72
73 get-orig-source:
74         @dh_testdir
75         
76         @test -d ../tarballs || mkdir -p ../tarballs
77         @wget -c -O ../tarballs/$(DEBTAR) $(ORIGURL)$(ORIGTAR)