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