summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Grover <agrover@redhat.com>2013-10-20 13:54:19 -0700
committerAndy Grover <agrover@redhat.com>2013-10-20 13:54:19 -0700
commitdd9b56395eda0e4c83696ec9aed46c2cf5b8b5b9 (patch)
treed4998d4a1a954a1cc2c7382572ad2913ba5d8f0e
parent458b951808bd930127e0627e50327ed51cc9d8d4 (diff)
parent801ad4fa0e59f7554acebb5e8dffbe848328cf28 (diff)
downloadconfigshell-fb-dd9b56395eda0e4c83696ec9aed46c2cf5b8b5b9.tar.gz
Merge pull request #10 from JonnyJD/make_deb
update debian packaging
-rw-r--r--Makefile37
-rw-r--r--debian/control36
-rw-r--r--debian/copyright4
-rw-r--r--debian/python-configshell-fb-docs.doc-base9
-rw-r--r--debian/python-configshell-fb.install1
-rw-r--r--debian/python-configshell.dirs1
-rw-r--r--debian/python-configshell.docs4
-rw-r--r--debian/python-configshell.install1
-rwxr-xr-xdebian/python-configshell.postinst17
-rwxr-xr-xdebian/python-configshell.preinst3
-rwxr-xr-xdebian/python-configshell.prerm8
-rw-r--r--debian/python3-configshell-fb.install1
-rw-r--r--debian/pyversions1
-rwxr-xr-xdebian/rules85
-rw-r--r--debian/source/format1
15 files changed, 99 insertions, 110 deletions
diff --git a/Makefile b/Makefile
index dff83ce..7f098b9 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,4 @@
+PKGNAME = configshell-fb
NAME = configshell
GIT_BRANCH = $$(git branch | grep \* | tr -d \*)
VERSION = $$(basename $$(git describe --tags | tr - . | sed 's/^v//'))
@@ -21,11 +22,11 @@ clean:
@rm -fv dpkg-buildpackage.log dpkg-buildpackage.version
@rm -frv *.rpm
@rm -fv debian/files debian/*.log debian/*.substvars
- @rm -frv debian/${NAME}-doc/ debian/python2.5-${NAME}/
- @rm -frv debian/python2.6-${NAME}/ debian/python-${NAME}/
+ @rm -frv debian/${PKGNAME}-doc/ debian/python2.5-${PKGNAME}/
+ @rm -frv debian/python2.6-${PKGNAME}/ debian/python-${PKGNAME}/
@rm -frv results
@rm -fv rpm/*.spec *.spec rpm/sed* sed*
- @rm -frv ${NAME}-*
+ @rm -frv ${PKGNAME}-*
@echo "Finished cleanup."
cleanall: clean
@@ -35,16 +36,16 @@ release: build/release-stamp
build/release-stamp:
@mkdir -p build
@echo "Exporting the repository files..."
- @git archive ${GIT_BRANCH} --prefix ${NAME}-${VERSION}/ \
+ @git archive ${GIT_BRANCH} --prefix ${PKGNAME}-${VERSION}/ \
| (cd build; tar xfp -)
@echo "Cleaning up the target tree..."
- @rm -f build/${NAME}-${VERSION}/Makefile
- @rm -f build/${NAME}-${VERSION}/.gitignore
+ @rm -f build/${PKGNAME}-${VERSION}/Makefile
+ @rm -f build/${PKGNAME}-${VERSION}/.gitignore
@echo "Fixing version string..."
@sed -i "s/__version__ = .*/__version__ = '${VERSION}'/g" \
- build/${NAME}-${VERSION}/${NAME}/__init__.py
+ build/${PKGNAME}-${VERSION}/${NAME}/__init__.py
@echo "Generating rpm specfile from template..."
- @cd build/${NAME}-${VERSION}; \
+ @cd build/${PKGNAME}-${VERSION}; \
for spectmpl in rpm/*.spec.tmpl; do \
sed -i "s/Version:\( *\).*/Version:\1${VERSION}/g" $${spectmpl}; \
mv $${spectmpl} $$(basename $${spectmpl} .tmpl); \
@@ -59,7 +60,7 @@ build/release-stamp:
hash=$$(git show HEAD --format="format:%H" -s); \
echo '* '"$${date} $${author} $${version}-1"; \
echo " - Generated from git commit $${hash}."; \
- ) >> $$(ls build/${NAME}-${VERSION}/*.spec)
+ ) >> $$(ls build/${PKGNAME}-${VERSION}/*.spec)
@echo "Generating debian changelog..."
@( \
version=${VERSION}; \
@@ -71,30 +72,30 @@ build/release-stamp:
date=$$(echo $${date} \
| awk '{print $$1, "'"$${day}"'", $$3, $$4, $$5, $$6}'); \
hash=$$(git show HEAD --format="format:%H" -s); \
- echo "${NAME} ($${version}) unstable; urgency=low"; \
+ echo "${PKGNAME} ($${version}) unstable; urgency=low"; \
echo; \
echo " * Generated from git commit $${hash}."; \
echo; \
echo " -- $${author} $${date}"; \
echo; \
- ) > build/${NAME}-${VERSION}/debian/changelog
- @find build/${NAME}-${VERSION}/ -exec \
+ ) > 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") {} \;
@mkdir -p dist
@cd build; tar -c --owner=0 --group=0 --numeric-owner \
--format=gnu -b20 --quoting-style=escape \
- -f ../dist/${NAME}-${VERSION}.tar \
- $$(find ${NAME}-${VERSION} -type f | sort)
- @gzip -6 -n dist/${NAME}-${VERSION}.tar
+ -f ../dist/${PKGNAME}-${VERSION}.tar \
+ $$(find ${PKGNAME}-${VERSION} -type f | sort)
+ @gzip -6 -n dist/${PKGNAME}-${VERSION}.tar
@echo "Generated release tarball:"
- @echo " $$(ls dist/${NAME}-${VERSION}.tar.gz)"
+ @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/${NAME}-${VERSION}; \
+ @cd build/${PKGNAME}-${VERSION}; \
dpkg-buildpackage -rfakeroot -us -uc
@mv build/*_${VERSION}_*.deb dist/
@echo "Generated debian packages:"
@@ -108,7 +109,7 @@ build/rpm-stamp:
@build=$$(pwd)/build/rpm; dist=$$(pwd)/dist/; rpmbuild \
--define "_topdir $${build}" --define "_sourcedir $${dist}" \
--define "_rpmdir $${build}" --define "_buildir $${build}" \
- --define "_srcrpmdir $${build}" -ba build/${NAME}-${VERSION}/*.spec
+ --define "_srcrpmdir $${build}" -ba build/${PKGNAME}-${VERSION}/*.spec
@mv build/rpm/*-${VERSION}*.src.rpm dist/
@mv build/rpm/*/*-${VERSION}*.rpm dist/
@echo "Generated rpm packages:"
diff --git a/debian/control b/debian/control
index 05bb316..de5a127 100644
--- a/debian/control
+++ b/debian/control
@@ -1,14 +1,32 @@
-Source: configshell
+Source: configshell-fb
Section: python
Priority: optional
-Maintainer: Jerome Martin <jxm@risingtidesystems.com>
-Build-Depends: debhelper(>= 7.0.1), python2.6
-Standards-Version: 3.8.1
+Maintainer: Andy Grover <grover@groveronline.com>
+Build-Depends: debhelper(>= 8), python, python3, python-setuptools, python3-setuptools, python-epydoc, python-pyparsing
+Standards-Version: 3.9.4
+X-Python-Version: >= 2.6
+X-Python3-Version: >= 3.1
-Package: python-configshell
+Package: python-configshell-fb-docs
Architecture: all
-Depends: python (>= 2.6)|python2.6, python-epydoc, python-pyparsing, python-urwid (>=0.9.9)
-Suggests: configshell-doc
-Description: Framework to create CLI interfaces.
+Description: Framework to create CLI interfaces (Documentation).
.
- This package contains the configshell library.
+ This package contains the documentation of the configshell library (free branch).
+
+Package: python-configshell-fb
+Architecture: all
+Depends: ${python:Depends}, ${misc:Depends}, python-pyparsing, python-urwid (>=0.9.9)
+Suggests: python-configshell-fb-docs
+Conflicts: python-configshell
+Provides: ${python:Provides}
+Description: Framework to create CLI interfaces (Python 2).
+ .
+ This package contains the configshell library (free branch).
+
+Package: python3-configshell-fb
+Architecture: all
+Depends: ${python3:Depends}, ${misc:Depends}, python3-pyparsing, python3-urwid (>=0.9.9)
+Suggests: python-configshell-fb-docs
+Description: Framework to create CLI interfaces (Python 3).
+ .
+ This package contains the configshell library (free branch, Python 3).
diff --git a/debian/copyright b/debian/copyright
index 28b41fa..f2c98df 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,6 +1,6 @@
This package was originally debianized by Jerome Martin <jxm@risingtidesystems.com>
-on Thu Sep 09 23:13:01 CET 2010. It is currently maintained by Jerome Martin
-<jxm@risingtidesystems.com>.
+on Thu Sep 09 23:13:01 CET 2010. It is currently maintained by Andy Grover
+<andy@groveronline.com>.
Upstream Author: Jerome Martin <jxm@risingtidesystems.com>
diff --git a/debian/python-configshell-fb-docs.doc-base b/debian/python-configshell-fb-docs.doc-base
new file mode 100644
index 0000000..df6a17a
--- /dev/null
+++ b/debian/python-configshell-fb-docs.doc-base
@@ -0,0 +1,9 @@
+Document: python-configshell-fb
+Title: python-configshell documentation
+Author: Jerome Martin <jxm@risingtidesystems.com>
+Abstract: configshell is a library which is used to create cli interfaces
+Section: Programming/Python
+
+Format: HTML
+Index: /usr/share/doc/python-configshell-fb-docs/html/index.html
+Files: /usr/share/doc/python-configshell-fb-docs/html/*.html
diff --git a/debian/python-configshell-fb.install b/debian/python-configshell-fb.install
new file mode 100644
index 0000000..b2cc136
--- /dev/null
+++ b/debian/python-configshell-fb.install
@@ -0,0 +1 @@
+usr/lib/python2*
diff --git a/debian/python-configshell.dirs b/debian/python-configshell.dirs
deleted file mode 100644
index 145429c..0000000
--- a/debian/python-configshell.dirs
+++ /dev/null
@@ -1 +0,0 @@
-usr/share/python-support
diff --git a/debian/python-configshell.docs b/debian/python-configshell.docs
deleted file mode 100644
index 5686710..0000000
--- a/debian/python-configshell.docs
+++ /dev/null
@@ -1,4 +0,0 @@
-README.md
-COPYING
-doc/html
-examples/myshell
diff --git a/debian/python-configshell.install b/debian/python-configshell.install
deleted file mode 100644
index 69bb674..0000000
--- a/debian/python-configshell.install
+++ /dev/null
@@ -1 +0,0 @@
-lib/configshell usr/share/python-support
diff --git a/debian/python-configshell.postinst b/debian/python-configshell.postinst
deleted file mode 100755
index b56990a..0000000
--- a/debian/python-configshell.postinst
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh
-for lib in lib lib64; do
- for python in python2.6; do
- if [ -e /usr/${lib}/${python} ]; then
- if [ ! -e /usr/${lib}/${python}/configshell ]; then
- mkdir /usr/${lib}/${python}/configshell
- for source in /usr/share/python-support/configshell/configshell/*.py; do
- ln -sf ${source} /usr/${lib}/${python}/configshell/
- done
- python_path=$(which ${python} 2>/dev/null)
- if [ ! -z $python_path ]; then
- ${python} -c "import compileall; compileall.compile_dir('/usr/${lib}/${python}/configshell', force=1)"
- fi
- fi
- fi
- done
-done
diff --git a/debian/python-configshell.preinst b/debian/python-configshell.preinst
deleted file mode 100755
index b96bf44..0000000
--- a/debian/python-configshell.preinst
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-rm -f /usr/share/python-support/configshell/configshell/*.pyc
-rm -f /usr/share/python-support/configshell/configshell/*.pyo
diff --git a/debian/python-configshell.prerm b/debian/python-configshell.prerm
deleted file mode 100755
index 866a5c2..0000000
--- a/debian/python-configshell.prerm
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-for lib in lib lib64; do
- for python in python2.6; do
- if [ -e /usr/${lib}/${python}/configshell ]; then
- rm -rf /usr/${lib}/${python}/configshell
- fi
- done
-done
diff --git a/debian/python3-configshell-fb.install b/debian/python3-configshell-fb.install
new file mode 100644
index 0000000..4606faa
--- /dev/null
+++ b/debian/python3-configshell-fb.install
@@ -0,0 +1 @@
+usr/lib/python3*
diff --git a/debian/pyversions b/debian/pyversions
deleted file mode 100644
index 0c043f1..0000000
--- a/debian/pyversions
+++ /dev/null
@@ -1 +0,0 @@
-2.6-
diff --git a/debian/rules b/debian/rules
index d9a49a1..ce1f43f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,53 +1,46 @@
#!/usr/bin/make -f
-build_dir = build
-install_dir = debian/tmp
-setup = /usr/bin/python ./setup.py --quiet
+build_dir = build
+install_dir = $(CURDIR)/debian/tmp
+pkgname = configshell-fb
name = configshell
-binary: binary-indep
-
-binary-arch:
-
-binary-indep: build install
- dh_testdir
- dh_testroot
- dh_installchangelogs
- dh_installdocs
- dh_installman
- dh_install --list-missing --sourcedir $(install_dir)
- dh_fixperms
- dh_compress -X.py
- dh_installdeb
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-install: build
- dh_testdir
- dh_testroot
- dh_installdirs
-
-build: build-stamp
-build-stamp:
- dh_testdir
- $(setup) build --build-base $(build_dir) install --no-compile --install-purelib $(install_dir)/lib/configshell --install-scripts $(install_dir)/bin
- echo "2.6" > $(install_dir)/lib/configshell/.version
- mkdir -p $(build_dir) doc/
- cd $(build_dir); epydoc --no-sourcecode --html -n $(name) \
- --exclude configobj ../$(name)/*.py
- cp -r $(build_dir)/html doc/
- touch build-stamp
+#export DH_VERBOSE=1
+
+PYTHON2=$(shell pyversions -vr)
+PYTHON3=$(shell py3versions -vr)
+
+# prevent internet access to use PyPi
+export http_proxy = http://127.0.0.1:9
+
+
+%:
+ echo "debug dh: $@"
+ dh $@ --with python2,python3
+
-clean:
- dh_testdir
- dh_testroot
- rm -f build-stamp
- $(setup) clean
- find . -name "*.pyc" | xargs rm -f
- find . -name "*.pyo" | xargs rm -f
- rm -rf $(build_dir) $(install_dir)
- dh_clean
+build-python%:
+ echo "debug: $@"
+ python$* setup.py build
-.PHONY: binary binary-indep install build clean
+override_dh_auto_build: $(PYTHON3:%=build-python%)
+ dh_auto_build
+
+
+install-python%:
+ echo "debug: $@"
+ python$* setup.py install --root=$(install_dir) --install-layout=deb
+
+override_dh_auto_install: $(PYTHON3:%=install-python%)
+ dh_auto_install
+
+
+override_dh_installdocs:
+ cd $(build_dir); epydoc --no-sourcecode --html -n $(pkgname) \
+ --exclude configobj ../$(name)/*.py
+ dh_installdocs $(build_dir)/html
+override_dh_auto_clean:
+ dh_auto_clean
+ rm -rf build
+ rm -rf *.egg-info
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..89ae9db
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (native)