]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
Add deb package target
authorKeith Busch <keith.busch@intel.com>
Mon, 19 Oct 2015 19:33:01 +0000 (13:33 -0600)
committerKeith Busch <keith.busch@intel.com>
Mon, 19 Oct 2015 19:33:01 +0000 (13:33 -0600)
Note the make clean looks a little dangerous here. Just to be aware of
if we ever name a file or directory "nvme-<something" in the future.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Makefile
nvme.control.in [new file with mode: 0644]

index b89ad7fd1d124d468c34aa4668d8f493ec4f6217..b61dbd62c37729d634354e0c7b36f3e91faafcf1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -49,7 +49,8 @@ doc: $(NVME)
 all: doc
 
 clean:
-       rm -f $(NVME) *.o *~ a.out NVME-VERSION-FILE *.tar* nvme.spec version
+       rm -f $(NVME) *.o *~ a.out NVME-VERSION-FILE *.tar* nvme.spec version control nvme-*.deb
+       rm -rf nvme-*
        $(MAKE) -C Documentation clean
 
 clobber: clean
@@ -74,7 +75,22 @@ dist: nvme.spec
        $(TAR) rf  nvme-$(NVME_VERSION).tar nvme.spec version
        gzip -f -9 nvme-$(NVME_VERSION).tar
 
+control: nvme.control.in NVME-VERSION-FILE
+       sed -e 's/@@VERSION@@/$(NVME_VERSION)/g' < $< > $@+
+       mv $@+ $@
+
+pkg: control
+       mkdir -p nvme-$(NVME_VERSION)$(SBINDIR)
+       mkdir -p nvme-$(NVME_VERSION)$(PREFIX)/share/man/man1
+       mkdir -p nvme-$(NVME_VERSION)/DEBIAN/
+       cp Documentation/*.1 nvme-$(NVME_VERSION)$(PREFIX)/share/man/man1
+       cp nvme nvme-$(NVME_VERSION)$(SBINDIR)
+       cp control nvme-$(NVME_VERSION)/DEBIAN/
+
+deb: $(NVME) pkg
+       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 FORCE
+.PHONY: default all doc clean clobber install install-bin install-man rpm deb FORCE
diff --git a/nvme.control.in b/nvme.control.in
new file mode 100644 (file)
index 0000000..7ba59fd
--- /dev/null
@@ -0,0 +1,9 @@
+Package: nvme
+Version: @@VERSION@@
+Section: base
+Priority: optional
+Architecture: i386
+Depends:
+Maintainer: Keith Busch <keith.bsuch@intel.com>
+Description: NVM-Express Command Line Interface
+ The nvme management tool