[python-ZConfig] Latest upstream and python3 subpackage.

Ralph Bean ralph at fedoraproject.org
Tue Jun 10 13:17:26 UTC 2014


commit 266990f304d51eb1b5addf39c5cf6b5a22b80a40
Author: Ralph Bean <rbean at redhat.com>
Date:   Tue Jun 10 09:17:14 2014 -0400

    Latest upstream and python3 subpackage.

 .gitignore          |    1 +
 python-ZConfig.spec |   94 ++++++++++++++++++++++++++++++++++++++++----------
 sources             |    2 +-
 3 files changed, 77 insertions(+), 20 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index a112d82..5dcb986 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
 ZConfig-2.8.0.tar.gz
 /ZConfig-2.9.0.zip
 /ZConfig-2.9.2.tar.gz
+/ZConfig-3.0.4.tar.gz
diff --git a/python-ZConfig.spec b/python-ZConfig.spec
index 1efe32c..341ee17 100644
--- a/python-ZConfig.spec
+++ b/python-ZConfig.spec
@@ -1,23 +1,35 @@
-%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5)
-%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
+%if 0%{?rhel} && 0%{?rhel} <= 6
+%{!?__python2:        %global __python2 /usr/bin/python2}
+%{!?python2_sitelib:  %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
+%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
+%endif
+
+%if 0%{?fedora}
+%global with_python3 1
 %endif
 
 Name:           python-ZConfig
-Version:        2.9.2
-Release:        5%{?dist}
+Version:        3.0.4
+Release:        1%{?dist}
 Summary:        Structured Configuration Library
 Group:          Development/Languages
 License:        ZPLv2.1
 URL:            http://www.zope.org/Members/fdrake/zconfig/
 Source0:        http://pypi.python.org/packages/source/Z/ZConfig/ZConfig-%{version}.tar.gz
-BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildArch:      noarch
+
 BuildRequires:  python2-devel
 BuildRequires:  python-setuptools
 # for tests, not available in Fedora
 #BuildRequires:  python-zope-testrunner
 
+%if 0%{?with_python3}
+BuildRequires:  python3-devel
+BuildRequires:  python3-setuptools
+# for tests, not available in Fedora
+#BuildRequires:  python3-zope-testrunner
+%endif
 
 %description
 ZConfig is a configuration library intended for general use. It supports
@@ -27,41 +39,85 @@ very different from the model supported by the ConfigParser module found
 in Python's standard library, and is more suitable to
 configuration-intensive applications.
 
+%if 0%{?with_python3}
+%package -n python3-ZConfig
+Summary:        Structured Configuration Library
+Group:          Development/Languages
+
+%description -n python3-ZConfig
+ZConfig is a configuration library intended for general use. It supports
+a hierarchical schema-driven configuration model that allows a schema to
+specify data conversion routines written in Python. ZConfig's model is
+very different from the model supported by the ConfigParser module found
+in Python's standard library, and is more suitable to
+configuration-intensive applications.
+%endif
+
 
 %prep
 %setup -q -n ZConfig-%{version}
 
+%if 0%{?with_python3}
+rm -rf %{py3dir}
+cp -a . %{py3dir}
+%endif
 
 %build
-%{__python} setup.py build
+%{__python2} setup.py build
 
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py build
+popd
+%endif
 
 %install
-rm -rf $RPM_BUILD_ROOT
-%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
-rm -f $RPM_BUILD_ROOT%{python_sitelib}/ZConfig/*.txt
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
+rm -f %{buildroot}%{python3_sitelib}/ZConfig/*.txt
+mv %{buildroot}%{_bindir}/zconfig %{buildroot}%{_bindir}/python3-zconfig
+mv %{buildroot}%{_bindir}/zconfig_schema2html %{buildroot}%{_bindir}/python3-zconfig_schema2html
+popd
+%endif
 
+%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
+rm -f %{buildroot}%{python2_sitelib}/ZConfig/*.txt
 
 #%%check
 # Tests require zope.testrunner not yet available in Fedora
-#%{__python} setup.py test
-
- 
-%clean
-rm -rf $RPM_BUILD_ROOT
-
+#%{__python2} setup.py test
+#
+#%if 0%{?with_python3}
+#pushd %{py3dir}
+#%{__python3} setup.py test
+#popd
+#%endif
 
 %files
-%defattr(-,root,root,-)
-%doc COPYRIGHT.txt LICENSE.txt NEWS.txt README.txt doc/zconfig.pdf
+%doc COPYRIGHT.txt LICENSE.txt README.txt doc/zconfig.pdf
 %doc ZConfig/*.txt
-%{python_sitelib}/*
-%exclude %{python_sitelib}/ZConfig/tests/
+%{python2_sitelib}/*
+%exclude %{python2_sitelib}/ZConfig/tests/
 %{_bindir}/zconfig
 %{_bindir}/zconfig_schema2html
 
+%if 0%{?with_python3}
+%files -n python3-ZConfig
+%doc COPYRIGHT.txt LICENSE.txt README.txt doc/zconfig.pdf
+%doc ZConfig/*.txt
+%{python3_sitelib}/*
+%exclude %{python3_sitelib}/ZConfig/tests/
+%{_bindir}/python3-zconfig
+%{_bindir}/python3-zconfig_schema2html
+%endif
+
 
 %changelog
+* Tue Jun 10 2014 Ralph Bean <rbean at redhat.com> - 3.0.4-1
+- Latest upstream.
+- Added python3 subpackage.
+- Modernized python2 macros
 * Sat Jun 07 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.9.2-5
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
 
diff --git a/sources b/sources
index cfe60e5..6333c8f 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-4ed769263676c711ca09eb68a820ae54  ZConfig-2.9.2.tar.gz
+32018f77d37f220b6a80aaf311fea63f  ZConfig-3.0.4.tar.gz


More information about the scm-commits mailing list