[PyXB] Update to prerelease version 1.2.4

Michal Srb msrb at fedoraproject.org
Tue Sep 9 07:43:51 UTC 2014


commit 3027b175ec3ba3226228ac3eee096cd038b40bdf
Author: Michal Srb <msrb at redhat.com>
Date:   Tue Aug 26 11:11:21 2014 +0200

    Update to prerelease version 1.2.4
    
    - Add python3 subpackage

 .gitignore |    1 +
 PyXB.spec  |   97 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 sources    |    2 +-
 3 files changed, 90 insertions(+), 10 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 2447548..806f6c3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
 /PyXB-full-1.1.2.tar.gz
 /PyXB-1.2.3.tar.gz
+/PyXB-1.2.4.tar.xz
diff --git a/PyXB.spec b/PyXB.spec
index 02fffd0..08de418 100644
--- a/PyXB.spec
+++ b/PyXB.spec
@@ -1,34 +1,113 @@
+%if 0%{?fedora} > 12
+%global with_python3 1
+%else
+%{!?__python2: %global __python2 /usr/bin/python2}
+%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
+%endif
+%global srcname distribute
+
 Name:           PyXB
-Version:        1.2.3
-Release:        2%{?dist}
+Version:        1.2.4
+Release:        0.1.gitc494ba3%{?dist}
 Summary:        Python XML Schema Bindings
 License:        Apache
 URL:            http://pyxb.sourceforge.net/
-Source0:        http://downloads.sourceforge.net/project/pyxb/pyxb/%{version}/%{name}-%{version}.tar.gz
+# https://github.com/pabigot/pyxb
+# git checkout next
+# git reset --hard c494ba3
+Source0:        %{name}-%{version}.tar.xz
 BuildArch:      noarch
 
-BuildRequires:  python-devel
+BuildArch:      noarch
+BuildRequires:  python2-devel
+%if 0%{?with_python3}
+BuildRequires:  python3-devel
+%endif # if with_python3
 
 %description
 PyXB (“pixbee”) is a pure Python package that generates Python source
 code for classes that correspond to data structures defined by
 XMLSchema.
 
+%if 0%{?with_python3}
+%package -n python3-PyXB
+Summary:        Python XML Schema Bindings
+
+%description -n python3-PyXB
+PyXB (“pixbee”) is a pure Python package that generates Python source
+code for classes that correspond to data structures defined by
+XMLSchema.
+%endif # with_python3
+
 %prep
 %setup -q
 
+# remove "-DEV" from version
+sed -i 's|\(%{version}\)-DEV|\1|' setup.py doc/conf.py pyxb/__init__.py
+
+%if 0%{?with_python3}
+rm -rf %{py3dir}
+cp -a . %{py3dir}
+find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
+%endif # with_python3
+
 %build
-%{__python} setup.py build
+%{__python2} setup.py build
+
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py build
+popd
+%endif # with_python3
 
 %install
-%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
+rm -rf %{buildroot}
+
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
+
+rm -rf %{buildroot}%{python3_sitelib}/pyxb/tests
+popd
+%endif # with_python3
+
+%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
+
+rm -rf %{buildroot}%{python2_sitelib}/pyxb/tests
+
+%check
+%{__python2} setup.py test
+
+# some tests fail with python3, upstream knows about it
+#%%if 0%{?with_python3}
+#pushd %{py3dir}
+#%%{__python3} setup.py test
+#popd
+#%%endif # with_python3
+
+%clean
+rm -rf %{buildroot}
+
  
 %files
-%doc doc/* LICENSE NOTICE PKG-INFO README.txt examples/*
-%{python_sitelib}/*
-%{_bindir}/pyx*
+%doc doc/* LICENSE NOTICE README.txt examples/*
+%{python2_sitelib}/*
+%{_bindir}/pyxbdump
+%{_bindir}/pyxbgen
+%{_bindir}/pyxbwsdl
+
+
+%if 0%{?with_python3}
+%files -n python3-PyXB
+%doc doc/* LICENSE NOTICE README.txt examples/*
+%{python3_sitelib}/*
+%endif # with_python3
 
 %changelog
+* Thu Jul 17 2014 Michal Srb <msrb at redhat.com> - 1.2.4-0.1
+- Update to prerelease version 1.2.4
+- Add python3 subpackage
+
 * Fri Jun 06 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.2.3-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
 
diff --git a/sources b/sources
index b5c6a05..09bbb5c 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-e7e15abb99f686939ef4c4bead4f05e3  PyXB-1.2.3.tar.gz
+0f90fba3110ce1d3c4f35a46ab5fbfac  PyXB-1.2.4.tar.xz


More information about the scm-commits mailing list