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 configure: configure-stamp
33 test -e configure || ./boot.sh
34 test -d _debian || mkdir _debian
37 ../configure --prefix=/usr --localstatedir=/var --enable-ssl \
43 build: build-arch build-indep
45 build-arch: build-arch-stamp
46 build-arch-stamp: configure-stamp
51 build-indep: build-indep-stamp
52 build-indep-stamp: configure-stamp
53 $(MAKE) -C _debian dist distdir=openflow
60 rm -f build-arch-stamp build-indep-stamp configure-stamp
62 [ ! -f Makefile ] || $(MAKE) distclean
67 MAJOR=$(shell echo $(KVERS) | sed -e 's/\(...\).*/\1/')
71 dpdir=datapath/linux-2.6
75 dpdir=datapath/linux-2.4
82 kdist_config: prep-deb-files
84 binary-modules: DSTDIR = $(CURDIR)/debian/$(PKGNAME)/lib/modules/$(KVERS)
85 binary-modules: prep-deb-files
89 tar xzf openflow.tar.gz
90 cd openflow && ./configure --with-$(l2x)=$(KSRC)
91 cd openflow && $(MAKE) -C $(dpdir)
92 install -d -m755 $(DSTDIR)
93 install -m644 openflow/$(dpdir)/*_mod.$(KO)o $(DSTDIR)/
99 dh_gencontrol -- -v$(VERSION)
101 dh_builddeb --destdir=$(DEB_DESTDIR)
103 install: install-indep install-arch
104 install-indep: build-indep
109 cd debian/openflow-datapath-source/usr/src && tar -c modules | bzip2 -9 > openflow-datapath.tar.bz2 && rm -rf modules
110 install -m644 debian/openflow-pki-server.apache2 debian/openflow-pki-server/etc/apache2/sites-available/openflow-pki
114 install-arch: build-arch
119 $(MAKE) -C _debian DESTDIR=$(CURDIR)/debian/openflow install
120 cp debian/openflow-switch-config.overrides debian/openflow-switch-config/usr/share/lintian/overrides/openflow-switch-config
124 # Must not depend on anything. This is to be called by
125 # binary-arch/binary-indep
126 # in another 'make' thread.
134 # dh_installlogrotate
148 binary-indep: install-indep
149 $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
150 binary-arch: install-arch
151 $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
153 binary: binary-arch binary-indep
154 .PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure