meta-flow: Correctly set destination MAC in mf_set_flow_value().
[sliver-openvswitch.git] / debian / rules
index 1773cc7..7e10c63 100755 (executable)
@@ -15,7 +15,7 @@ BUILD_NUMBER = 0
 
 PACKAGE=openvswitch
 pdkms=openvswitch-datapath-dkms
-DEB_UPSTREAM_VERSION=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^-]+).*,\1,p')
+DEB_UPSTREAM_VERSION=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([0-9]:)*([^-]+).*,\2,p')
 srcfiles := $(filter-out debian, $(wildcard * .[^.]*))
 
 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
@@ -31,6 +31,12 @@ else
 CFLAGS += -O2
 endif
 
+ifeq ($(BUILD_NUMBER),0)
+BUILD_NUMBER_OPTION =
+else
+BUILD_NUMBER_OPTION = --with-build-number=$(BUILD_NUMBER)
+endif
+
 configure: configure-stamp
 configure-stamp:
        dh_testdir
@@ -41,7 +47,7 @@ configure-stamp:
        cd _debian && ( \
                test -e Makefile || \
                ../configure --prefix=/usr --localstatedir=/var --enable-ssl \
-                       --sysconfdir=/etc --with-build-number=$(BUILD_NUMBER) \
+                       --sysconfdir=/etc $(BUILD_NUMBER_OPTION) \
                        CFLAGS="$(CFLAGS)" $(DATAPATH_CONFIGURE_OPTS))
        touch configure-stamp
 
@@ -97,6 +103,16 @@ install-indep: build-indep
        # Prepare dkms.conf from the dkms.conf.in template
        sed "s/__VERSION__/$(DEB_UPSTREAM_VERSION)/g" debian/dkms.conf.in > debian/$(pdkms)/usr/src/$(PACKAGE)-$(DEB_UPSTREAM_VERSION)/dkms.conf
 
+       # We don't need the debian folder in there, just upstream sources...
+       rm -rf debian/$(pdkms)/usr/src/$(PACKAGE)-$(DEB_UPSTREAM_VERSION)/debian
+       # We don't need the rhel stuff in there either
+       rm -rf debian/$(pdkms)/usr/src/$(PACKAGE)-$(DEB_UPSTREAM_VERSION)/rhel
+       # And we should also clean useless license files, which are already
+       # descriped in our debian/copyright anyway.
+       rm -f debian/$(pdkms)/usr/src/$(PACKAGE)-$(DEB_UPSTREAM_VERSION)/COPYING \
+               debian/$(pdkms)/usr/src/$(PACKAGE)-$(DEB_UPSTREAM_VERSION)/ovsdb/ovsdbmonitor/COPYING \
+               debian/$(pdkms)/usr/src/$(PACKAGE)-$(DEB_UPSTREAM_VERSION)/xenserver/LICENSE
+
 install-arch: build-arch
        dh_testdir
        dh_testroot
@@ -117,10 +133,9 @@ binary-common:
        dh_installexamples
        dh_installdebconf
        dh_installlogrotate
-       dh_installinit -R -Nopenvswitch-switch
-       dh_installinit -R -popenvswitch-switch --error-handler=init_script_error
+       dh_installinit -R
        dh_installcron
-       dh_installman
+       dh_installman --language=C
        dh_link
        dh_strip --dbg-package=openvswitch-dbg
        dh_compress