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