chasing lintian complaints
[debian/gnuradio] / debian / rules
index 2e358f01e0c5309a082fa1804b0f7d38e2d657a6..b9c92f080d96fe0ab32dde5a84784d806936ef74 100755 (executable)
@@ -1,14 +1,4 @@
 #!/usr/bin/make -f
-# -*- makefile -*-
-# Sample debian/rules that uses debhelper.
-#
-# This file was originally written by Joey Hess and Craig Small.
-# As a special exception, when this file is copied by dh-make into a
-# dh-make output file, you may use that output file without restriction.
-# This special exception was added by Craig Small in version 0.37 of dh-make.
-#
-# Modified to make a template file for a multi-binary package with separated
-# build-arch and build-indep targets  by Bill Allombert 2001
 
 # Uncomment this to turn on verbose mode.
 export DH_VERBOSE=1
@@ -16,58 +6,79 @@ export DH_VERBOSE=1
 # This has to be exported to make some magic below work.
 export DH_OPTIONS
 
-CFLAGS = -Wall -g
+export DH_PYCENTRAL=nomove
 
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
-       CFLAGS += -O0
-else
-       CFLAGS += -O2
-endif
+DEB_BUILD_GNU_TYPE = $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+
+clean:
+       dh_testdir
+       dh_testroot
+       rm -f build-stamp configure-stamp extract-stamp install-stamp
+
+       # Remove (possibly stale) pre-built Qt-generated moc files; they will
+       # be rebuilt using the current Qt moc.  Perhaps this should actually be
+       # part of 'make distclean' and these files not be distributed:
+       rm -f ./gr-qtgui/src/lib/*_moc.cc
+
+       if [ -f Makefile ]; \
+       then\
+               if [ -d .svn ]; \
+               then \
+                       $(MAKE) maintainer-clean; \
+               else \
+                       $(MAKE) distclean; \
+               fi; \
+       fi
+
+       dh_clean
+
+update:
+       dh_testdir
+       -test -r /usr/share/misc/config.sub && \
+               cp -f /usr/share/misc/config.sub config.sub
+       -test -r /usr/share/misc/config.guess && \
+               cp -f /usr/share/misc/config.guess config.guess
 
 configure: configure-stamp
 configure-stamp:
        dh_testdir
-# running bootstrap shouldn't be necessary when working from released tarballs
-#      ./bootstrap
-       CFLAGS="$(CFLAGS)" ./configure \
-               --prefix=/usr --mandir=\$${prefix}/share/man \
-               --infodir=\$${prefix}/share/info --enable-shared \
-               --enable-doxygen --enable-html-docs \
-               --sysconfdir=/etc --enable-all-components \
-               --disable-gr-audio-osx --disable-gr-audio-windows
+       [ -f ./configure ] || ./bootstrap
+       ./configure \
+               --build=$(DEB_BUILD_GNU_TYPE) \
+               --prefix=/usr \
+               --mandir=\$${prefix}/share/man \
+               --infodir=\$${prefix}/share/info \
+               --enable-shared \
+               --sysconfdir=/etc \
+               --enable-all-components \
+               --disable-gr-audio-osx \
+               --disable-gr-audio-windows \
+               --disable-gcell --disable-gr-gcell \
+               --disable-gr-comedi --disable-usrp2-firmware 
        touch configure-stamp
 
 build: build-stamp
-build-stamp: configure-stamp 
+build-stamp: configure-stamp
 
-       $(MAKE) 
+       $(MAKE)
        $(MAKE) check
        touch $@
 
-clean:
+extract: extract-stamp
+extract-stamp: build-stamp debian/gen-install-files.sh
        dh_testdir
-       dh_testroot
-       rm -f build-stamp configure-stamp
-
-       -$(MAKE) distclean
-
-       -test -r /usr/share/misc/config.sub && \
-               cp -f /usr/share/misc/config.sub config.sub
-       -test -r /usr/share/misc/config.guess && \
-               cp -f /usr/share/misc/config.guess config.guess
-
-       dh_clean  --exclude ./gr-gsm-fr-vocoder/src/lib/gsm/README.orig
+       chmod +x debian/gen-install-files.sh dtools/bin/extract_install_filenames
+       debian/gen-install-files.sh
+       touch $@
 
-install:
+install: install-stamp
+install-stamp: extract-stamp debian/control
        dh_testdir
        dh_testroot
        dh_clean -k
        dh_installdirs
 
        $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
-       install -m 0755 debian/usrp.hotplug \
-               $(CURDIR)/debian/usrp/etc/hotplug.d/usb/
-
        : # make python scripts starting with '#!' executable
        for i in `find debian -mindepth 2 -type f ! -perm 755`; do \
          if head -1 $$i | grep -q '^#!'; then \
@@ -76,21 +87,22 @@ install:
          fi; \
        done
 
-       dh_install --sourcedir=debian/tmp --list-missing
+       : # Deposit rule to allow group 'usrp' access to USRP hardware
+       install -m 0644 -D debian/libusrp0.udev \
+               debian/tmp/lib/udev/rules.d/40-usrp.rules
+
+       : # Deposit rule to allow group 'usrp' access to USRP2 hardware
+       install -m 0644 -D debian/libusrp2-0.limits \
+               debian/tmp/etc/security/limits.d/libusrp2-0.limits
 
-       cp -r gnuradio-examples/python/* \
-               debian/gnuradio-examples/usr/share/gnuradio/
-       find debian/gnuradio-examples -type f -name Makefile\* -exec rm {} \;
-       find debian/gnuradio-examples -type d -name CVS -exec rm {} \;
-       find debian/gnuradio-examples -name \*.py -exec chmod +x {} \;
+       : # Install custom grc.conf
+       install -m 0644 -D debian/grc.conf \
+               debian/tmp/etc/gnuradio/conf.d/grc.conf
+
+       dh_install --sourcedir=debian/tmp
+       touch $@
 
-       mv debian/gnuradio/usr/bin/microtune.py \
-               debian/gnuradio/usr/bin/microtune
 
-       mv debian/usrp/usr/bin/usrp_ra_receiver.py \
-               debian/usrp/usr/bin/usrp_ra_receiver
-       mv debian/usrp/usr/bin/usrp_psr_receiver.py \
-               debian/usrp/usr/bin/usrp_psr_receiver
 
 # Must not depend on anything. This is to be called by
 # binary-arch/binary-indep
@@ -100,33 +112,11 @@ binary-common:
        dh_testroot
        dh_installchangelogs ChangeLog
        dh_installdocs
-       dh_installexamples
-#      dh_installmenu
-#      dh_installdebconf       
-#      dh_installlogrotate     
-#      dh_installemacsen
-#      dh_installpam
-#      dh_installmime
        dh_pycentral
-       dh_python
-#      dh_installinit
-#      dh_installcron
-#      dh_installinfo
-       dh_installman
        dh_link
-ifneq (,$(findstring -s,$(DH_OPTIONS)))
-       dh_strip --no-package=libgnuradio-core0c2a --no-package=libusrp0c2a
-       DH_OPTIONS= dh_strip --package=libgnuradio-core0c2a \
-               --dbg-package=libgnuradio-core0c2a-dbg
-       DH_OPTIONS= dh_strip --package=libusrp0c2a \
-               --dbg-package=libusrp0c2a-dbg
-else
        dh_strip
-endif
        dh_compress 
-#      dh_movefiles --sourcedir=debian/gnuradio
        dh_fixperms
-#      dh_perl
        dh_makeshlibs
        dh_installdeb
        dh_shlibdeps