Merged r9881:9917 from jcorgan/deb-wip into trunk. Updates Debian/Ubuntu packaging...
[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 CFLAGS = -Wall -g
10
11 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
12         CFLAGS += -O0
13 else
14         CFLAGS += -O2
15 endif
16
17 clean:
18         dh_testdir
19         dh_testroot
20         rm -f build-stamp configure-stamp extract-stamp install-stamp
21
22         if [ -f Makefile ]; \
23         then\
24                 if [ -d .svn ]; \
25                 then \
26                         $(MAKE) maintainer-clean; \
27                 else \
28                         $(MAKE) distclean; \
29                 fi; \
30         fi
31
32         dh_clean
33
34 update:
35         dh_testdir
36         -test -r /usr/share/misc/config.sub && \
37                 cp -f /usr/share/misc/config.sub config.sub
38         -test -r /usr/share/misc/config.guess && \
39                 cp -f /usr/share/misc/config.guess config.guess
40
41 configure: configure-stamp
42 configure-stamp:
43         dh_testdir
44         [ -f ./configure ] || ./bootstrap
45         CFLAGS="$(CFLAGS)" ./configure \
46                 --prefix=/usr --mandir=\$${prefix}/share/man \
47                 --infodir=\$${prefix}/share/info --enable-shared \
48                 --enable-doxygen --enable-html-docs \
49                 --sysconfdir=/etc --enable-all-components \
50                 --disable-gr-audio-osx --disable-gr-audio-windows \
51                 --disable-gr-qtgui --disable-gcell --disable-gr-gcell \
52                 --disable-gr-comedi --disable-usrp2-firmware
53         touch configure-stamp
54
55 extract: extract-stamp
56 extract-stamp: configure-stamp debian/gen-install-files.sh
57         dh_testdir
58         debian/gen-install-files.sh 
59         touch $@
60
61 build: build-stamp
62 build-stamp: extract-stamp
63
64         $(MAKE) 
65         $(MAKE) check
66         touch $@
67
68 install: install-stamp
69 install-stamp: build-stamp
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         dh_install --sourcedir=debian/tmp
89         touch $@
90
91
92 # Must not depend on anything. This is to be called by
93 # binary-arch/binary-indep
94 # in another 'make' thread.
95 binary-common:
96         dh_testdir
97         dh_testroot
98         dh_installchangelogs ChangeLog
99         dh_installdocs
100         dh_pycentral
101         dh_link
102         dh_strip
103         dh_compress 
104         dh_fixperms
105         dh_makeshlibs
106         dh_installdeb
107         dh_shlibdeps
108         dh_gencontrol
109         dh_md5sums
110         dh_builddeb
111
112 # Build architecture independant packages using the common target.
113 binary-indep: build install
114         $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
115
116 # Build architecture dependant packages using the common target.
117 binary-arch: build install
118         $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
119
120 binary: binary-arch binary-indep
121 .PHONY: build clean binary-indep binary-arch binary install configure