]>
Commit | Line | Data |
---|---|---|
1 | include defines.mk | |
2 | ||
3 | DESTDIR= | |
4 | ||
5 | #SUBDIRS = bin lib www aplinfo | |
6 | SUBDIRS = aplinfo PVE bin www po | |
7 | ||
8 | ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH) | |
9 | GITVERSION:=$(shell cat .git/refs/heads/master) | |
10 | ||
11 | DEB=${PACKAGE}_${VERSION}-${PACKAGERELEASE}_${ARCH}.deb | |
12 | ||
13 | all: ${SUBDIRS} | |
14 | ||
15 | check: | |
16 | ${MAKE} -C bin/test check | |
17 | ||
18 | %: | |
19 | set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i $@; done | |
20 | ||
21 | pve-repo-ca-certificates.crt: | |
22 | rm -rf ca-tmp | |
23 | mkdir ca-tmp | |
24 | cd ca-tmp; wget http://aia.startssl.com/certs/sub.class1.server.ca.pem | |
25 | cd ca-tmp; wget http://aia.startssl.com/certs/ca.pem | |
26 | cd ca-tmp; cat *.pem >../$@ | |
27 | ||
28 | .PHONY: dinstall | |
29 | dinstall: ${DEB} | |
30 | dpkg -i ${DEB} | |
31 | ||
32 | country.dat: country.pl | |
33 | ./country.pl > country.dat | |
34 | ||
35 | .PHONY: ${DEB} | |
36 | ${DEB} deb: | |
37 | make clean | |
38 | rm -rf dest | |
39 | mkdir dest | |
40 | make DESTDIR=`pwd`/dest install | |
41 | mkdir dest/DEBIAN | |
42 | sed -e s/@VERSION@/${VERSION}/ -e s/@PACKAGE@/${PACKAGE}/ -e s/@PACKAGERELEASE@/${PACKAGERELEASE}/ debian/control.in >dest/DEBIAN/control | |
43 | install -m 0644 debian/conffiles dest/DEBIAN | |
44 | install -m 0755 debian/config dest/DEBIAN | |
45 | install -m 0644 debian/templates dest/DEBIAN | |
46 | install -m 0755 debian/preinst dest/DEBIAN | |
47 | install -m 0755 debian/postinst dest/DEBIAN | |
48 | install -m 0755 debian/prerm dest/DEBIAN | |
49 | install -m 0755 debian/postrm dest/DEBIAN | |
50 | install -m 0644 debian/triggers dest/DEBIAN | |
51 | echo "git clone git://git.proxmox.com/git/pve-manager.git\\ngit checkout ${GITVERSION}" > dest/usr/share/doc/${PACKAGE}/SOURCE | |
52 | gzip --best dest/usr/share/man/*/* | |
53 | gzip --best dest/usr/share/doc/${PACKAGE}/changelog.Debian | |
54 | dpkg-deb --build dest | |
55 | mv dest.deb ${DEB} | |
56 | rm -rf dest | |
57 | # supress lintian error: statically-linked-binary usr/bin/pvemailforward | |
58 | lintian -X binaries ${DEB} | |
59 | ||
60 | .PHONY: upload | |
61 | upload: ${DEB} check | |
62 | ./repoid.pl .git check | |
63 | umount /pve/${RELEASE}; mount /pve/${RELEASE} -o rw | |
64 | mkdir -p /pve/${RELEASE}/extra | |
65 | rm -f /pve/${RELEASE}/extra/${PACKAGE}_*.deb | |
66 | rm -f /pve/${RELEASE}/extra/Packages* | |
67 | cp ${DEB} /pve/${RELEASE}/extra | |
68 | cd /pve/${RELEASE}/extra; dpkg-scanpackages . /dev/null > Packages; gzip -9c Packages > Packages.gz | |
69 | umount /pve/${RELEASE}; mount /pve/${RELEASE} -o ro | |
70 | ||
71 | #.PHONY: poupload | |
72 | #poupload: | |
73 | # rsync po/*.po po/pve-manager.pot pve.proxmox.com:/home/ftp/sources/po-files/ | |
74 | ||
75 | .PHONY: aplupload | |
76 | aplupload: | |
77 | ./aplinfo/apltest.pl | |
78 | gpg -bas -u support@proxmox.com aplinfo/aplinfo.dat | |
79 | gzip -c aplinfo/aplinfo.dat > aplinfo.dat.gz | |
80 | scp aplinfo/aplinfo.dat aplinfo.dat.gz aplinfo/aplinfo.dat.asc download1.proxmox.com:/home/ftp/appliances/ | |
81 | ||
82 | .PHONY: install | |
83 | install: country.dat vznet.conf vzdump.conf vzdump-hook-script.pl pve-apt.conf pve-repo-ca-certificates.crt mtu | |
84 | install -d -m 0700 -o www-data -g www-data ${DESTDIR}/var/log/pveproxy | |
85 | install -D -m 0644 debian/pve.logrotate ${DESTDIR}/etc/logrotate.d/pve | |
86 | install -d ${DESTDIR}/usr/share/${PACKAGE} | |
87 | install -d ${DESTDIR}/usr/share/man/man1 | |
88 | install -d ${DOCDIR}/examples | |
89 | install -d ${DESTDIR}/var/lib/${PACKAGE} | |
90 | install -d ${DESTDIR}/var/lib/vz/images | |
91 | install -d ${DESTDIR}/var/lib/vz/template/cache | |
92 | install -d ${DESTDIR}/var/lib/vz/template/iso | |
93 | install -d ${DESTDIR}/var/lib/vz/template/qemu | |
94 | install -D -m 0644 pve-apt.conf ${DESTDIR}/etc/apt/apt.conf.d/75pveconf | |
95 | install -D -m 0644 pve-sources.list ${DESTDIR}/etc/apt/sources.list.d/pve-enterprise.list | |
96 | install -D -m 0644 pve-repo-ca-certificates.crt ${DESTDIR}/etc/apt/pve-repo-ca-certificates.crt | |
97 | install -D -m 0644 vzdump.conf ${DESTDIR}/etc/vzdump.conf | |
98 | install -D -m 0755 vznet.conf ${DESTDIR}/etc/vz/vznet.conf | |
99 | install -D -m 0755 mtu ${DESTDIR}/etc/network/if-up.d/mtu | |
100 | install -m 0644 vzdump-hook-script.pl ${DOCDIR}/examples/vzdump-hook-script.pl | |
101 | install -m 0644 spice-example-sh ${DOCDIR}/examples/spice-example-sh | |
102 | install -m 0644 copyright ${DOCDIR} | |
103 | install -m 0644 debian/changelog.Debian ${DOCDIR} | |
104 | install -m 0644 country.dat ${DESTDIR}/usr/share/${PACKAGE} | |
105 | set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i $@; done | |
106 | ||
107 | .PHONY: distclean | |
108 | distclean: clean | |
109 | set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i $@; done | |
110 | ||
111 | .PHONY: clean | |
112 | clean: | |
113 | set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i $@; done | |
114 | find . -name '*~' -exec rm {} ';' | |
115 | rm -rf dest country.dat *.deb ca-tmp |