]> git.proxmox.com Git - libarchive-perl.git/blob - Makefile
buildsys: only call lintian for phony dsc target
[libarchive-perl.git] / Makefile
1 include /usr/share/dpkg/pkg-info.mk
2
3 PACKAGE=libarchive-perl
4
5 # h2xs -Afn LibArchive
6 # h2xs -an LibArchive /usr/include/archive.h /usr/include/archive_entry.h
7 # perl Makefile.PL PREFIX=/usr
8
9 PPSRC = LibArchive
10
11 ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
12 GITVERSION:=$(shell git rev-parse HEAD)
13
14 BUILDSRC=$(PACKAGE)-$(DEB_VERSION_UPSTREAM)
15 DEB=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION)_$(ARCH).deb
16 DSC=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION).dsc
17
18 all: $(DEB)
19
20 .PHONY: update-bindings
21 update-bindings:
22 h2xs -M '^(archive|ARCHIVE)_' -v $(DEB_VERSION_UPSTREAM) -On LibArchive /usr/include/archive.h /usr/include/archive_entry.h -larchive
23 echo "Please manually check and add the diff of the automatically generated update"
24
25 .PHONY: $(BUILDSRC)
26 $(BUILDSRC):
27 rm -rf $(BUILDSRC)
28 cp -a $(PPSRC)/ $(BUILDSRC)
29 cp -a debian $(BUILDSRC)
30 perl -MDevel::PPPort -e 'Devel::PPPort::WriteFile("$(BUILDSRC)/ppport.h");'
31 echo "git clone git://git.proxmox.com/git/pve-storage.git\\ngit checkout $(GITVERSION)" >$(BUILDSRC)/debian/SOURCE
32
33 .PHONY: dsc
34 dsc:
35 $(MAKE) $(DSC)
36 lintian $(DSC)
37
38 $(DSC): $(BUILDSRC)
39 cd $(BUILDSRC); dpkg-buildpackage -S -us -uc -d -nc
40
41 .PHONY: sbuild
42 sbuild: $(DSC)
43 sbuild $(DSC)
44
45 .PHONY: deb
46 deb: $(DEB)
47 $(DEB): $(PPSRC)/LibArchive.xs $(BUILDSRC)
48 cd $(BUILDSRC); dpkg-buildpackage -b -us -uc -rfakeroot
49 lintian $(DEB)
50
51 .phony: upload
52 upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
53 upload: $(DEB)
54 tar cf - $(DEB) | ssh -X repoman@repo.proxmox.com -- upload --product pmg --dist $(UPLOAD_DIST)
55
56 CLEANFILES = *~ build *.deb libarchive_* libarchive-perl_* $(BUILDSRC) *.buildinfo *.build *.dsc *tar.?z
57
58 .phony: clean
59 clean:
60 rm -rf $(CLEANFILES)
61
62 .PHONY: dinstall
63 dinstall: $(DEB)
64 dpkg -i $(DEB)