Prevent Debian package upgrades from prompting.
[sliver-openvswitch.git] / debian / rules
index 238414f..539c8f3 100755 (executable)
@@ -25,6 +25,13 @@ MA_DIR ?= /usr/share/modass
 # load default rules
 -include $(MA_DIR)/include/common-rules.make
 
+-include debian/rules.ext
+
+DATAPATH_CONFIGURE_OPTS = --enable-snat
+
+# Official build number.  Leave set to 0 if not an official build.
+BUILD_NUMBER = 0
+
 configure: configure-stamp
 configure-stamp:
        dh_testdir
@@ -33,7 +40,9 @@ configure-stamp:
        cd _debian && ( \
                test -e Makefile || \
                ../configure --prefix=/usr --localstatedir=/var --enable-ssl \
-                       --enable-snat)
+                       --with-build-number=$(BUILD_NUMBER) \
+                       $(DATAPATH_CONFIGURE_OPTS))
+       $(ext_configure)
        touch configure-stamp
 
 #Architecture 
@@ -42,11 +51,13 @@ build: build-arch build-indep
 build-arch: build-arch-stamp
 build-arch-stamp: configure-stamp 
        $(MAKE) -C _debian
+       $(ext_build_arch)
        touch $@
 
 build-indep: build-indep-stamp
 build-indep-stamp: configure-stamp 
        $(MAKE) -C _debian dist distdir=openflow
+       $(ext_build_indep)
        touch $@
 
 clean:
@@ -55,6 +66,7 @@ clean:
        rm -f build-arch-stamp build-indep-stamp configure-stamp
        rm -rf _debian
        [ ! -f Makefile ] || $(MAKE) distclean
+       $(ext_clean)
        dh_clean 
        debconf-updatepo
 
@@ -81,7 +93,7 @@ binary-modules: prep-deb-files
        dh_testroot
        dh_clean -k
        tar xzf openflow.tar.gz
-       cd openflow && ./configure --with-$(l2x)=$(KSRC)
+       cd openflow && ./configure --with-$(l2x)=$(KSRC) $(DATAPATH_CONFIGURE_OPTS) --with-build-number=$(BUILD_NUMBER)
        cd openflow && $(MAKE) -C $(dpdir)
        install -d -m755 $(DSTDIR)
        install -m644 openflow/$(dpdir)/*_mod.$(KO)o $(DSTDIR)/
@@ -90,22 +102,21 @@ binary-modules: prep-deb-files
        dh_compress
        dh_fixperms
        dh_installdeb
-       dh_gencontrol -- -v$(VERSION)
+       dh_gencontrol
        dh_md5sums
        dh_builddeb --destdir=$(DEB_DESTDIR)
 
 install: install-indep install-arch
-install-indep: MODDIR = $(CURDIR)/debian/openflow-datapath-source/usr/src/modules/openflow-datapath
 install-indep: build-indep
        dh_testdir
        dh_testroot
        dh_clean -k -i 
        dh_installdirs -i
-       cp _debian/openflow.tar.gz $(MODDIR)
-       cd debian; cp changelog control compat *.modules.in rules $(MODDIR)/debian
-       cd debian/openflow-datapath-source/usr/src && tar -c modules | bzip2 -9 > openflow-datapath.tar.bz2 && rm -rf modules
-       install -m644 debian/openflow-pki.apache2 debian/openflow-pki/etc/apache2/sites-available/openflow-pki
        dh_install -i
+       cd debian/openflow-datapath-source/usr/src && tar -c modules | bzip2 -9 > openflow-datapath.tar.bz2 && rm -rf modules
+       install -m644 debian/openflow-pki-server.apache2 debian/openflow-pki-server/etc/apache2/sites-available/openflow-pki
+       install -m1777 -d debian/corekeeper/var/log/core
+       $(ext_install_indep)
 
 install-arch: build-arch
        dh_testdir
@@ -113,8 +124,10 @@ install-arch: build-arch
        dh_clean -k -s 
        dh_installdirs -s
        $(MAKE) -C _debian DESTDIR=$(CURDIR)/debian/openflow install
-       cp debian/openflow-switch.overrides debian/openflow-switch/usr/share/lintian/overrides/openflow-switch
+       cp debian/openflow-switch-config.overrides debian/openflow-switch-config/usr/share/lintian/overrides/openflow-switch-config
+       cp debian/openflow-switch.template debian/openflow-switch/usr/share/openflow/switch/default.template
        dh_install -s
+       $(ext_install_arch)
 
 # Must not depend on anything. This is to be called by
 # binary-arch/binary-indep
@@ -126,13 +139,14 @@ binary-common:
        dh_installdocs
        dh_installexamples
        dh_installdebconf
-#      dh_installlogrotate
+       dh_installlogrotate
        dh_installinit
+       dh_installcron
        dh_installman
        dh_link
-       dh_strip
+       dh_strip --dbg-package=openflow-dbg
        dh_compress 
-       dh_fixperms
+       dh_fixperms -X var/log/core
        dh_perl
        dh_makeshlibs
        dh_installdeb