]> git.proxmox.com Git - vzctl.git/blame - debian/rules
fix config path - do not make backups on destroy
[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 \
30 --host=$(DEB_HOST_GNU_TYPE) \
31 --build=$(DEB_BUILD_GNU_TYPE) \
32 --prefix=/usr \
33 --sysconfdir=/etc \
34 --localstatedir=/var \
35 --enable-bashcomp \
36 --enable-logrotate \
37 CFLAGS="$(CFLAGS)"
38
39build: patch build-stamp
40build-stamp: config.status
41 dh_testdir
42 $(MAKE) vzdir=/var/lib/vz
43 touch $@
44
45clean: unpatch
46 dh_testdir
47 dh_testroot
48 rm -f build-stamp
49 -$(MAKE) distclean
50 dh_clean
51
52install: build
53 dh_testdir
54 dh_testroot
55 dh_clean -k
56 dh_installdirs
57 $(MAKE) DESTDIR=$(CURDIR)/debian/vzctl \
58 install \
59 install-debian \
60 vzdir=/var/lib/vz
10975143 61
328c390e
DM
62 # debianize vz.conf
63 sed -i \
64 -e 's/\/vz\//\/var\/lib\/vz\//' \
65 $(CURDIR)/debian/vzctl/etc/vz/vz.conf
10975143 66
328c390e
DM
67 # set default dist-script to debian
68 install -m 644 $(CURDIR)/etc/dists/debian.conf $(CURDIR)/debian/vzctl/etc/vz/dists/default
10975143 69
328c390e
DM
70 # rename the bash_completion.d/vzctl.sh for debian to vzctl
71 mv $(CURDIR)/debian/vzctl/etc/bash_completion.d/vzctl.sh $(CURDIR)/debian/vzctl/etc/bash_completion.d/vzctl
10975143 72
328c390e
DM
73
74 # Remove unused file from libtool
75 rm -rf $(CURDIR)/debian/vzctl/usr/lib/*.la
76 rm -rf $(CURDIR)/debian/vzctl/usr/lib/*.a
10975143 77
328c390e
DM
78 # unset Debian Version on vzctl
79 sed -i "s/'$(VZCTL_DEBVERSION)'/'$(VZCTL_VERSION)'/g" configure
80
81 # install sysctl file
82 install -m 644 $(CURDIR)/debian/sysctl $(CURDIR)/debian/vzctl/etc/sysctl.d/vzctl.conf
83
84 # lintian overrides
85 install -m 644 $(CURDIR)/debian/vzctl.override $(CURDIR)/debian/vzctl/usr/share/lintian/overrides/vzctl
86
10975143
DM
87 # remove files in /etc/pve/openvz
88 rm -rf $(CURDIR)/debian/vzctl/etc/pve/openvz
89 rmdir $(CURDIR)/debian/vzctl/etc/pve
90
7dc0704b
DM
91 # remove files in /etc/vz/conf (symlink to /etc/pve/openvz)
92 rm -rf $(CURDIR)/debian/vzctl/etc/vz/conf
93 # we create the symlink to /etc/pve/openvz inside the preinst script
94
95
10975143 96
328c390e
DM
97# Build architecture-independent files here.
98binary-indep: build install
99
100# Build architecture-dependent files here.
101binary-arch: build install
102 dh_testdir
103 dh_testroot
104 dh_installchangelogs ChangeLog
105 dh_installdocs
106 dh_installexamples
107 dh_installman
108 dh_link
109 dh_strip
110 dh_compress
111 dh_fixperms
112 dh_makeshlibs
113 dh_installdeb
114 dh_shlibdeps
115 dh_gencontrol
116 dh_md5sums
117 dh_builddeb
118
119binary: binary-indep binary-arch
120.PHONY: build clean binary-indep binary-arch binary install