-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
95 lines (73 loc) · 2.14 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
include /usr/share/dpkg/pkg-info.mk
PACKAGE=dab
BUILDDIR ?= ${PACKAGE}-${DEB_VERSION_UPSTREAM}
SCRIPTS= \
scripts/init.pl \
scripts/defenv \
scripts/mysql_randompw \
scripts/init_urandom \
scripts/ssh_gen_host_keys
GITVERSION:=$(shell git rev-parse HEAD)
DEB=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}_all.deb
DSC=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}.dsc
DESTDIR=
PREFIX=/usr
DATADIR=${DESTDIR}/${PREFIX}/lib/${PACKAGE}
SBINDIR=${DESTDIR}/${PREFIX}/sbin
MANDIR=${DESTDIR}/${PREFIX}/share/man
DOCDIR=${DESTDIR}/${PREFIX}/share/doc/${PACKAGE}
PODDIR=${DOCDIR}/pod
MAN1DIR=${MANDIR}/man1/
PERLDIR=${DESTDIR}/${PREFIX}/share/perl5/
# avoid build loops, as we have nor real folder structure here
all:
.PHONY: dinstall
dinstall: deb
dpkg -i ${DEB}
test: PVE/DAB.pm dab
perl -I . -wc dab
perl -wc PVE/DAB.pm
.PHONY: install
install: dab dab.1 dab.1.pod PVE/DAB.pm devices.tar.gz ${SCRIPTS}
install -d ${SBINDIR}
install -m 0755 dab ${SBINDIR}
install -d ${MAN1DIR}
install -m 0644 dab.1 ${MAN1DIR}
gzip -n -f9 ${MAN1DIR}/dab.1
install -d ${PODDIR}
install -m 0644 dab.1.pod ${PODDIR}
install -D -m 0644 PVE/DAB.pm ${PERLDIR}/PVE/DAB.pm
install -d ${DATADIR}/scripts
install -m 0755 ${SCRIPTS} ${DATADIR}/scripts
install -m 0644 devices.tar.gz ${DATADIR}
${BUILDDIR}:
rm -rf ${BUILDDIR}
rsync -a * ${BUILDDIR}
echo "git clone git://git.proxmox.com/git/dab.git\\ngit checkout ${GITVERSION}" > ${BUILDDIR}/debian/SOURCE
.PHONY: deb
deb: ${DEB}
${DEB}: ${BUILDDIR}
cd ${BUILDDIR}; dpkg-buildpackage -b -us -uc
lintian ${DEB}
.PHONY: dsc
dsc: ${DSC}
${DSC}: ${BUILDDIR}
cd ${BUILDDIR}; dpkg-buildpackage -S -us -uc -d -nc
lintian ${DSC}
dab.pdf: dab.1
groff -man dab.1 |ps2pdf - > dab.pdf
dab.1.pod: dab
podselect $< > [email protected]
mv [email protected] $@
dab.1: dab.1.pod
rm -f $@
pod2man -n $< -s 1 -r ${DEB_VERSION_UPSTREAM} <$< >[email protected]
mv [email protected] $@
.PHONY: clean
clean:
rm -rf ${PACKAGE}-*/ *.deb *.dsc dab_*.tar.gz dab.1 dab.1.pod dab.pdf *.tmp *.changes *.buildinfo *~
.PHONY: distclean
distclean: clean
.PHONY: upload
upload: ${DEB}
tar cf - ${DEB} | ssh -X [email protected] -- upload --product pve --dist bookworm