Also fixes a minor spelling error in changelog.Debian and extends the .gitignore to ignore build files.
Signed-off-by: René Jochum <r...@jochums.at> --- .gitignore | 7 +++++++ Makefile | 29 ++++++++++++++-------------- changelog.Debian => debian/changelog | 2 +- debian/compat | 1 + control.in => debian/control.in | 9 +++++---- copyright => debian/copyright | 0 debian/rules | 11 +++++++++++ 7 files changed, 39 insertions(+), 20 deletions(-) create mode 100644 .gitignore rename changelog.Debian => debian/changelog (96%) create mode 100644 debian/compat rename control.in => debian/control.in (84%) rename copyright => debian/copyright (100%) create mode 100755 debian/rules diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..70af628 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +RADOS.c +RADOS.so +build/ + +*.buildinfo +*.changes +*.deb diff --git a/Makefile b/Makefile index 2c1451f..c2473a7 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,8 @@ DOCDIR=${PREFIX}/share/doc/${PACKAGE} MAN1DIR=${MANDIR}/man1/ PERLDIR=${PREFIX}/share/perl5 +BUILDDIR=build + PERL_ARCHLIB := `perl -MConfig -e 'print $$Config{archlib};'` PERL_INSTALLVENDORARCH := `perl -MConfig -e 'print $$Config{installvendorarch};'` PERL_APIVER := `perl -MConfig -e 'print $$Config{debian_abi}//$$Config{version};'` @@ -26,7 +28,7 @@ CFLAGS= -shared -fPIC -O2 -Werror -Wtype-limits -Wall -Wl,-z,relro \ PERLSODIR=$(PERL_INSTALLVENDORARCH)/auto ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH) -GITVERSION:=$(shell cat .git/refs/heads/master) +GITVERSION:=$(shell git rev-parse HEAD) DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb @@ -52,23 +54,20 @@ install: PVE/RADOS.pm RADOS.so .PHONY: deb ${DEB} deb: ${DEB} ${DEB}: - rm -rf debian - mkdir debian - make DESTDIR=${CURDIR}/debian install - install -d -m 0755 debian/DEBIAN - sed -e s/@@VERSION@@/${VERSION}/ -e s/@@PKGRELEASE@@/${PKGREL}/ -e s/@@ARCH@@/${ARCH}/ -e "s|@PERLAPI@|perlapi-$(PERL_APIVER)|g" <control.in >debian/DEBIAN/control - install -D -m 0644 copyright debian/${DOCDIR}/copyright - install -m 0644 changelog.Debian debian/${DOCDIR}/ - gzip -9 -n debian/${DOCDIR}/changelog.Debian - echo "git clone git://git.proxmox.com/git/librados2-perl.git\\ngit checkout ${GITVERSION}" > debian/${DOCDIR}/SOURCE - fakeroot dpkg-deb --build debian - mv debian.deb ${DEB} - rm -rf debian + rm -rf ${BUILDDIR} + rsync -ra * ${BUILDDIR} + + sed -e "s|@PERLAPI@|perlapi-$(PERL_APIVER)|g" <debian/control.in >${BUILDDIR}/debian/control + + echo "git clone git://git.proxmox.com/git/librados2-perl.git\\ngit checkout ${GITVERSION}" > ${BUILDDIR}/debian/SOURCE + + cd ${BUILDDIR}; dpkg-buildpackage -b -uc -us + rm -rf build lintian ${DEB} .PHONY: clean -clean: - rm -rf debian *.deb ${PACKAGE}-*.tar.gz dist *.1.pod *.1.gz RADOS.so RADOS.c +clean: + rm -rf ${BUILDDIR} *.deb ${PACKAGE}-*.tar.gz dist *.1.pod *.1.gz RADOS.so RADOS.c find . -name '*~' -exec rm {} ';' .PHONY: distclean diff --git a/changelog.Debian b/debian/changelog similarity index 96% rename from changelog.Debian rename to debian/changelog index 7f4b898..38084e2 100644 --- a/changelog.Debian +++ b/debian/changelog @@ -1,6 +1,6 @@ librados2-perl (1.0-5) unstable; urgency=medium - * allow to specify the userid with rados_create + * allow one to specify the userid with rados_create * split method pve_rados_connect diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..9a03714 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +10 \ No newline at end of file diff --git a/control.in b/debian/control.in similarity index 84% rename from control.in rename to debian/control.in index c2dc77e..5e32cab 100644 --- a/control.in +++ b/debian/control.in @@ -1,9 +1,10 @@ -Package: librados2-perl -Version: @@VERSION@@-@@PKGRELEASE@@ +Source: librados2-perl +Maintainer: Proxmox Support Team <supp...@proxmox.com> Section: perl Priority: optional -Architecture: @@ARCH@@ + +Package: librados2-perl +Architecture: any Depends: libc6 (>= 2.2.5), perl (>= 5.20.1-5), @PERLAPI@, librados2 (>= 0.67.5), libpve-access-control -Maintainer: Proxmox Support Team <supp...@proxmox.com> Description: Perl bindings for librados This package contains librados perl binding used by Proxmox VE. diff --git a/copyright b/debian/copyright similarity index 100% rename from copyright rename to debian/copyright diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..a4652c2 --- /dev/null +++ b/debian/rules @@ -0,0 +1,11 @@ +#!/usr/bin/make -f +# See debhelper(7) (uncomment to enable) +# output every command that modifies files on the build system. +DH_VERBOSE = 1 + + +%: + dh $@ + +override_dh_auto_build: + make RADOS.so -- 2.17.0 _______________________________________________ pve-devel mailing list pve-devel@pve.proxmox.com https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel