From e2c5e356cb0c8c9e9089795b1a04a7927e9f8ad8 Mon Sep 17 00:00:00 2001
From: Jerome Martin <jxm@risingtidesystems.com>
Date: Tue, 18 Oct 2011 22:21:04 +0200
Subject: [PATCH] Cleaned up packaging

* Merged doc with main package.
* Not generating pdf anymore, HTML doc is better and cross-referenced anyway
  and the PDF generation was too dependent on LaTeX distributions which caused
  endless issues on several systems.
* Renamed redhat/ into rpm/, as we also try to aim for SuSe compat, so the old
  name wasn't making sense anymore.
* Added install prefix explicitely to specfile, needed on OpenSuSe, whose
  default is /usr/local instead of /usr
---
 Makefile                            |    8 ++--
 debian/configshell-doc.docs         |    5 ---
 debian/control                      |   12 +------
 debian/python-configshell.docs      |    1 +
 debian/rules                        |    5 +--
 redhat/python-configshell.spec.tmpl |   59 -----------------------------------
 rpm/python-configshell.spec.tmpl    |   46 +++++++++++++++++++++++++++
 7 files changed, 53 insertions(+), 83 deletions(-)
 delete mode 100644 debian/configshell-doc.docs
 delete mode 100644 redhat/python-configshell.spec.tmpl
 create mode 100644 rpm/python-configshell.spec.tmpl

diff --git a/Makefile b/Makefile
index 20bf617..09ba7bb 100644
--- a/Makefile
+++ b/Makefile
@@ -21,7 +21,7 @@ all:
 	@echo "Usage:"
 	@echo
 	@echo "  make deb         - Builds debian packages."
-	@echo "  make rpm         - Builds redhat packages."
+	@echo "  make rpm         - Builds rpm packages."
 	@echo "  make release     - Generates the release tarball."
 	@echo
 	@echo "  make clean       - Cleanup the local repository build files."
@@ -39,7 +39,7 @@ clean:
 	@rm -frv debian/${NAME}-doc/ debian/python2.5-${NAME}/
 	@rm -frv debian/python2.6-${NAME}/ debian/python-${NAME}/
 	@rm -frv results
-	@rm -fv redhat/*.spec *.spec redhat/sed* sed*
+	@rm -fv rpm/*.spec *.spec rpm/sed* sed*
 	@rm -frv ${NAME}-*
 	@echo "Finished cleanup."
 
@@ -60,11 +60,11 @@ build/release-stamp:
 		build/${NAME}-${VERSION}/${NAME}/__init__.py
 	@echo "Generating rpm specfile from template..."
 	@cd build/${NAME}-${VERSION}; \
-		for spectmpl in redhat/*.spec.tmpl; do \
+		for spectmpl in rpm/*.spec.tmpl; do \
 			sed -i "s/Version:\( *\).*/Version:\1${VERSION}/g" $${spectmpl}; \
 			mv $${spectmpl} $$(basename $${spectmpl} .tmpl); \
 		done; \
-		rm -r redhat
+		rm -r rpm
 	@echo "Generating rpm changelog..."
 	@for commit in $$(git log --date=iso  | grep -e ^commit -e ^Date: \
 		| tr -d '\n' | sed 's/commit /\n/g' | sed 's/Date:  //g' \
diff --git a/debian/configshell-doc.docs b/debian/configshell-doc.docs
deleted file mode 100644
index 37ad01a..0000000
--- a/debian/configshell-doc.docs
+++ /dev/null
@@ -1,5 +0,0 @@
-README
-COPYING
-doc/pdf
-doc/html
-examples/myshell
diff --git a/debian/control b/debian/control
index 02ac836..af9ad15 100644
--- a/debian/control
+++ b/debian/control
@@ -11,14 +11,4 @@ Depends: python (>= 2.6)|python2.6, python-epydoc, python-simpleparse, python-ur
 Suggests: configshell-doc
 Description: Framework to create CLI interfaces.
  .
- This package contains the configshell library.  
-
-Package: configshell-doc
-Section: doc
-Architecture: all
-Recommends: iceweasel | www-browser
-Description: official API documentation for the configshell library
- .
- This package contains the API reference and usage information for configshell,
- a framework to create CLI interfaces.
-
+ This package contains the configshell library.
diff --git a/debian/python-configshell.docs b/debian/python-configshell.docs
index 8b39665..e6bdff7 100644
--- a/debian/python-configshell.docs
+++ b/debian/python-configshell.docs
@@ -1,3 +1,4 @@
 README
 COPYING
+doc/html
 examples/myshell
diff --git a/debian/rules b/debian/rules
index 20834f4..3b24e87 100755
--- a/debian/rules
+++ b/debian/rules
@@ -33,10 +33,7 @@ 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/pdf
-	cd $(build_dir); epydoc --no-sourcecode --pdf -n $(name) \
-		--exclude configobj ../$(name)/*.py
-	cp $(build_dir)/pdf/api.pdf doc/pdf/$(name)_API_Documentation.pdf
+	mkdir -p $(build_dir) doc/
 	cd $(build_dir); epydoc --no-sourcecode --html -n $(name) \
 		--exclude configobj ../$(name)/*.py
 	sed -i "s/<\?/<!/g" $(build_dir)/html/*.html
diff --git a/redhat/python-configshell.spec.tmpl b/redhat/python-configshell.spec.tmpl
deleted file mode 100644
index b00ac09..0000000
--- a/redhat/python-configshell.spec.tmpl
+++ /dev/null
@@ -1,59 +0,0 @@
-%define oname configshell
-
-Name:           python-configshell
-License:        AGPLv3
-Group:          System Environment/Libraries
-Summary:        A framework to implement simple but nice CLIs.
-Version:        VERSION
-Release:        1%{?dist}
-URL:            http://www.risingtidesystems.com/git/
-Source:         %{oname}-%{version}.tar.gz
-BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-rpmroot
-BuildArch:      noarch
-BuildRequires:  python-devel, epydoc, python-simpleparse
-Requires:       python-simpleparse, python-urwid >= 0.9.9, epydoc
-Vendor:         RisingTide Systems
-
-%description
-A framework to implement simple but nice command-line interfaces.
-
-%package doc
-Summary:       PDF and HTML API reference for python-configshell.
-Group:         Documentation
-BuildRequires: epydoc
-
-%description doc
-PDF and HTML API reference for python-configshell.
-
-%prep
-%setup -q -n %{oname}-%{version}
-
-%build
-%{__python} setup.py build
-mkdir -p doc/pdf
-epydoc --no-sourcecode --pdf -n %{oname} --exclude configobj %{oname}/*.py
-mv pdf/api.pdf doc/pdf/%{oname}_API_Documentation.pdf
-epydoc --no-sourcecode --html -n %{oname} --exclude configobj %{oname}/*.py
-sed -i "s/<\?/<!/g" html/*.html
-sed -i "s/\?>/>/g" html/*.html
-mv html doc/
-
-%install
-rm -rf %{buildroot}
-%{__python} setup.py install --skip-build --root %{buildroot}
-mkdir -p %{buildroot}/usr/share/doc/python-configshell-doc-%{version}
-cp -r doc/* %{buildroot}/usr/share/doc/python-configshell-doc-%{version}/
-
-%clean
-rm -rf %{buildroot}
-
-%files
-%defattr(-,root,root,-)
-%{python_sitelib}
-%doc examples COPYING README
-
-%files doc
-%defattr(-,root,root,-)
-/usr/share/doc/python-configshell-doc-%{version}
-
-%changelog
diff --git a/rpm/python-configshell.spec.tmpl b/rpm/python-configshell.spec.tmpl
new file mode 100644
index 0000000..71b4c1c
--- /dev/null
+++ b/rpm/python-configshell.spec.tmpl
@@ -0,0 +1,46 @@
+%define oname configshell
+
+Name:           python-configshell
+License:        AGPLv3
+Group:          System Environment/Libraries
+Summary:        A framework to implement simple but nice CLIs.
+Version:        VERSION
+Release:        1%{?dist}
+URL:            http://www.risingtidesystems.com/git/
+Source:         %{oname}-%{version}.tar.gz
+BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-rpmroot
+BuildArch:      noarch
+BuildRequires:  python-devel, epydoc, python-simpleparse
+Requires:       python-simpleparse, python-urwid >= 0.9.9, epydoc
+Vendor:         RisingTide Systems
+
+%description
+A framework to implement simple but nice command-line interfaces.
+
+%prep
+%setup -q -n %{oname}-%{version}
+
+%build
+%{__python} setup.py build
+mkdir -p doc/
+epydoc --no-sourcecode --html -n %{oname} --exclude configobj %{oname}/*.py
+sed -i "s/<\?/<!/g" html/*.html
+sed -i "s/\?>/>/g" html/*.html
+mv html doc/
+
+%install
+rm -rf %{buildroot}
+%{__python} setup.py install --skip-build --root %{buildroot} --prefix=usr
+mkdir -p %{buildroot}/usr/share/doc/python-configshell-doc-%{version}
+cp -r doc/* %{buildroot}/usr/share/doc/python-configshell-doc-%{version}/
+
+%clean
+rm -rf %{buildroot}
+
+%files
+%defattr(-,root,root,-)
+%{python_sitelib}
+/usr/share/doc/python-configshell-doc-%{version}
+%doc examples COPYING README
+
+%changelog
-- 
1.6.0.2

