]> git.proxmox.com Git - libxdgmime-perl.git/blob - Makefile
buildsys: add dsc and sbuild targets
[libxdgmime-perl.git] / Makefile
1 include /usr/share/dpkg/pkg-info.mk
2 include /usr/share/dpkg/architecture.mk
3
4 PACKAGE=libxdgmime-perl
5
6 DEB = ${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}_${DEB_BUILD_ARCH}.deb
7 DSC = ${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}.dsc
8 BUILDSRC=${PACKAGE}-${DEB_VERSION_UPSTREAM}
9
10 OPKGNAME=Xdgmime
11 UPSTREAM=xdgmime-source/src
12
13 all: ${DEB}
14 .PHONY: update-bindings
15 update-bindings:
16 cp -a ${UPSTREAM}/xdgmime*.[ch] ${OPKGNAME}/
17 h2xs -P -v ${DEB_VERSION_UPSTREAM} -F -DHAVE_MMAP -M '^XDG_' -t PV -Ofan Xdgmime xdgmime.h
18 rm -f ${OPKGNAME}/xdgmime*.[ch]
19 echo "Please manually check and add the diff of the automatically generated update"
20
21 .PHONY: ${BUILDSRC}
22 ${BUILDSRC}:
23 -rm -rf ${BUILDSRC}
24 cp -a ${OPKGNAME} ${BUILDSRC}
25 cp -a ${UPSTREAM}/xdgmime*.[ch] ${BUILDSRC}/
26 perl -MDevel::PPPort -e 'Devel::PPPort::WriteFile("${BUILDSRC}/ppport.h");'
27 cp -a debian ${BUILDSRC}
28
29 .PHONY: dsc
30 dsc: ${DSC}
31 ${DSC}: ${BUILDSRC}
32 cd ${BUILDSRC}; dpkg-buildpackage -S -us -uc -d -nc
33 lintian ${DSC}
34
35 .PHONY: sbuild
36 sbuild: $(DSC)
37 sbuild $(DSC)
38
39 .PHONY: deb
40 deb: ${DEB}
41 ${DEB}: ${OPKGNAME}/Xdgmime.xs ${BUILDSRC}
42 cd ${BUILDSRC}; dpkg-buildpackage -b -us -uc
43 lintian ${DEB}
44
45 .PHONY: upload
46 upload: ${DEB}
47 tar cf - ${DEB} | ssh -X repoman@repo.proxmox.com -- upload --product pmg --dist stretch
48
49
50 CLEANFILES = *~ debian/*~ *.deb ${BUILDSRC} libxdgmime-perl* *.buildinfo *.build *.dsc *tar.?z
51
52 .PHONY: clean
53 clean:
54 rm -rf ${CLEANFILES}
55
56 .PHONY: dinstall
57 dinstall: ${DEB}
58 dpkg -i ${DEB}