debian: Remove openvswitch-pki-server package.
[sliver-openvswitch.git] / debian / rules
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3 # Sample debian/rules that uses debhelper.
4 #
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.
9 #
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
12
13 # Official build number.  Leave set to 0 if not an official build.
14 BUILD_NUMBER = 0
15
16 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
17 NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
18 MAKEFLAGS += -j$(NUMJOBS)
19 endif
20
21 ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
22 CFLAGS += -O0
23 else
24 CFLAGS += -O2
25 endif
26
27 configure: configure-stamp
28 configure-stamp:
29         dh_testdir
30         test -e configure || ./boot.sh
31         test -d _debian || mkdir _debian
32         echo $(DEB_BUILD_OPTIONS)
33         echo $$CC
34         cd _debian && ( \
35                 test -e Makefile || \
36                 ../configure --prefix=/usr --localstatedir=/var --enable-ssl \
37                         --with-build-number=$(BUILD_NUMBER) \
38                         CFLAGS="$(CFLAGS)" $(DATAPATH_CONFIGURE_OPTS))
39         touch configure-stamp
40
41 #Architecture 
42 build: build-arch build-indep
43
44 build-arch: build-arch-stamp
45 build-arch-stamp: configure-stamp 
46         $(MAKE) -C _debian
47 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
48         if $(MAKE) -C _debian check; then :; else \
49                 cat _debian/tests/testsuite.log; \
50                 exit 1; \
51         fi
52 endif
53         touch $@
54
55 build-indep: build-indep-stamp
56 build-indep-stamp: configure-stamp 
57         $(MAKE) -C _debian dist distdir=openvswitch
58         touch $@
59
60 clean:
61         dh_testdir
62         dh_testroot
63         rm -f build-arch-stamp build-indep-stamp configure-stamp
64         rm -rf _debian
65         [ ! -f Makefile ] || $(MAKE) distclean
66         dh_clean 
67
68 install: install-indep install-arch
69 install-indep: build-indep
70         dh_testdir
71         dh_testroot
72         dh_clean -k -i 
73         dh_installdirs -i
74         dh_install -i
75         sed 's/^BUILD_NUMBER = .*/BUILD_NUMBER = $(BUILD_NUMBER)/' \
76                 < debian/rules.modules \
77                 > debian/openvswitch-datapath-source/usr/src/modules/openvswitch-datapath/debian/rules
78         chmod 755 debian/openvswitch-datapath-source/usr/src/modules/openvswitch-datapath/debian/rules
79         cd debian/openvswitch-datapath-source/usr/src && tar -c modules | bzip2 -9 > openvswitch-datapath.tar.bz2 && rm -rf modules
80
81 install-arch: build-arch
82         dh_testdir
83         dh_testroot
84         dh_clean -k -s 
85         dh_installdirs -s
86         $(MAKE) -C _debian DESTDIR=$(CURDIR)/debian/openvswitch install
87         cp debian/openvswitch-switch.template debian/openvswitch-switch/usr/share/openvswitch/switch/default.template
88         dh_install -s
89
90 # Must not depend on anything. This is to be called by
91 # binary-arch/binary-indep
92 # in another 'make' thread.
93 binary-common:
94         dh_testdir
95         dh_testroot
96         dh_installchangelogs 
97         dh_installdocs
98         dh_installexamples
99         dh_installdebconf
100         dh_installlogrotate
101         dh_installinit
102         dh_installcron
103         dh_installman
104         dh_link
105         dh_strip --dbg-package=openvswitch-dbg
106         dh_compress 
107         dh_fixperms -X var/log/core
108         dh_pysupport
109         dh_perl
110         dh_makeshlibs
111         dh_installdeb
112         dh_shlibdeps
113         dh_gencontrol
114         dh_md5sums
115         dh_builddeb
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
120
121 binary: binary-arch binary-indep
122 .PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure
123
124 # This GNU make extensions disables parallel builds for the current Makefile
125 # but not for sub-Makefiles.  This is appropriate here because build-arch and
126 # build-indep both invoke "make" on OVS, which can update some of the same
127 # targets in ways that conflict (e.g. both update tests/testsuite).
128 .NOTPARALLEL: