3a4b1692ca0ddd75ea2dde5851df8ee1376edf98
[debian/gnuradio] / debian / rules
1 #!/usr/bin/make -f
2
3 # Uncomment this to turn on verbose mode.
4 export DH_VERBOSE=1
5
6 # This has to be exported to make some magic below work.
7 export DH_OPTIONS
8
9 export DH_PYCENTRAL=nomove
10
11 DEB_BUILD_GNU_TYPE = $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
12
13 clean:
14         dh_testdir
15         dh_testroot
16         rm -f build-stamp configure-stamp extract-stamp install-stamp
17
18         if [ -f Makefile ]; \
19         then\
20                 if [ -d .svn ]; \
21                 then \
22                         $(MAKE) maintainer-clean; \
23                 else \
24                         $(MAKE) distclean; \
25                 fi; \
26         fi
27
28         dh_clean
29
30 update:
31         dh_testdir
32         -test -r /usr/share/misc/config.sub && \
33                 cp -f /usr/share/misc/config.sub config.sub
34         -test -r /usr/share/misc/config.guess && \
35                 cp -f /usr/share/misc/config.guess config.guess
36
37 configure: configure-stamp
38 configure-stamp:
39         dh_testdir
40         [ -f ./configure ] || ./bootstrap
41         ./configure \
42                 --build=$(DEB_BUILD_GNU_TYPE) \
43                 --prefix=/usr \
44                 --mandir=\$${prefix}/share/man \
45                 --infodir=\$${prefix}/share/info \
46                 --enable-shared \
47                 --sysconfdir=/etc \
48                 --enable-all-components \
49                 --disable-gr-audio-osx \
50                 --disable-gr-audio-windows \
51                 --disable-gcell --disable-gr-gcell \
52                 --disable-gr-comedi --disable-usrp2-firmware 
53         touch configure-stamp
54
55 build: build-stamp
56 build-stamp: configure-stamp
57
58         $(MAKE)
59         $(MAKE) check
60         touch $@
61
62 extract: extract-stamp
63 extract-stamp: build-stamp debian/gen-install-files.sh
64         dh_testdir
65         chmod +x debian/gen-install-files.sh dtools/bin/extract_install_filenames
66         debian/gen-install-files.sh
67         touch $@
68
69 install: install-stamp
70 install-stamp: extract-stamp debian/control
71         dh_testdir
72         dh_testroot
73         dh_clean -k
74         dh_installdirs
75
76         $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
77         : # make python scripts starting with '#!' executable
78         for i in `find debian -mindepth 2 -type f ! -perm 755`; do \
79           if head -1 $$i | grep -q '^#!'; then \
80             chmod 755 $$i; \
81             echo "made executable: $$i"; \
82           fi; \
83         done
84
85         : # Deposit rule to allow group 'usrp' access to USRP hardware
86         install -m 0644 -D debian/libusrp0.udev \
87                 debian/tmp/etc/udev/rules.d/40-usrp.rules
88
89         : # Deposit rule to allow group 'usrp' access to USRP2 hardware
90         install -m 0644 -D debian/libusrp2-0.limits \
91                 debian/tmp/etc/security/limits.d/libusrp2-0.limits
92
93         : # Install custom grc.conf
94         install -m 0644 -D debian/grc.conf \
95                 debian/tmp/etc/gnuradio/conf.d/grc.conf
96
97         : # Install custom prefs.py FIXME
98         install -m 0644 -D debian/prefs.py \
99                 debian/tmp/usr/lib/python2.6/dist-packages/gnuradio/gr/prefs.py
100
101         dh_install --sourcedir=debian/tmp
102         touch $@
103
104
105
106 # Must not depend on anything. This is to be called by
107 # binary-arch/binary-indep
108 # in another 'make' thread.
109 binary-common:
110         dh_testdir
111         dh_testroot
112         dh_installchangelogs ChangeLog
113         dh_installdocs
114         dh_pycentral
115         dh_link
116         dh_strip
117         dh_compress 
118         dh_fixperms
119         dh_makeshlibs
120         dh_installdeb
121         dh_shlibdeps
122         dh_gencontrol
123         dh_md5sums
124         dh_builddeb
125
126 # Build architecture independant packages using the common target.
127 binary-indep: build install
128         $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
129
130 # Build architecture dependant packages using the common target.
131 binary-arch: build install
132         $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
133
134 binary: binary-arch binary-indep
135 .PHONY: build clean binary-indep binary-arch binary install configure