]> git.proxmox.com Git - mirror_ovs.git/blame - debian/rules
ovn: Add missing netdev_close in setup_qos.
[mirror_ovs.git] / debian / rules
CommitLineData
064af421
BP
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
3d8deded 12#export DH_VERBOSE=1
064af421 13
49c57a8f 14PACKAGE=openvswitch
3d8deded 15PACKAGE_DKMS=openvswitch-datapath-dkms
455f38e0 16DEB_UPSTREAM_VERSION=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([0-9]+:)?([0-9][a-zA-Z0-9.+:~-]*)(-[a-zA-Z0-9*.~]*),\2,p')
49c57a8f 17
819a2d4c 18ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
a1b3608f
BP
19PARALLEL = -j$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
20else
21PARALLEL =
819a2d4c 22endif
3d8deded
JP
23
24%:
25 dh $@ --with autoreconf,python2 --parallel
26
27# use --as-needed only if supported by dh-autoreconf (to simplify backporting)
28DH_AS_NEEDED=$(shell dpkg --compare-versions $$(dpkg --status dh-autoreconf | grep Version | cut -d' ' -f2) ge 6 && echo --as-needed)
29override_dh_autoreconf:
30 dh_autoreconf $(DH_AS_NEEDED)
31
32override_dh_auto_configure:
4886d4d2 33 dh_auto_configure -- --enable-ssl --enable-shared $(DATAPATH_CONFIGURE_OPTS)
3d8deded
JP
34
35override_dh_auto_test:
52db0bbe 36ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
0d3f2152 37 if $(MAKE) check TESTSUITEFLAGS='$(PARALLEL)' RECHECK=yes; then :; \
a1b3608f 38 else \
3d8deded 39 cat tests/testsuite.log; \
ff8c6aa1
BP
40 exit 1; \
41 fi
52db0bbe 42endif
3d8deded
JP
43
44override_dh_auto_build:
45 dh_auto_build -- dist distdir=openvswitch
46
47override_dh_auto_clean:
72fe72b3 48 rm -f python/ovs/*.pyc python/ovs/db/*.pyc
3d8deded 49 dh_auto_clean
064af421 50
8415fe32 51override_dh_install-arch:
3d8deded
JP
52 dh_install
53 # openvswitch-switch
54 cp debian/openvswitch-switch.template debian/openvswitch-switch/usr/share/openvswitch/switch/default.template
55
5629723d
GS
56 # ovn-host
57 cp debian/ovn-host.template debian/ovn-host/usr/share/ovn/host/default.template
58
86d9ab04
GS
59 # ovn-central
60 cp debian/ovn-central.template debian/ovn-central/usr/share/ovn/central/default.template
61
8415fe32 62override_dh_install-indep:
63 dh_install
64
3d8deded 65 # openvswitch-datapath-source
8a07709c 66 cp debian/rules.modules debian/openvswitch-datapath-source/usr/src/modules/openvswitch-datapath/debian/rules
a84edf54 67 chmod 755 debian/openvswitch-datapath-source/usr/src/modules/openvswitch-datapath/debian/rules
064af421 68 cd debian/openvswitch-datapath-source/usr/src && tar -c modules | bzip2 -9 > openvswitch-datapath.tar.bz2 && rm -rf modules
064af421 69
3d8deded 70 # openvswitch-datapath-dkms
49c57a8f 71 # setup the dirs
3d8deded 72 dh_installdirs -p$(PACKAGE_DKMS) usr/src/$(PACKAGE)-$(DEB_UPSTREAM_VERSION)
49c57a8f
CS
73
74 # copy the source
3d8deded 75 cd debian/$(PACKAGE_DKMS)/usr/src/$(PACKAGE)-$(DEB_UPSTREAM_VERSION) && tar xvzf $(CURDIR)/openvswitch.tar.gz && mv openvswitch/* openvswitch/.[a-z]* . && rmdir openvswitch
49c57a8f 76
f315ae4f 77 # check we can get kernel module names
3d8deded 78 $(MAKE) -C datapath print-build-modules
f315ae4f 79
49c57a8f 80 # Prepare dkms.conf from the dkms.conf.in template
3d8deded 81 sed "s/__VERSION__/$(DEB_UPSTREAM_VERSION)/g; s/__MODULES__/$(shell $(MAKE) -C datapath print-build-modules | grep -v make)/" debian/dkms.conf.in > debian/$(PACKAGE_DKMS)/usr/src/$(PACKAGE)-$(DEB_UPSTREAM_VERSION)/dkms.conf
49c57a8f 82
f7c0a423 83 # We don't need the debian folder in there, just upstream sources...
3d8deded 84 rm -rf debian/$(PACKAGE_DKMS)/usr/src/$(PACKAGE)-$(DEB_UPSTREAM_VERSION)/debian
f7c0a423 85 # We don't need the rhel stuff in there either
3d8deded 86 rm -rf debian/$(PACKAGE_DKMS)/usr/src/$(PACKAGE)-$(DEB_UPSTREAM_VERSION)/rhel
f7c0a423 87 # And we should also clean useless license files, which are already
3d8deded
JP
88 # described in our debian/copyright anyway.
89 rm -f debian/$(PACKAGE_DKMS)/usr/src/$(PACKAGE)-$(DEB_UPSTREAM_VERSION)/COPYING \
90 debian/$(PACKAGE_DKMS)/usr/src/$(PACKAGE)-$(DEB_UPSTREAM_VERSION)/xenserver/LICENSE
91
92override_dh_installinit:
8a5b3cfd 93 dh_installinit -R
3d8deded
JP
94
95override_dh_strip:
064af421 96 dh_strip --dbg-package=openvswitch-dbg
4886d4d2
EC
97
98override_dh_usrlocal: