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
13 # Official build number. Leave set to 0 if not an official build.
17 pdkms
=openvswitch-datapath-dkms
18 DEB_UPSTREAM_VERSION
=$(shell dpkg-parsechangelog | sed
-rne
's,^Version: ([^-]+).*,\1,p')
19 srcfiles
:= $(filter-out debian
, $(wildcard * .
[^.
]*))
21 ifneq (,$(filter parallel
=%,$(DEB_BUILD_OPTIONS
)))
22 PARALLEL
= -j
$(patsubst parallel
=%,%,$(filter parallel
=%,$(DEB_BUILD_OPTIONS
)))
26 MAKEFLAGS
+= $(PARALLEL
)
28 ifneq (,$(filter noopt
,$(DEB_BUILD_OPTIONS
)))
34 configure
: configure-stamp
37 test -e configure || .
/boot.sh
38 test -d _debian || mkdir _debian
39 echo
$(DEB_BUILD_OPTIONS
)
43 ..
/configure
--prefix=/usr
--localstatedir
=/var
--enable-ssl \
44 --sysconfdir
=/etc
--with-build-number
=$(BUILD_NUMBER
) \
45 CFLAGS
="$(CFLAGS)" $(DATAPATH_CONFIGURE_OPTS
))
49 build
: build-arch build-indep
51 build-arch
: build-arch-stamp
52 build-arch-stamp
: configure-stamp
54 ifeq (,$(filter nocheck
,$(DEB_BUILD_OPTIONS
)))
55 if
$(MAKE
) -C _debian
check TESTSUITEFLAGS
='$(PARALLEL)'; then
:; \
57 cat _debian
/tests
/testsuite.log
; \
63 build-indep
: build-indep-stamp
64 build-indep-stamp
: configure-stamp
65 $(MAKE
) -C _debian
dist distdir
=openvswitch
71 rm -f build-arch-stamp build-indep-stamp configure-stamp
73 [ ! -f Makefile
] ||
$(MAKE
) distclean
76 install: install-indep install-arch
77 install-indep
: build-indep
82 $(MAKE
) -C _debian DESTDIR
=$(CURDIR
)/debian
/tmp
install
84 sed
's/^BUILD_NUMBER = .*/BUILD_NUMBER = $(BUILD_NUMBER)/' \
85 < debian
/rules.modules \
86 > debian
/openvswitch-datapath-source
/usr
/src
/modules
/openvswitch-datapath
/debian
/rules
87 chmod
755 debian
/openvswitch-datapath-source
/usr
/src
/modules
/openvswitch-datapath
/debian
/rules
88 cd debian
/openvswitch-datapath-source
/usr
/src
&& tar -c modules | bzip2
-9 > openvswitch-datapath.
tar.bz2
&& rm -rf modules
92 dh_installdirs
-p
$(pdkms
) usr
/src
/$(PACKAGE
)-$(DEB_UPSTREAM_VERSION
)
95 cd debian
/$(pdkms
)/usr
/src
/$(PACKAGE
)-$(DEB_UPSTREAM_VERSION
) && tar xvzf
$(CURDIR
)/_debian
/openvswitch.
tar.gz
&& mv openvswitch
/* .
&& rmdir openvswitch
97 # Prepare dkms.conf from the dkms.conf.in template
98 sed
"s/__VERSION__/$(DEB_UPSTREAM_VERSION)/g" debian
/dkms.conf.in
> debian
/$(pdkms
)/usr
/src
/$(PACKAGE
)-$(DEB_UPSTREAM_VERSION
)/dkms.conf
100 install-arch
: build-arch
105 $(MAKE
) -C _debian DESTDIR
=$(CURDIR
)/debian
/tmp
install
106 cp debian
/openvswitch-switch.template debian
/openvswitch-switch
/usr
/share
/openvswitch
/switch
/default.template
109 # Must not depend on anything. This is to be called by
110 # binary-arch/binary-indep
111 # in another 'make' thread.
120 dh_installinit
-R
-Nopenvswitch-switch
121 dh_installinit
-R
-popenvswitch-switch
--error-handler
=init_script_error
123 dh_installman
--language
=C
125 dh_strip
--dbg-package
=openvswitch-dbg
136 binary-indep
: install-indep
137 $(MAKE
) -f debian
/rules DH_OPTIONS
=-i binary-common
138 binary-arch
: install-arch
139 $(MAKE
) -f debian
/rules DH_OPTIONS
=-s binary-common
141 binary
: binary-arch binary-indep
142 .PHONY
: build
clean binary-indep binary-arch binary
install install-indep install-arch configure
144 # This GNU make extensions disables parallel builds for the current Makefile
145 # but not for sub-Makefiles. This is appropriate here because build-arch and
146 # build-indep both invoke "make" on OVS, which can update some of the same
147 # targets in ways that conflict (e.g. both update tests/testsuite).