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 # Uncomment this to turn on verbose mode.
16 # This has to be exported to make some magic below work.
19 # prefix of the target package name
20 PACKAGE=openvswitch-datapath-module
21 # modifieable for experiments or debugging m-a
22 MA_DIR ?= /usr/share/modass
23 # load generic variable handling
24 -include $(MA_DIR)/include/generic.make
26 -include $(MA_DIR)/include/common-rules.make
28 DATAPATH_CONFIGURE_OPTS =
30 # Official build number. Leave set to 0 if not an official build.
33 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
34 NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
35 MAKEFLAGS += -j$(NUMJOBS)
38 ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
44 configure: configure-stamp
47 test -e configure || ./boot.sh
48 test -d _debian || mkdir _debian
51 ../configure --prefix=/usr --localstatedir=/var --enable-ssl \
52 --with-build-number=$(BUILD_NUMBER) \
53 CFLAGS="$(CFLAGS)" $(DATAPATH_CONFIGURE_OPTS))
57 build: build-arch build-indep
59 build-arch: build-arch-stamp
60 build-arch-stamp: configure-stamp
62 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
63 $(MAKE) -C _debian check
67 build-indep: build-indep-stamp
68 build-indep-stamp: configure-stamp
69 $(MAKE) -C _debian dist distdir=openvswitch
75 rm -f build-arch-stamp build-indep-stamp configure-stamp
77 [ ! -f Makefile ] || $(MAKE) distclean
85 kdist_config: prep-deb-files
87 binary-modules: DSTDIR = $(CURDIR)/debian/$(PKGNAME)/lib/modules/$(KVERS)
88 binary-modules: prep-deb-files
92 tar xzf openvswitch.tar.gz
93 cd openvswitch && ./configure --with-l26=$(KSRC) $(DATAPATH_CONFIGURE_OPTS) --with-build-number=$(BUILD_NUMBER)
94 cd openvswitch && $(MAKE) -C datapath/linux-2.6
95 install -d -m755 $(DSTDIR)
96 install -m644 openvswitch/datapath/linux-2.6/*_mod.ko $(DSTDIR)/
104 dh_builddeb --destdir=$(DEB_DESTDIR)
106 install: install-indep install-arch
107 install-indep: build-indep
113 cd debian/openvswitch-datapath-source/usr/src && tar -c modules | bzip2 -9 > openvswitch-datapath.tar.bz2 && rm -rf modules
114 install -m644 debian/openvswitch-pki-server.apache2 debian/openvswitch-pki-server/etc/apache2/sites-available/openvswitch-pki
115 install -m1777 -d debian/corekeeper/var/log/core
117 install-arch: build-arch
122 $(MAKE) -C _debian DESTDIR=$(CURDIR)/debian/openvswitch install
123 cp debian/openvswitch-switch-config.overrides debian/openvswitch-switch-config/usr/share/lintian/overrides/openvswitch-switch-config
124 cp debian/openvswitch-switch.template debian/openvswitch-switch/usr/share/openvswitch/switch/default.template
126 env TERMINFO=debian/openvswitch-switchui/usr/share/terminfo tic -x extras/ezio/ezio3.ti
128 # Must not depend on anything. This is to be called by
129 # binary-arch/binary-indep
130 # in another 'make' thread.
143 dh_strip --dbg-package=openvswitch-dbg
145 dh_fixperms -X var/log/core
153 binary-indep: install-indep
154 $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
155 binary-arch: install-arch
156 $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
158 binary: binary-arch binary-indep
159 .PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure