Makefile 4.26 KB
Newer Older
1 2 3 4
include defines.mk

DESTDIR=

Dietmar Maurer's avatar
Dietmar Maurer committed
5
SUBDIRS = aplinfo PVE bin www po
6

7
ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
8
GITVERSION:=$(shell cat .git/refs/heads/master)
9 10

DEB=${PACKAGE}_${VERSION}-${PACKAGERELEASE}_${ARCH}.deb
11 12 13

all: ${SUBDIRS}

14 15 16
check:
	${MAKE} -C bin/test check

17 18 19
%:
	set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i $@; done

20 21 22 23 24 25
pve-repo-ca-certificates.crt:
	rm -rf ca-tmp
	mkdir ca-tmp
	cd ca-tmp; wget http://aia.startssl.com/certs/sub.class1.server.ca.pem
	cd ca-tmp; wget http://aia.startssl.com/certs/ca.pem
	cd ca-tmp; cat *.pem >../$@
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44

.PHONY: dinstall
dinstall: ${DEB}
	dpkg -i ${DEB}

country.dat: country.pl
	./country.pl > country.dat

.PHONY: ${DEB}
${DEB} deb:
	make clean
	rm -rf dest
	mkdir dest
	make DESTDIR=`pwd`/dest install
	mkdir dest/DEBIAN
	sed -e s/@VERSION@/${VERSION}/ -e s/@PACKAGE@/${PACKAGE}/ -e s/@PACKAGERELEASE@/${PACKAGERELEASE}/ debian/control.in >dest/DEBIAN/control
	install -m 0644 debian/conffiles dest/DEBIAN
	install -m 0755 debian/config dest/DEBIAN
	install -m 0644 debian/templates dest/DEBIAN
Dietmar Maurer's avatar
Dietmar Maurer committed
45
	install -m 0755 debian/preinst dest/DEBIAN
46 47 48 49
	install -m 0755 debian/postinst dest/DEBIAN
	install -m 0755 debian/prerm dest/DEBIAN
	install -m 0755 debian/postrm dest/DEBIAN
	install -m 0644 debian/triggers dest/DEBIAN
50
	echo "git clone git://git.proxmox.com/git/pve-manager.git\\ngit checkout ${GITVERSION}" >  dest/usr/share/doc/${PACKAGE}/SOURCE
51 52 53 54 55
	gzip --best dest/usr/share/man/*/*
	gzip --best dest/usr/share/doc/${PACKAGE}/changelog.Debian
	dpkg-deb --build dest
	mv dest.deb ${DEB}
	rm -rf dest
56 57
	# supress lintian error: statically-linked-binary usr/bin/pvemailforward
	lintian -X binaries ${DEB}	
58 59

.PHONY: upload
60
upload: ${DEB} check
Dietmar Maurer's avatar
Dietmar Maurer committed
61
	./repoid.pl .git check
62 63 64 65 66 67 68 69 70 71 72 73 74
	umount /pve/${RELEASE}; mount /pve/${RELEASE} -o rw 
	mkdir -p /pve/${RELEASE}/extra
	rm -f /pve/${RELEASE}/extra/${PACKAGE}_*.deb
	rm -f /pve/${RELEASE}/extra/Packages*
	cp ${DEB} /pve/${RELEASE}/extra
	cd /pve/${RELEASE}/extra; dpkg-scanpackages . /dev/null > Packages; gzip -9c Packages > Packages.gz
	umount /pve/${RELEASE}; mount /pve/${RELEASE} -o ro

#.PHONY: poupload
#poupload:
#	rsync po/*.po po/pve-manager.pot pve.proxmox.com:/home/ftp/sources/po-files/

.PHONY: install
75
install: country.dat vznet.conf vzdump.conf vzdump-hook-script.pl pve-apt.conf pve-repo-ca-certificates.crt mtu bridgevlan bridgevlanport vlan vlan-down
76 77
	install -d -m 0700 -o www-data -g www-data ${DESTDIR}/var/log/pveproxy
	install -D -m 0644 debian/pve.logrotate ${DESTDIR}/etc/logrotate.d/pve
78 79
	install -d ${DESTDIR}/usr/share/${PACKAGE}
	install -d ${DESTDIR}/usr/share/man/man1
80
	install -d ${DOCDIR}/examples
81 82 83 84 85
	install -d ${DESTDIR}/var/lib/${PACKAGE}
	install -d ${DESTDIR}/var/lib/vz/images
	install -d ${DESTDIR}/var/lib/vz/template/cache
	install -d ${DESTDIR}/var/lib/vz/template/iso
	install -d ${DESTDIR}/var/lib/vz/template/qemu
86
	install -D -m 0644 pve-apt.conf ${DESTDIR}/etc/apt/apt.conf.d/75pveconf
87
	install -D -m 0644 pve-sources.list ${DESTDIR}/etc/apt/sources.list.d/pve-enterprise.list
88
	install -D -m 0644 pve-blacklist.conf ${DESTDIR}/etc/modprobe.d/pve-blacklist.conf
89
	install -D -m 0644 pve-repo-ca-certificates.crt ${DESTDIR}/etc/apt/pve-repo-ca-certificates.crt
90
	install -D -m 0644 vzdump.conf ${DESTDIR}/etc/vzdump.conf
91
	install -D -m 0755 vznet.conf ${DESTDIR}/etc/vz/vznet.conf
92
	install -D -m 0755 mtu ${DESTDIR}/etc/network/if-up.d/mtu
93 94 95 96 97
	install -D -m 0755 bridgevlan ${DESTDIR}/etc/network/if-up.d/bridgevlan
	install -D -m 0755 bridgevlanport ${DESTDIR}/etc/network/if-up.d/bridgevlanport
	install -D -m 0755 vlan ${DESTDIR}/etc/network/if-pre-up.d/vlan
	install -D -m 0755 vlan-down ${DESTDIR}/etc/network/if-post-down.d/vlan

98
	install -m 0644 vzdump-hook-script.pl ${DOCDIR}/examples/vzdump-hook-script.pl
99
	install -m 0644 spice-example-sh ${DOCDIR}/examples/spice-example-sh
100 101
	install -m 0644 copyright ${DOCDIR}
	install -m 0644 debian/changelog.Debian ${DOCDIR}
102
	install -m 0644 country.dat ${DESTDIR}/usr/share/${PACKAGE}
103 104
	# temporary: set ExtJS 5 migration devel directory
	install -d ${DESTDIR}/usr/share/${PACKAGE}/manager5
105 106 107 108 109 110 111 112 113 114
	set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i $@; done

.PHONY: distclean
distclean: clean
	set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i $@; done

.PHONY: clean
clean:
	set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i $@; done
	find . -name '*~' -exec rm {} ';'
115
	rm -rf dest country.dat *.deb ca-tmp