Merged r6224:6268 from features/deb into trunk. Implements most of a Debian package...
[debian/gnuradio] / debian / rules
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3 # Sample debian/rules that uses debhelper.
4 #
5 # This file was originally written by Joey Hess and Craig Small.
6 # As a special exception, when this file is copied by dh-make into a
7 # dh-make output file, you may use that output file without restriction.
8 # This special exception was added by Craig Small in version 0.37 of dh-make.
9 #
10 # Modified to make a template file for a multi-binary package with separated
11 # build-arch and build-indep targets  by Bill Allombert 2001
12
13 # Uncomment this to turn on verbose mode.
14 export DH_VERBOSE=1
15
16 # This has to be exported to make some magic below work.
17 export DH_OPTIONS
18
19 CFLAGS = -Wall -g
20
21 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
22         CFLAGS += -O0
23 else
24         CFLAGS += -O2
25 endif
26
27 clean:
28         dh_testdir
29         dh_testroot
30         rm -f build-stamp configure-stamp
31
32         if [ -f Makefile ]; \
33         then\
34                 if [ -d .svn ]; \
35                 then \
36                         $(MAKE) maintainer-clean; \
37                 else \
38                         $(MAKE) distclean; \
39                 fi; \
40         fi
41
42         dh_clean
43
44 update:
45         dh_testdir
46         -test -r /usr/share/misc/config.sub && \
47                 cp -f /usr/share/misc/config.sub config.sub
48         -test -r /usr/share/misc/config.guess && \
49                 cp -f /usr/share/misc/config.guess config.guess
50
51 configure: configure-stamp
52 configure-stamp:
53         dh_testdir
54         [ -f ./configure ] || ./bootstrap
55         CFLAGS="$(CFLAGS)" ./configure \
56                 --prefix=/usr --mandir=\$${prefix}/share/man \
57                 --infodir=\$${prefix}/share/info --enable-shared \
58                 --enable-doxygen --enable-html-docs \
59                 --sysconfdir=/etc --enable-all-components \
60                 --disable-gr-audio-osx --disable-gr-audio-windows \
61                 --disable-gr-qtgui
62         touch configure-stamp
63
64 extract: extract-stamp
65 extract-stamp: configure-stamp
66         dh_testdir
67         debian/gen-install-files.sh 
68         touch $@
69
70 build: build-stamp
71 build-stamp: extract-stamp
72
73         $(MAKE) 
74         $(MAKE) check
75         touch $@
76
77 install: install-stamp
78 install-stamp: build-stamp
79         dh_testdir
80         dh_testroot
81         dh_clean -k
82         dh_installdirs
83
84         $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
85         : # make python scripts starting with '#!' executable
86         for i in `find debian -mindepth 2 -type f ! -perm 755`; do \
87           if head -1 $$i | grep -q '^#!'; then \
88             chmod 755 $$i; \
89             echo "made executable: $$i"; \
90           fi; \
91         done
92
93         dh_install --sourcedir=debian/tmp --list-missing
94
95 #       install -m 0755 debian/usrp.hotplug \
96 #               $(CURDIR)/debian/usrp/etc/hotplug.d/usb/
97
98 #       cp -r gnuradio-examples/python/* \
99 #               debian/gnuradio-examples/usr/share/gnuradio/
100 #       find debian/gnuradio-examples -type f -name Makefile\* -exec rm {} \;
101 #       find debian/gnuradio-examples -type d -name CVS -exec rm {} \;
102 #       find debian/gnuradio-examples -name \*.py -exec chmod +x {} \;
103
104 #       mv debian/gnuradio/usr/bin/microtune.py \
105 #               debian/gnuradio/usr/bin/microtune
106
107 #       mv debian/usrp/usr/bin/usrp_ra_receiver.py \
108 #               debian/usrp/usr/bin/usrp_ra_receiver
109 #       mv debian/usrp/usr/bin/usrp_psr_receiver.py \
110 #               debian/usrp/usr/bin/usrp_psr_receiver
111         touch $@
112
113
114 # Must not depend on anything. This is to be called by
115 # binary-arch/binary-indep
116 # in another 'make' thread.
117 binary-common:
118         dh_testdir
119         dh_testroot
120         dh_installchangelogs ChangeLog
121         dh_installdocs
122         dh_installexamples
123 #       dh_installmenu
124 #       dh_installdebconf       
125 #       dh_installlogrotate     
126 #       dh_installemacsen
127 #       dh_installpam
128 #       dh_installmime
129         dh_pycentral
130         dh_python
131 #       dh_installinit
132 #       dh_installcron
133 #       dh_installinfo
134         dh_installman
135         dh_link
136         dh_strip
137         dh_compress 
138 #       dh_movefiles --sourcedir=debian/gnuradio
139         dh_fixperms
140 #       dh_perl
141         dh_makeshlibs
142         dh_installdeb
143         dh_shlibdeps
144         dh_gencontrol
145         dh_md5sums
146         dh_builddeb
147
148 # Build architecture independant packages using the common target.
149 binary-indep: build install
150         $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
151
152 # Build architecture dependant packages using the common target.
153 binary-arch: build install
154         $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
155
156 binary: binary-arch binary-indep
157 .PHONY: build clean binary-indep binary-arch binary install configure