From: Walter Doekes Date: Thu, 3 Dec 2015 13:11:33 +0000 (+0100) Subject: Create repository ready `make deb` build. X-Git-Tag: v0.3~15^2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=8709f55df42e8e5e2a9beafdf49aa434d62a3467;p=users%2Fsagi%2Fnvme-cli.git Create repository ready `make deb` build. When running `make deb` on `wheezy` with version `0.2.5.ga6ce` it creates these files: nvme-cli_0.2.5.ga6ce-1~wheezy_amd64.changes nvme-cli_0.2.5.ga6ce-1~wheezy_amd64.deb nvme-cli_0.2.5.ga6ce-1~wheezy.debian.tar.gz nvme-cli_0.2.5.ga6ce-1~wheezy.dsc nvme-cli_0.2.5.ga6ce.orig.tar.gz These can be included in your package archive, so they can be fetched through apt-get. --- diff --git a/.gitignore b/.gitignore index ab1d930d..e971d876 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,9 @@ a.out *.o *~ NVME-VERSION-FILE + +/debian/changelog +/debian/files +/debian/nvme-cli.debhelper.log +/debian/nvme-cli.substvars +/debian/nvme-cli diff --git a/Makefile b/Makefile index b550fb90..021fa1ae 100644 --- a/Makefile +++ b/Makefile @@ -81,10 +81,19 @@ pkg: control nvme.control.in cp nvme nvme-$(NVME_VERSION)$(SBINDIR) cp control nvme-$(NVME_VERSION)/DEBIAN/ -deb: $(NVME) pkg nvme.control.in +deb: + git archive --format=tar --prefix=nvme-cli-$(NVME_VERSION)/ HEAD \ + | gzip -9 > ../nvme-cli_$(NVME_VERSION).orig.tar.gz + printf '%s\n\n * Auto-release.\n\n %s\n' \ + "nvme-cli ($(NVME_VERSION)-1~`lsb_release -sc`) `lsb_release -sc`; urgency=low" \ + "-- Keith Busch `git log -1 --format=%aD`" \ + > debian/changelog + dpkg-buildpackage -uc -us -sa # from dpkg-dev package + +deb-light: $(NVME) pkg nvme.control.in dpkg-deb --build nvme-$(NVME_VERSION) rpm: dist $(RPMBUILD) -ta nvme-$(NVME_VERSION).tar.gz -.PHONY: default all doc clean clobber install install-bin install-man rpm deb FORCE +.PHONY: default all doc clean clobber install install-bin install-man rpm deb deb-light FORCE diff --git a/debian/compat b/debian/compat new file mode 100644 index 00000000..ec635144 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 00000000..685cc775 --- /dev/null +++ b/debian/control @@ -0,0 +1,15 @@ +Source: nvme-cli +Maintainer: Keith Busch +Section: admin +Priority: optional +Standards-Version: 3.9.4 +Build-Depends: debhelper (>= 9), libudev-dev + +Package: nvme-cli +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, libudev0 | libudev1 +Description: User space tooling to control NVMe drives. + NVMe is a fast, scalable, direct attached storage interface, accessing + solid state drivers through PCIe. + . + The nvme CLI contains core management tools with minimal dependencies. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 00000000..7d22fa37 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,7 @@ +Copyright © 2014-2015 Intel Corporation + +License: + +On Debian systems, the complete text of the GNU General Public 2 License +can be found in ‘/usr/share/common-licenses/GPL-2’ or in the dpkg source +as the file ‘LICENSE’. diff --git a/debian/rules b/debian/rules new file mode 100755 index 00000000..9bd0f727 --- /dev/null +++ b/debian/rules @@ -0,0 +1,20 @@ +#!/usr/bin/make -f + +%: + dh $@ + +override_dh_auto_build: + # Remove "-lm" from LDFLAGS, because dpkg-shlibdeps says it's + # a useless dependency. Add hardening flags to both CFLAGS + # (with CPPFLAGS) and LDFLAGS. + $(MAKE) DESTDIR=$$(pwd)/debian/nvme-cli \ + CFLAGS="-I./src $(shell dpkg-buildflags --get CFLAGS) \ + -m64 -std=gnu99 -O2 -g -pthread \ + $(shell dpkg-buildflags --get CPPFLAGS) \ + -DLIBUDEV_EXISTS -D_GNU_SOURCE -D_REENTRANT -Wall -Werror" \ + LDFLAGS="$(shell dpkg-buildflags --get LDFLAGS) -ludev" \ + nvme + +override_dh_auto_install: + # Fix that it installs to /usr instead of /usr/local. + $(MAKE) DESTDIR=$$(pwd)/debian/nvme-cli PREFIX=/usr install diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 00000000..163aaf8d --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt)