6624bf1774a6535de03b57eef4114290754148dd
[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         debian/gen-install-files.sh 
66         touch $@
67
68 install: install-stamp
69 install-stamp: extract-stamp debian/control
70         dh_testdir
71         dh_testroot
72         dh_clean -k
73         dh_installdirs
74
75         $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
76         : # make python scripts starting with '#!' executable
77         for i in `find debian -mindepth 2 -type f ! -perm 755`; do \
78           if head -1 $$i | grep -q '^#!'; then \
79             chmod 755 $$i; \
80             echo "made executable: $$i"; \
81           fi; \
82         done
83
84         : # Deposit rule to allow group 'usrp' access to USRP hardware
85         install -m 0644 -D debian/libusrp.udev \
86                 debian/tmp/etc/udev/rules.d/40-usrp.rules
87
88         : # Deposit rule to allow group 'usrp' access to USRP2 hardware
89         install -m 0644 -D debian/libusrp2.limits \
90                 debian/tmp/etc/security/limits.d/libusrp2.limits
91
92         : # Install custom grc.conf
93         install -m 0644 -D debian/grc.conf \
94                 debian/tmp/etc/gnuradio/conf.d/grc.conf
95
96         : # Install custom prefs.py FIXME
97         install -m 0644 -D debian/prefs.py \
98                 debian/tmp/usr/lib/python2.6/dist-packages/gnuradio/gr/prefs.py
99
100         dh_install --sourcedir=debian/tmp
101         touch $@
102
103
104
105 # Must not depend on anything. This is to be called by
106 # binary-arch/binary-indep
107 # in another 'make' thread.
108 binary-common:
109         dh_testdir
110         dh_testroot
111         dh_installchangelogs ChangeLog
112         dh_installdocs
113         dh_pycentral
114         dh_link
115         dh_strip
116         dh_compress 
117         dh_fixperms
118         dh_makeshlibs
119         dh_installdeb
120         dh_shlibdeps
121         dh_gencontrol
122         dh_md5sums
123         dh_builddeb
124
125 # Build architecture independant packages using the common target.
126 binary-indep: build install
127         $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
128
129 # Build architecture dependant packages using the common target.
130 binary-arch: build install
131         $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
132
133 binary: binary-arch binary-indep
134 .PHONY: build clean binary-indep binary-arch binary install configure