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=openflow-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 -include debian/rules.ext
30 DATAPATH_CONFIGURE_OPTS = --enable-snat
32 configure: configure-stamp
35 test -e configure || ./boot.sh
36 test -d _debian || mkdir _debian
39 ../configure --prefix=/usr --localstatedir=/var --enable-ssl \
40 $(DATAPATH_CONFIGURE_OPTS))
45 build: build-arch build-indep
47 build-arch: build-arch-stamp
48 build-arch-stamp: configure-stamp
53 build-indep: build-indep-stamp
54 build-indep-stamp: configure-stamp
55 $(MAKE) -C _debian dist distdir=openflow
62 rm -f build-arch-stamp build-indep-stamp configure-stamp
64 [ ! -f Makefile ] || $(MAKE) distclean
69 MAJOR=$(shell echo $(KVERS) | sed -e 's/\(...\).*/\1/')
73 dpdir=datapath/linux-2.6
77 dpdir=datapath/linux-2.4
84 kdist_config: prep-deb-files
86 binary-modules: DSTDIR = $(CURDIR)/debian/$(PKGNAME)/lib/modules/$(KVERS)
87 binary-modules: prep-deb-files
91 tar xzf openflow.tar.gz
92 cd openflow && ./configure --with-$(l2x)=$(KSRC) $(DATAPATH_CONFIGURE_OPTS)
93 cd openflow && $(MAKE) -C $(dpdir)
94 install -d -m755 $(DSTDIR)
95 install -m644 openflow/$(dpdir)/*_mod.$(KO)o $(DSTDIR)/
103 dh_builddeb --destdir=$(DEB_DESTDIR)
105 install: install-indep install-arch
106 install-indep: build-indep
112 cd debian/openflow-datapath-source/usr/src && tar -c modules | bzip2 -9 > openflow-datapath.tar.bz2 && rm -rf modules
113 install -m644 debian/openflow-pki-server.apache2 debian/openflow-pki-server/etc/apache2/sites-available/openflow-pki
116 install-arch: build-arch
121 $(MAKE) -C _debian DESTDIR=$(CURDIR)/debian/openflow install
122 cp debian/openflow-switch-config.overrides debian/openflow-switch-config/usr/share/lintian/overrides/openflow-switch-config
126 # Must not depend on anything. This is to be called by
127 # binary-arch/binary-indep
128 # in another 'make' thread.
150 binary-indep: install-indep
151 $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
152 binary-arch: install-arch
153 $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
155 binary: binary-arch binary-indep
156 .PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure