]> git.proxmox.com Git - vzctl.git/blame - debian/rules
vznetaddbr perl version
[vzctl.git] / debian / rules
CommitLineData
328c390e
DM
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)
8DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
9DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
10OS_DEB_VERSION ?= $(shell cat /etc/debian_version)
11VZCTL_DEBVERSION ?= $(shell dpkg-parsechangelog | grep ^Version | sed "s/Version: //")
12VZCTL_VERSION ?= $(shell echo $(VZCTL_DEBVERSION) | cut -d '-' -f 1)
13
14ifneq "$(wildcard /usr/share/quilt/quilt.make)" ""
15include /usr/share/quilt/quilt.make
16endif
17
18CFLAGS = -Wall -g
19
20ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
21 CFLAGS += -O0
22else
23 CFLAGS += -O2
24endif
25
26config.status: configure
27 dh_testdir
28 sed -i "s/'$(VZCTL_VERSION)'/'$(VZCTL_DEBVERSION)'/g" configure
29 ./configure \
508802f8 30 --without-ploop \
328c390e
DM
31 --host=$(DEB_HOST_GNU_TYPE) \
32 --build=$(DEB_BUILD_GNU_TYPE) \
33 --prefix=/usr \
34 --sysconfdir=/etc \
508802f8
DM
35 --libdir=/usr/lib \
36 --libexecdir=/usr/lib \
328c390e
DM
37 --localstatedir=/var \
38 --enable-bashcomp \
39 --enable-logrotate \
40 CFLAGS="$(CFLAGS)"
41
42build: patch build-stamp
43build-stamp: config.status
44 dh_testdir
45 $(MAKE) vzdir=/var/lib/vz
46 touch $@
47
48clean: unpatch
49 dh_testdir
50 dh_testroot
51 rm -f build-stamp
52 -$(MAKE) distclean
53 dh_clean
54
55install: 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
10975143 64
328c390e
DM
65 # debianize vz.conf
66 sed -i \
67 -e 's/\/vz\//\/var\/lib\/vz\//' \
68 $(CURDIR)/debian/vzctl/etc/vz/vz.conf
10975143 69
328c390e
DM
70 # set default dist-script to debian
71 install -m 644 $(CURDIR)/etc/dists/debian.conf $(CURDIR)/debian/vzctl/etc/vz/dists/default
10975143 72
328c390e
DM
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
10975143 75
328c390e
DM
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
10975143 80
328c390e
DM
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
10975143
DM
90 # remove files in /etc/pve/openvz
91 rm -rf $(CURDIR)/debian/vzctl/etc/pve/openvz
92 rmdir $(CURDIR)/debian/vzctl/etc/pve
93
7dc0704b
DM
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
7fe1577d
AD
98 # install perl vznetaddbr version
99 install -m 644 $(CURDIR)/debian/vznetaddbr $(CURDIR)/debian/vzctl/usr/sbin/vznetaddbr
100
7dc0704b 101
10975143 102
328c390e
DM
103# Build architecture-independent files here.
104binary-indep: build install
105
106# Build architecture-dependent files here.
107binary-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
125binary: binary-indep binary-arch
126.PHONY: build clean binary-indep binary-arch binary install