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 configure: configure-stamp
31 test -e configure || ./boot.sh
32 test -d _debian || mkdir _debian
35 ../configure --prefix=/usr --localstatedir=/var --enable-ssl)
39 build: build-arch build-indep
41 build-arch: build-arch-stamp
42 build-arch-stamp: configure-stamp
46 build-indep: build-indep-stamp
47 build-indep-stamp: configure-stamp
48 $(MAKE) -C _debian dist distdir=openflow
54 rm -f build-arch-stamp build-indep-stamp configure-stamp
56 [ ! -f Makefile ] || $(MAKE) distclean
60 MAJOR=$(shell echo $(KVERS) | sed -e 's/\(...\).*/\1/')
64 dpdir=datapath/linux-2.6
68 dpdir=datapath/linux-2.4
75 kdist_config: prep-deb-files
77 binary-modules: DSTDIR = $(CURDIR)/debian/$(PKGNAME)/lib/modules/$(KVERS)
78 binary-modules: prep-deb-files
82 tar xzf openflow.tar.gz
83 cd openflow && ./configure --with-$(l2x)=$(KSRC)
84 cd openflow && $(MAKE) -C $(dpdir)
85 install -d -m755 $(DSTDIR)
86 install -m644 openflow/$(dpdir)/*_mod.$(KO)o $(DSTDIR)/
92 dh_gencontrol -- -v$(VERSION)
94 dh_builddeb --destdir=$(DEB_DESTDIR)
96 install: install-indep install-arch
97 install-indep: MODDIR = $(CURDIR)/debian/openflow-datapath-source/usr/src/modules/openflow-datapath
98 install-indep: build-indep
103 cp _debian/openflow.tar.gz $(MODDIR)
104 cd debian; cp changelog control compat *.modules.in rules $(MODDIR)/debian
105 cd debian/openflow-datapath-source/usr/src && tar -c modules | bzip2 -9 > openflow-datapath.tar.bz2 && rm -rf modules
106 install -m644 debian/openflow-pki.apache2 debian/openflow-pki/etc/apache2/sites-available/openflow-pki
109 install-arch: build-arch
114 $(MAKE) -C _debian DESTDIR=$(CURDIR)/debian/openflow install
115 cp debian/openflow-switch.overrides debian/openflow-switch/usr/share/lintian/overrides/openflow-switch
118 # Must not depend on anything. This is to be called by
119 # binary-arch/binary-indep
120 # in another 'make' thread.
128 # dh_installlogrotate
142 binary-indep: install-indep
143 $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
144 binary-arch: install-arch
145 $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
147 binary: binary-arch binary-indep
148 .PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure