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.
16 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
17 NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
18 MAKEFLAGS += -j$(NUMJOBS)
21 ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
27 configure: configure-stamp
30 test -e configure || ./boot.sh
31 test -d _debian || mkdir _debian
35 ../configure --prefix=/usr --localstatedir=/var --enable-ssl \
36 --with-build-number=$(BUILD_NUMBER) \
37 CFLAGS="$(CFLAGS)" $(DATAPATH_CONFIGURE_OPTS))
41 build: build-arch build-indep
43 build-arch: build-arch-stamp
44 build-arch-stamp: configure-stamp
46 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
47 if $(MAKE) -C _debian check; then :; else \
48 cat _debian/tests/testsuite.log; \
54 build-indep: build-indep-stamp
55 build-indep-stamp: configure-stamp
56 $(MAKE) -C _debian dist distdir=openvswitch
62 rm -f build-arch-stamp build-indep-stamp configure-stamp
64 [ ! -f Makefile ] || $(MAKE) distclean
67 install: install-indep install-arch
68 install-indep: build-indep
74 sed 's/^BUILD_NUMBER = .*/BUILD_NUMBER = $(BUILD_NUMBER)/' \
75 < debian/rules.modules \
76 > debian/openvswitch-datapath-source/usr/src/modules/openvswitch-datapath/debian/rules
77 chmod 755 debian/openvswitch-datapath-source/usr/src/modules/openvswitch-datapath/debian/rules
78 cd debian/openvswitch-datapath-source/usr/src && tar -c modules | bzip2 -9 > openvswitch-datapath.tar.bz2 && rm -rf modules
79 install -m644 debian/openvswitch-pki-server.apache2 debian/openvswitch-pki-server/etc/apache2/sites-available/openvswitch-pki
81 install-arch: build-arch
86 $(MAKE) -C _debian DESTDIR=$(CURDIR)/debian/openvswitch install
87 cp debian/openvswitch-switch.template debian/openvswitch-switch/usr/share/openvswitch/switch/default.template
90 # Must not depend on anything. This is to be called by
91 # binary-arch/binary-indep
92 # in another 'make' thread.
105 dh_strip --dbg-package=openvswitch-dbg
107 dh_fixperms -X var/log/core
116 binary-indep: install-indep
117 $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
118 binary-arch: install-arch
119 $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
121 binary: binary-arch binary-indep
122 .PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure