]> git.proxmox.com Git - pve-manager.git/blame - Makefile
trim subscription key to avoid unexpected errors.
[pve-manager.git] / Makefile
CommitLineData
beb651ee
DM
1include defines.mk
2
3DESTDIR=
4
5#SUBDIRS = bin lib www aplinfo
2198a479 6SUBDIRS = aplinfo PVE bin www po
beb651ee 7
46c17bd2 8ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
d8c0a121 9GITVERSION:=$(shell cat .git/refs/heads/master)
46c17bd2
DM
10
11DEB=${PACKAGE}_${VERSION}-${PACKAGERELEASE}_${ARCH}.deb
beb651ee
DM
12
13all: ${SUBDIRS}
14
53f13052
DM
15check:
16 ${MAKE} -C bin/test check
17
beb651ee
DM
18%:
19 set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i $@; done
20
12691bc5
DM
21pve-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 >../$@
beb651ee
DM
27
28.PHONY: dinstall
29dinstall: ${DEB}
30 dpkg -i ${DEB}
31
32country.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/postinst dest/DEBIAN
47 install -m 0755 debian/prerm dest/DEBIAN
48 install -m 0755 debian/postrm dest/DEBIAN
49 install -m 0644 debian/triggers dest/DEBIAN
d8c0a121 50 echo "git clone git://git.proxmox.com/git/pve-manager.git\\ngit checkout ${GITVERSION}" > dest/usr/share/doc/${PACKAGE}/SOURCE
beb651ee
DM
51 gzip --best dest/usr/share/man/*/*
52 gzip --best dest/usr/share/doc/${PACKAGE}/changelog.Debian
53 dpkg-deb --build dest
54 mv dest.deb ${DEB}
55 rm -rf dest
46c17bd2
DM
56 # supress lintian error: statically-linked-binary usr/bin/pvemailforward
57 lintian -X binaries ${DEB}
beb651ee
DM
58
59.PHONY: upload
53f13052 60upload: ${DEB} check
e38a88ca 61 ./repoid.pl .git check
beb651ee
DM
62 umount /pve/${RELEASE}; mount /pve/${RELEASE} -o rw
63 mkdir -p /pve/${RELEASE}/extra
64 rm -f /pve/${RELEASE}/extra/${PACKAGE}_*.deb
65 rm -f /pve/${RELEASE}/extra/Packages*
66 cp ${DEB} /pve/${RELEASE}/extra
67 cd /pve/${RELEASE}/extra; dpkg-scanpackages . /dev/null > Packages; gzip -9c Packages > Packages.gz
68 umount /pve/${RELEASE}; mount /pve/${RELEASE} -o ro
69
70#.PHONY: poupload
71#poupload:
72# rsync po/*.po po/pve-manager.pot pve.proxmox.com:/home/ftp/sources/po-files/
73
efd7913a
DM
74.PHONY: aplupload
75aplupload:
76 ./aplinfo/apltest.pl
77 gpg -bas -u support@proxmox.com aplinfo/aplinfo.dat
78 gzip -c aplinfo/aplinfo.dat > aplinfo.dat.gz
79 scp aplinfo/aplinfo.dat aplinfo.dat.gz aplinfo/aplinfo.dat.asc download1.proxmox.com:/home/ftp/appliances/
beb651ee
DM
80
81.PHONY: install
c7bee4c6 82install: country.dat vznet.conf vzdump.conf vzdump-hook-script.pl pve-apt.conf pve-repo-ca-certificates.crt mtu
3dad8dc7
DM
83 install -d -m 0700 -o www-data -g www-data ${DESTDIR}/var/log/pveproxy
84 install -D -m 0644 debian/pve.logrotate ${DESTDIR}/etc/logrotate.d/pve
beb651ee
DM
85 install -d ${DESTDIR}/usr/share/${PACKAGE}
86 install -d ${DESTDIR}/usr/share/man/man1
9ff497a9 87 install -d ${DOCDIR}/examples
beb651ee
DM
88 install -d ${DESTDIR}/var/lib/${PACKAGE}
89 install -d ${DESTDIR}/var/lib/vz/images
90 install -d ${DESTDIR}/var/lib/vz/template/cache
91 install -d ${DESTDIR}/var/lib/vz/template/iso
92 install -d ${DESTDIR}/var/lib/vz/template/qemu
b628df18 93 install -D -m 0644 pve-apt.conf ${DESTDIR}/etc/apt/apt.conf.d/75pveconf
6765686f 94 install -D -m 0644 pve-sources.list ${DESTDIR}/etc/apt/sources.list.d/pve-enterprise.list
12691bc5 95 install -D -m 0644 pve-repo-ca-certificates.crt ${DESTDIR}/etc/apt/pve-repo-ca-certificates.crt
9683831e 96 install -D -m 0644 vzdump.conf ${DESTDIR}/etc/vzdump.conf
beb651ee 97 install -D -m 0755 vznet.conf ${DESTDIR}/etc/vz/vznet.conf
c7bee4c6 98 install -D -m 0755 mtu ${DESTDIR}/etc/network/if-up.d/mtu
9ff497a9 99 install -m 0644 vzdump-hook-script.pl ${DOCDIR}/examples/vzdump-hook-script.pl
072188dc 100 install -m 0644 spice-example-sh ${DOCDIR}/examples/spice-example-sh
9ff497a9
DM
101 install -m 0644 copyright ${DOCDIR}
102 install -m 0644 debian/changelog.Debian ${DOCDIR}
beb651ee
DM
103 install -m 0644 country.dat ${DESTDIR}/usr/share/${PACKAGE}
104 set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i $@; done
105
106.PHONY: distclean
107distclean: clean
108 set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i $@; done
109
110.PHONY: clean
111clean:
112 set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i $@; done
113 find . -name '*~' -exec rm {} ';'
12691bc5 114 rm -rf dest country.dat *.deb ca-tmp