New upstream SVN snapshot.
[debian/madwifi.git] / debian / rules
1 #!/usr/bin/make -f
2
3 VERSION:=$(shell dpkg-parsechangelog|grep "^Version:"|cut -d" " -f2|rev|cut -d- -f2-|rev|cut -d':' -f2)
4 TMP=$(CURDIR)/debian/tmp
5
6 %:
7         dh $@ --with dkms
8
9 override_dh_clean:
10         dh_clean
11         $(RM) -r $(TMP)
12
13 override_dh_auto_build:
14         DESTDIR=$(CURDIR)/debian/madwifi-tools $(MAKE) -C $(CURDIR)/tools all
15
16 override_dh_auto_install:
17 ifneq (,$(findstring madwifi-source, $(shell dh_listpackages)))
18         # madwifi-source
19         install -D -m 0755 debian/rules.modules \
20                 $(TMP)/modules/madwifi/debian/rules
21
22         for f in *.modules.in control compat copyright changelog; do \
23                 install -m 0644 debian/$$f \
24                         $(TMP)/modules/madwifi/debian/; \
25         done
26
27         find . -path ./debian/\* -type d -prune -o -printf "%P\n" | \
28                 egrep -v 'debian|contrib|regression|tools|\.svn|\.pc|*-stamp' | \
29                 cpio -admp $(TMP)/modules/madwifi/
30
31         tar jcf debian/madwifi-source/usr/src/madwifi.tar.bz2 \
32                 -C $(TMP) modules
33
34         # madwifi-dkms
35         $(RM) -r $(TMP)/modules/madwifi/debian
36         mv $(TMP)/modules/madwifi debian/madwifi-dkms/usr/src/madwifi-$(VERSION)
37 endif
38
39         # madwifi-tools
40         DESTDIR=$(CURDIR)/debian/madwifi-tools BINDIR=/usr/sbin MANDIR=/usr/share/man \
41                 $(MAKE) -C $(CURDIR)/tools install
42         $(RM) $(CURDIR)/debian/madwifi-tools/usr/sbin/madwifi-unload
43         mv $(CURDIR)/debian/madwifi-tools/usr/sbin/wlanconfig $(CURDIR)/debian/madwifi-tools/sbin
44
45 override_dh_dkms:
46         dh_dkms -V $(VERSION)
47
48 override_dh_installmodules:
49         dh_installmodules -p madwifi-tools --name=madwifi
50
51 override_dh_installifupdown:
52         dh_installifupdown -p madwifi-tools --name=050madwifi
53         dh_installifupdown -p madwifi-tools --name=z50madwifi