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