diff --git a/.gitignore b/.gitignore index 2b7646c..2059095 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /apsw-3.8.11.1-r1.zip /apsw-3.7.17-r1.zip /apsw-3.8.10.1-r1.zip +/apsw-3.11.0-r1.zip diff --git a/python-apsw.spec b/python-apsw.spec index b60a50f..a3aea94 100644 --- a/python-apsw.spec +++ b/python-apsw.spec @@ -1,8 +1,12 @@ -%if 0%{?fedora} > 12 || 0%{?rhel} > 7 -%global with_python3 1 -%else -%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")} -%endif +# Please don't flush global 'release' tag voluntarily after any upstream update +# since decreasing it can lead to discrepances with packages versioning. +# As a rule, if desired it can be decreased under these conditions: +# 1) 'apsw' upstream version bump in _all_ maintainable Fedora branches; +# 2) in all cases, it can't be less than 'release' tag value in _any_ maintainable +# EPEL branch (currently, "3" in epel7). + +# For old Fedora versions +%{!?python3_pkgversion:%global python3_pkgversion 3} %if 0%{?rhel} == 7 %global sqlite_version 3.7.17 @@ -10,112 +14,98 @@ %global pkg_version %{sqlite_version}-r%{uprel} %endif -%if 0%{?fedora} == 21 -%global sqlite_version 3.8.10 -%global uprel 1 -%global pkg_version %{sqlite_version}.1-r%{uprel} -%endif +# Deprecated Fedora support dropped, no need to track package versioning there. -%if 0%{?fedora} == 22 -%global sqlite_version 3.8.10 +%if 0%{?fedora} == 23 +%global sqlite_version 3.11.0 %global uprel 1 -%global pkg_version %{sqlite_version}.1-r%{uprel} +%global pkg_version %{sqlite_version}-r%{uprel} %endif -%if 0%{?fedora} >= 23 -%global sqlite_version 3.8.11 +%if 0%{?fedora} >= 24 +%global sqlite_version 3.11.0 %global uprel 1 -%global pkg_version %{sqlite_version}.1-r%{uprel} +%global pkg_version %{sqlite_version}-r%{uprel} %endif %global real_version %(eval echo %{pkg_version} | %{__sed} 's/-/./') - %filter_provides_in %{python_sitearch}/.*\.so$ -%if 0%{?with_python3} %filter_provides_in %{python3_sitearch}/.*\.so$ -%endif # if with_python3 %filter_setup Name: python-apsw Version: %{real_version} -Release: 4%{?dist} +Release: 3%{?dist} Summary: Another Python SQLite Wrapper Group: Development/Libraries License: zlib -URL: http://code.google.com/p/apsw/ +URL: https://github.com/rogerbinns/apsw Source: https://github.com/rogerbinns/apsw/releases/download/%{pkg_version}/apsw-%{pkg_version}.zip -Requires: sqlite >= %{sqlite_version} - -BuildRequires: sqlite-devel >= %{sqlite_version} BuildRequires: python2-devel -%if 0%{?with_python3} -BuildRequires: python3-devel -%endif # if with_python3 - +BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: sqlite-devel >= %{sqlite_version} +Requires: sqlite >= %{sqlite_version} %description APSW is a Python wrapper for the SQLite embedded relational database engine. In contrast to other wrappers such as pysqlite it focuses on being a minimal layer over SQLite attempting just to translate the complete SQLite API into Python. -%if 0%{?with_python3} -%package -n python3-apsw -Summary: Another Python SQLite Wrapper Python 3 packages -Group: Development/Libraries -%description -n python3-apsw -APSW is a Python 3 wrapper for the SQLite embedded relational database +%package -n python2-apsw +Summary: Another Python SQLite Wrapper +%{?python_provide:%python_provide python2-apsw} + +%description -n python2-apsw +APSW is a Python wrapper for the SQLite embedded relational database engine. In contrast to other wrappers such as pysqlite it focuses on being a minimal layer over SQLite attempting just to translate the -complete SQLite API into Python 3. -%endif # with_python3 +complete SQLite API into Python. +%package -n python%{python3_pkgversion}-apsw +Summary: Another Python SQLite Wrapper +%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}} +%description -n python%{python3_pkgversion}-apsw +APSW is a Python %{python3_version} wrapper for the SQLite embedded relational database +engine. In contrast to other wrappers such as pysqlite it focuses on +being a minimal layer over SQLite attempting just to translate the +complete SQLite API into Python. %prep -%setup -q -n "apsw-%{pkg_version}" - -%if 0%{?with_python3} -rm -rf %{py3dir} -cp -a . %{py3dir} -find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' -%endif # with_python3 -find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python}|' - +%autosetup -n apsw-%{pkg_version} +rm -f doc/.buildinfo %build - -CFLAGS="$RPM_OPT_FLAGS" python2 setup.py build - -%if 0%{?with_python3} -pushd %{py3dir} -CFLAGS="$RPM_OPT_FLAGS" python3 setup.py build -popd -%endif # with_python3 +%py2_build +%py3_build %install -%if 0%{?with_python3} -pushd %{py3dir} -python3 setup.py install --root %{buildroot} -popd -%endif # with_python3 +%py2_install +%py3_install -python2 setup.py install --root %{buildroot} +%check +CFLAGS="%{optflags}" python%{python_version} setup.py build_ext --inplace test +CFLAGS="%{optflags}" python%{python3_version} setup.py build_ext --inplace test -%files +%files -n python2-apsw %doc doc/* -%{python_sitearch}/* +%{python2_sitearch}/apsw*.so +%{python2_sitearch}/apsw*.egg-info -%if 0%{?with_python3} -%files -n python3-apsw +%files -n python%{python3_pkgversion}-apsw %doc doc/* -%{python3_sitearch}/* -%endif # with_python3 +%{python3_sitearch}/apsw*.so +%{python3_sitearch}/apsw*.egg-info + %changelog +* Fri Mar 04 2016 Denis Fateyev - 3.11.0.r1-3 +- Modernize the package spec, bump upstream version + * Thu Feb 04 2016 Fedora Release Engineering - 3.8.11.1.r1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild diff --git a/sources b/sources index 81c8c7f..378331f 100644 --- a/sources +++ b/sources @@ -1,3 +1 @@ -3516203c369aacbe12a3bed35f60fe4a apsw-3.7.17-r1.zip -53aadcfea05f93c0acb9946a17a587d6 apsw-3.8.10.1-r1.zip -8ec876a2df4766abb32b6bf7e34f3bbf apsw-3.8.11.1-r1.zip +da7d903881be0f68d33e9579e7af83d2 apsw-3.11.0-r1.zip