]> git.proxmox.com Git - vzctl.git/blob - debian/rules
vznetaddbr perl version
[vzctl.git] / debian / rules
1 #!/usr/bin/make -f
2
3 # Uncomment this to turn on verbose mode.
4 #export DH_VERBOSE=1
5
6 # These are used for cross-compiling and for saving the configure script
7 # from having to guess our platform (since we know it already)
8 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
9 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
10 OS_DEB_VERSION ?= $(shell cat /etc/debian_version)
11 VZCTL_DEBVERSION ?= $(shell dpkg-parsechangelog | grep ^Version | sed "s/Version: //")
12 VZCTL_VERSION ?= $(shell echo $(VZCTL_DEBVERSION) | cut -d '-' -f 1)
13
14 ifneq "$(wildcard /usr/share/quilt/quilt.make)" ""
15 include /usr/share/quilt/quilt.make
16 endif
17
18 CFLAGS = -Wall -g
19
20 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
21 CFLAGS += -O0
22 else
23 CFLAGS += -O2
24 endif
25
26 config.status: configure
27 dh_testdir
28 sed -i "s/'$(VZCTL_VERSION)'/'$(VZCTL_DEBVERSION)'/g" configure
29 ./configure \
30 --without-ploop \
31 --host=$(DEB_HOST_GNU_TYPE) \
32 --build=$(DEB_BUILD_GNU_TYPE) \
33 --prefix=/usr \
34 --sysconfdir=/etc \
35 --libdir=/usr/lib \
36 --libexecdir=/usr/lib \
37 --localstatedir=/var \
38 --enable-bashcomp \
39 --enable-logrotate \
40 CFLAGS="$(CFLAGS)"
41
42 build: patch build-stamp
43 build-stamp: config.status
44 dh_testdir
45 $(MAKE) vzdir=/var/lib/vz
46 touch $@
47
48 clean: unpatch
49 dh_testdir
50 dh_testroot
51 rm -f build-stamp
52 -$(MAKE) distclean
53 dh_clean
54
55 install: build
56 dh_testdir
57 dh_testroot
58 dh_clean -k
59 dh_installdirs
60 $(MAKE) DESTDIR=$(CURDIR)/debian/vzctl \
61 install \
62 install-debian \
63 vzdir=/var/lib/vz
64
65 # debianize vz.conf
66 sed -i \
67 -e 's/\/vz\//\/var\/lib\/vz\//' \
68 $(CURDIR)/debian/vzctl/etc/vz/vz.conf
69
70 # set default dist-script to debian
71 install -m 644 $(CURDIR)/etc/dists/debian.conf $(CURDIR)/debian/vzctl/etc/vz/dists/default
72
73 # rename the bash_completion.d/vzctl.sh for debian to vzctl
74 mv $(CURDIR)/debian/vzctl/etc/bash_completion.d/vzctl.sh $(CURDIR)/debian/vzctl/etc/bash_completion.d/vzctl
75
76
77 # Remove unused file from libtool
78 rm -rf $(CURDIR)/debian/vzctl/usr/lib/*.la
79 rm -rf $(CURDIR)/debian/vzctl/usr/lib/*.a
80
81 # unset Debian Version on vzctl
82 sed -i "s/'$(VZCTL_DEBVERSION)'/'$(VZCTL_VERSION)'/g" configure
83
84 # install sysctl file
85 install -m 644 $(CURDIR)/debian/sysctl $(CURDIR)/debian/vzctl/etc/sysctl.d/vzctl.conf
86
87 # lintian overrides
88 install -m 644 $(CURDIR)/debian/vzctl.override $(CURDIR)/debian/vzctl/usr/share/lintian/overrides/vzctl
89
90 # remove files in /etc/pve/openvz
91 rm -rf $(CURDIR)/debian/vzctl/etc/pve/openvz
92 rmdir $(CURDIR)/debian/vzctl/etc/pve
93
94 # remove files in /etc/vz/conf (symlink to /etc/pve/openvz)
95 rm -rf $(CURDIR)/debian/vzctl/etc/vz/conf
96 # we create the symlink to /etc/pve/openvz inside the preinst script
97
98 # install perl vznetaddbr version
99 install -m 644 $(CURDIR)/debian/vznetaddbr $(CURDIR)/debian/vzctl/usr/sbin/vznetaddbr
100
101
102
103 # Build architecture-independent files here.
104 binary-indep: build install
105
106 # Build architecture-dependent files here.
107 binary-arch: build install
108 dh_testdir
109 dh_testroot
110 dh_installchangelogs ChangeLog
111 dh_installdocs
112 dh_installexamples
113 dh_installman
114 dh_link
115 dh_strip
116 dh_compress
117 dh_fixperms
118 dh_makeshlibs
119 dh_installdeb
120 dh_shlibdeps
121 dh_gencontrol
122 dh_md5sums
123 dh_builddeb
124
125 binary: binary-indep binary-arch
126 .PHONY: build clean binary-indep binary-arch binary install