]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
Create repository ready `make deb` build.
authorWalter Doekes <wjdoekes@osso.nl>
Thu, 3 Dec 2015 13:11:33 +0000 (14:11 +0100)
committerWalter Doekes <wjdoekes@osso.nl>
Thu, 3 Dec 2015 13:37:15 +0000 (14:37 +0100)
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.

.gitignore
Makefile
debian/compat [new file with mode: 0644]
debian/control [new file with mode: 0644]
debian/copyright [new file with mode: 0644]
debian/rules [new file with mode: 0755]
debian/source/format [new file with mode: 0644]

index ab1d930d58170adcb7acdaf630975a31917cad16..e971d8769dc43f11e39d2789533dd15b5fd9a3eb 100644 (file)
@@ -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
index b550fb900685d3ab2b5d3c6b704beec5cdf3ce71..021fa1ae8c5b2b273d5a05990ceb1a191912c999 100644 (file)
--- 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 <keith.busch@intel.com>  `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 (file)
index 0000000..ec63514
--- /dev/null
@@ -0,0 +1 @@
+9
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..685cc77
--- /dev/null
@@ -0,0 +1,15 @@
+Source: nvme-cli
+Maintainer: Keith Busch <keith.busch@intel.com>
+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 (file)
index 0000000..7d22fa3
--- /dev/null
@@ -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 (executable)
index 0000000..9bd0f72
--- /dev/null
@@ -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 (file)
index 0000000..163aaf8
--- /dev/null
@@ -0,0 +1 @@
+3.0 (quilt)