]> git.proxmox.com Git - arch-pacman.git/blob - Makefile
buildsys: create buildir atomically
[arch-pacman.git] / Makefile
1 PACKAGE=arch-pacman
2 PACMANVER=5.1.3
3 DEBREL=1
4
5 SRCDIR=pacman
6 SRCTAR=${SRCDIR}.tgz
7
8 ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
9 GITVERSION:=$(shell cat .git/refs/heads/master)
10
11 DEB=${PACKAGE}_${PACMANVER}-${DEBREL}_amd64.deb
12 DEB2=${PACKAGE}-dev_${PACMANVER}-${DEBREL}_amd64.deb \
13 ${PACKAGE}-dbgsym_${PACMANVER}-${DEBREL}_amd64.deb
14
15 DEBS= ${DEB} ${DEB2}
16
17 all: ${DEBS}
18 echo ${DEBS}
19
20 ${SRCDIR}: ${SRCTAR}
21 rm -rf ${SRCDIR}.tmp
22 mkdir ${SRCDIR}.tmp
23 tar xf ${SRCTAR} -C ${SRCDIR}.tmp --strip-components 1
24 cp -a debian ${SRCDIR}.tmp/debian
25 mv ${SRCDIR}.tmp ${SRCDIR}
26
27 .PHONY: builddir
28 builddir:
29 rm -rf ${SRCDIR}
30 $(MAKE) ${SRCDIR}
31
32 ${DEB}: builddir
33 echo "git clone https://gitlab.archlinux.org/pacman/pacman.git\\ngit checkout ${GITVERSION}" > ${SRCDIR}/debian/SOURCE
34 cd ${SRCDIR}; DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -rfakeroot -b -us -uc
35 lintian ${DEBS}
36
37 .PHONY: deb
38 deb ${DEB2}: ${DEB}
39
40 .PHONY: download
41 download: ${SRCTAR}
42 ${SRCTAR}:
43 rm -rf ${SRCDIR} ${SRCTAR} pacman-git
44 git clone --depth=1 --branch=v${PACMANVER} https://gitlab.archlinux.org/pacman/pacman.git pacman-git
45 (cd pacman-git && git archive --prefix=${SRCDIR}/ --format=tar v${PACMANVER}) | gzip > ${SRCTAR}.tmp
46 mv ${SRCTAR}.tmp ${SRCTAR}
47 rm -rf pacman-git
48
49 distclean: clean
50 rm -rf ${SRCDIR} ${SRCTAR} pacman-git
51
52 .PHONY: clean
53 clean:
54 rm -rf ${SRCDIR} ${SRCDIR}.tmp *_${ARCH}.deb *.changes *.dsc *.buildinfo
55 find . -name '*~' -exec rm {} ';'
56
57 .PHONY: dinstall
58 dinstall: ${DEBS}
59 dpkg -i ${DEBS}