]> git.proxmox.com Git - libarchive-perl.git/blobdiff - Makefile
buildsys: avoid no-pre-clean flag when building DSC
[libarchive-perl.git] / Makefile
index 6f7ae2b23bf1bd1759c4c2498cc375e28dd49ec0..184c53187c51a46e89a646a407994c249d83d614 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,38 +1,64 @@
-RELEASE=4.0
+include /usr/share/dpkg/default.mk
+
+PACKAGE=libarchive-perl
 
 # h2xs -Afn LibArchive
 # h2xs -an LibArchive /usr/include/archive.h /usr/include/archive_entry.h
 # perl Makefile.PL PREFIX=/usr
 
-#OPKGNAME = libarchive-2.2.4
-#DEB = libarchive1_2.2.4-1_i386.deb
-#DEVDEB = libarchive-dev_2.2.4-1_i386.deb
-
 PPSRC = LibArchive
-PDEB = libarchive-perl_3.0.4-1_amd64.deb
-
-all: ${PDEB}
-
-${PDEB}: ${PPSRC}/LibArchive.xs
-       -rm -rf build
-       rsync -a --exclude .svn ${PPSRC}/ build/
-       cp -a debian build
-       cd build; dpkg-buildpackage -b -us -uc -rfakeroot
-       lintian ${PDEB}
-
-.phony: upload
-upload: ${PDEB}
-       umount /proxmox/${RELEASE}; mount /proxmox/${RELEASE} -o rw 
-       mkdir -p /proxmox/${RELEASE}/extra
-       rm -rf /proxmox/${RELEASE}/extra/libarchive1_*.deb
-       rm -rf /proxmox/${RELEASE}/extra/libarchive-dev_*.deb
-       rm -rf /proxmox/${RELEASE}/extra/libarchive-perl_*.deb
-       cp ${PDEB} /proxmox/${RELEASE}/extra
-       cd /proxmox/${RELEASE}/extra; dpkg-scanpackages . /dev/null > Packages; gzip -9c Packages > Packages.gz
-       umount /proxmox/${RELEASE}; mount /proxmox/${RELEASE} -o ro 
-
-CLEANFILES = *~ build *.deb libarchive_* ${OPKGNAME} libarchive-perl_*
-
-.phony: clean
+
+BUILDSRC=$(PACKAGE)-$(DEB_VERSION_UPSTREAM)
+DSC=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION).dsc
+
+DEB=$(PACKAGE)_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb
+DBG_DEB=$(PACKAGE)-dbgsym_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb
+
+all: $(DEB)
+
+.PHONY: update-bindings
+update-bindings:
+       h2xs -M '^(archive|ARCHIVE)_' -v $(DEB_VERSION_UPSTREAM) -On LibArchive /usr/include/archive.h /usr/include/archive_entry.h -larchive
+       echo "Please manually check and add the diff of the automatically generated update"
+
+.PHONY: $(BUILDSRC)
+$(BUILDSRC):
+       rm -rf $@ $@.tmp
+       cp -a $(PPSRC)/ $@.tmp
+       cp -a debian $@.tmp
+       perl -MDevel::PPPort -e 'Devel::PPPort::WriteFile("$@.tmp/ppport.h");'
+       echo "git clone git://git.proxmox.com/git/libarchive-perl\\ngit checkout $(shell git rev-parse HEAD)" >$@.tmp/debian/SOURCE
+       mv $@.tmp $@
+
+.PHONY: dsc
+dsc:
+       $(MAKE) $(DSC)
+       lintian $(DSC)
+
+$(DSC): $(BUILDSRC)
+       cd $(BUILDSRC); dpkg-buildpackage -S -us -uc -d
+
+.PHONY: sbuild
+sbuild: $(DSC)
+       sbuild $(DSC)
+
+.PHONY: deb
+deb: $(DEB)
+$(DBG_DEB): $(DEB)
+$(DEB): $(PPSRC)/LibArchive.xs $(BUILDSRC)
+       cd $(BUILDSRC); dpkg-buildpackage -b -us -uc
+       lintian $(DEB) $(DBG_DEB)
+
+.PHONY: upload
+upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
+upload: $(DEB) $(DBG_DEB)
+       tar cf - $(DEB) $(DBG_DEB) | ssh -X repoman@repo.proxmox.com -- upload --product pmg --dist $(UPLOAD_DIST)
+
+.PHONY: clean
 clean:
-       rm -rf ${CLEANFILES}
+       rm -rf build $(PACKAGE)-[0-9]*/
+       rm -f *.deb *.buildinfo *.build *.dsc *.changes $(PACKAGE)*tar*
+
+.PHONY: dinstall
+dinstall: $(DEB)
+       dpkg -i $(DEB)