3 # Sample debian/rules that uses debhelper.
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.
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
15 PACKAGE_DKMS
=openvswitch-datapath-dkms
16 include /usr
/share
/dpkg
/pkg-info.mk
18 ifneq (,$(filter parallel
=%,$(DEB_BUILD_OPTIONS
)))
19 PARALLEL
= -j
$(patsubst parallel
=%,%,$(filter parallel
=%,$(DEB_BUILD_OPTIONS
)))
25 dh
$@
--with autoreconf
,python3
--parallel
27 # use --as-needed only if supported by dh-autoreconf (to simplify backporting)
28 DH_AS_NEEDED
=$(shell dpkg
--compare-versions
$$(dpkg
--status dh-autoreconf | grep Version | cut
-d
' ' -f2
) ge
6 && echo
--as-needed
)
29 override_dh_autoreconf
:
30 dh_autoreconf
$(DH_AS_NEEDED
)
32 override_dh_auto_configure
:
33 dh_auto_configure
-- --enable-ssl
--enable-shared
$(DATAPATH_CONFIGURE_OPTS
)
35 override_dh_auto_test
:
36 ifeq (,$(filter nocheck
,$(DEB_BUILD_OPTIONS
)))
37 if
$(MAKE
) check TESTSUITEFLAGS
='$(PARALLEL)' RECHECK
=yes
; then
:; \
39 cat tests
/testsuite.log
; \
44 override_dh_auto_build
:
45 dh_auto_build
-- dist distdir
=openvswitch
47 override_dh_auto_clean
:
48 rm -f python
/ovs
/*.pyc python
/ovs
/db
/*.pyc
51 override_dh_install-arch
:
54 cp debian
/openvswitch-switch.template debian
/openvswitch-switch
/usr
/share
/openvswitch
/switch
/default.template
56 override_dh_install-indep
:
59 # openvswitch-datapath-source
60 cp debian
/rules.modules debian
/openvswitch-datapath-source
/usr
/src
/modules
/openvswitch-datapath
/debian
/rules
61 chmod
755 debian
/openvswitch-datapath-source
/usr
/src
/modules
/openvswitch-datapath
/debian
/rules
62 cd debian
/openvswitch-datapath-source
/usr
/src
&& tar -c modules | bzip2
-9 > openvswitch-datapath.
tar.bz2
&& rm -rf modules
64 # openvswitch-datapath-dkms
66 dh_installdirs
-p
$(PACKAGE_DKMS
) usr
/src
/$(PACKAGE
)-$(DEB_VERSION_UPSTREAM
)
69 cd debian
/$(PACKAGE_DKMS
)/usr
/src
/$(PACKAGE
)-$(DEB_VERSION_UPSTREAM
) && tar xvzf
$(CURDIR
)/openvswitch.
tar.gz
&& mv openvswitch
/* openvswitch
/.
[a-z
]* .
&& rmdir openvswitch
71 # check we can get kernel module names
72 $(MAKE
) -C datapath print-build-modules
74 # Prepare dkms.conf from the dkms.conf.in template
75 sed
"s/__VERSION__/$(DEB_VERSION_UPSTREAM)/g; s/__MODULES__/$(shell $(MAKE) -C datapath print-build-modules | grep -v make)/" debian
/dkms.conf.in
> debian
/$(PACKAGE_DKMS
)/usr
/src
/$(PACKAGE
)-$(DEB_VERSION_UPSTREAM
)/dkms.conf
77 # We don't need the debian folder in there, just upstream sources...
78 rm -rf debian
/$(PACKAGE_DKMS
)/usr
/src
/$(PACKAGE
)-$(DEB_VERSION_UPSTREAM
)/debian
79 # We don't need the rhel stuff in there either
80 rm -rf debian
/$(PACKAGE_DKMS
)/usr
/src
/$(PACKAGE
)-$(DEB_VERSION_UPSTREAM
)/rhel
81 # And we should also clean useless license files, which are already
82 # described in our debian/copyright anyway.
83 rm -f debian
/$(PACKAGE_DKMS
)/usr
/src
/$(PACKAGE
)-$(DEB_VERSION_UPSTREAM
)/xenserver
/LICENSE
85 override_dh_installinit
:
89 dh_strip
--dbg-package
=openvswitch-dbg
93 override_dh_installman
:
94 dh_installman
--language
=C