]> www.infradead.org Git - users/hch/nvmetcli.git/commitdiff
add Debian packaging
authorChristoph Hellwig <hch@lst.de>
Wed, 1 Jun 2016 17:09:38 +0000 (19:09 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 1 Jun 2016 18:32:01 +0000 (20:32 +0200)
Signed-off-by: Christoph Hellwig <hch@lst.de>
Makefile
debian/compat [new file with mode: 0644]
debian/control [new file with mode: 0644]
debian/copyright [new file with mode: 0644]
debian/dirs [new file with mode: 0644]
debian/docs [new file with mode: 0644]
debian/install [new file with mode: 0644]
debian/nvmetcli.examples [new file with mode: 0644]
debian/pyversions [new file with mode: 0644]
debian/rules [new file with mode: 0755]

index 83d599c2314ebe3379395318aa622379ae3db27a..e13005c67b1bbaf09d3f4d9da7b8296290c674d8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -38,6 +38,24 @@ build/release-stamp:
        @echo "Fixing version string..."
        @sed -i "s/__version__ = .*/__version__ = '${VERSION}'/g" \
                build/${PKGNAME}-${VERSION}/${NAME}/__init__.py
+       @echo "Generating debian changelog..."
+       @( \
+               version=${VERSION}; \
+               author=$$(git show HEAD --format="format:%an <%ae>" -s); \
+               date=$$(git show HEAD --format="format:%aD" -s); \
+               day=$$(git show HEAD --format='format:%ai' -s \
+                       | awk '{print $$1}' \
+                       | awk -F '-' '{print $$3}' | sed 's/^0/ /g'); \
+               date=$$(echo $${date} \
+                       | awk '{print $$1, "'"$${day}"'", $$3, $$4, $$5, $$6}'); \
+               hash=$$(git show HEAD --format="format:%H" -s); \
+               echo "${PKGNAME} ($${version}) unstable; urgency=low"; \
+               echo; \
+               echo "  * Generated from git commit $${hash}."; \
+               echo; \
+               echo " -- $${author}  $${date}"; \
+               echo; \
+       ) > build/${PKGNAME}-${VERSION}/debian/changelog
        @find build/${PKGNAME}-${VERSION}/ -exec \
                touch -t $$(date -d @$$(git show -s --format="format:%at") \
                        +"%Y%m%d%H%M.%S") {} \;
@@ -50,3 +68,13 @@ build/release-stamp:
        @echo "Generated release tarball:"
        @echo "    $$(ls dist/${PKGNAME}-${VERSION}.tar.gz)"
        @touch build/release-stamp
+
+deb: release build/deb-stamp
+build/deb-stamp:
+       @echo "Building debian packages..."
+       @cd build/${PKGNAME}-${VERSION}; \
+               dpkg-buildpackage -rfakeroot -us -uc
+       @mv build/*_${VERSION}_*.deb dist/
+       @echo "Generated debian packages:"
+       @for pkg in $$(ls dist/*_${VERSION}_*.deb); do echo "  $${pkg}"; done
+       @touch build/deb-stamp
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..d8eaa3b
--- /dev/null
@@ -0,0 +1,14 @@
+Source: nvmetcli
+Section: python
+Priority: optional
+Maintainer: Christoph Hellwig <hch@lst.de>
+Build-Depends: debhelper(>= 8), python, python-setuptools, dh-python
+Standards-Version: 3.9.4
+
+Package: nvmetcli
+Architecture: all
+Depends: ${misc:Depends}, ${python:Depends}, python-configshell-fb, python-kmodpy
+Description: Command line interface for the kernel NVMe target
+ This package contains the command line interface to the NVMe over Fabrics
+ target in the Linux kernel.  It allows configuring the target interactively
+ as well as saving / restoring the configuration to / from a json file.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644 (file)
index 0000000..037d343
--- /dev/null
@@ -0,0 +1,22 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: nvmetcli
+
+Files: *
+ Copyright (c) 2011-2013 by Datera, Inc.
+ Copyright (c) 2011-2014 by Red Hat, Inc.
+ Copyright (c) 2016 by HGST, a Western Digital Company.
+License: Apache-2.0
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ License for the specific language governing permissions and limitations
+ under the License.
+
+ The full text of the license can be found in
+ '/usr/share/common-licenses/Apache-2.0'.
diff --git a/debian/dirs b/debian/dirs
new file mode 100644 (file)
index 0000000..f2800fb
--- /dev/null
@@ -0,0 +1 @@
+/etc/nvmet
diff --git a/debian/docs b/debian/docs
new file mode 100644 (file)
index 0000000..e845566
--- /dev/null
@@ -0,0 +1 @@
+README
diff --git a/debian/install b/debian/install
new file mode 100644 (file)
index 0000000..33bc693
--- /dev/null
@@ -0,0 +1 @@
+nvmetcli               /usr/sbin
diff --git a/debian/nvmetcli.examples b/debian/nvmetcli.examples
new file mode 100644 (file)
index 0000000..966124f
--- /dev/null
@@ -0,0 +1,2 @@
+loop.json
+rdma.json
diff --git a/debian/pyversions b/debian/pyversions
new file mode 100644 (file)
index 0000000..3ad2293
--- /dev/null
@@ -0,0 +1 @@
+2.7-
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..c21e5a2
--- /dev/null
@@ -0,0 +1,22 @@
+#!/usr/bin/make -f
+
+build_dir   = build
+install_dir = $(CURDIR)/debian/nvmetcli
+
+# prevent internet access / don't use PyPi
+export http_proxy = http://127.0.0.1:9
+
+
+%:
+       dh $@ --with python2
+
+override_dh_auto_build:
+       python setup.py build
+
+override_dh_auto_install:
+       python setup.py install --root=$(install_dir) --install-layout=deb
+
+override_dh_auto_clean:
+       dh_auto_clean
+       rm -rf build
+       rm -rf *.egg-info