Blob Blame History Raw
%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

%if 0%{?rhel} == 7
%global sqlite_version 3.7.17
%global uprel 1
%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

%if 0%{?fedora} == 22
%global sqlite_version 3.8.10
%global uprel 1
%global pkg_version %{sqlite_version}.1-r%{uprel}
%endif

%if 0%{?fedora} >= 23
%global sqlite_version 3.8.11
%global uprel 1
%global pkg_version %{sqlite_version}.1-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:            2%{?dist}
Summary:            Another Python SQLite Wrapper
Group:              Development/Libraries
License:            zlib
URL:                http://code.google.com/p/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



%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
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



%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}|'


%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

%install
%if 0%{?with_python3}
pushd %{py3dir}
python3 setup.py install --root %{buildroot}
popd
%endif # with_python3

python2 setup.py install --root %{buildroot}

%files
%doc doc/*
%{python_sitearch}/*

%if 0%{?with_python3}
%files -n python3-apsw
%doc doc/*
%{python3_sitearch}/*
%endif # with_python3

%changelog
* Fri Sep 11 2015 Marcel Wysocki <maci@satgnu.net> - 3.8.11.1.r1-2
- Merge different versions into one spec file

* Mon Aug 24 2015 Marcel Wysocki <maci@satgnu.net> - 3.8.11.1.r1-1
- Update to 3.8.11.1-r1 for F24

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.8.4.3.r1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.8.4.3.r1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.8.4.3.r1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Tue May 27 2014 Kalev Lember <kalevlember@gmail.com> - 3.8.4.3.r1-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4

* Sat May 10 2014 Peter Robinson <pbrobinson@fedoraproject.org> 3.8.4.3.r1-1
- update to 3.8.4.3r1

* Tue Sep 24 2013 Marcel Wysocki <maci@satgnu.net> - 3.8.0.r2-1
- update to 3.8.0-r2

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.7.15.2.r1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Fri Feb 15 2013 Marcel Wysocki <maci@satgnu.net> - 3.7.15.2.r1-1
- update to 3.7.15.2-r1

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.7.11.r1-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Mon Nov 19 2012 Marcel Wysocki <maci@satgnu.net> 3.7.11.r1-8
- initial python3 build

* Tue Oct 30 2012 Marcel Wysocki <maci@satgnu.net> 3.7.11.r1-7
- use python2-devel BR instead of python-devel

* Mon Oct 29 2012 Marcel Wysocki <maci@satgnu.net> 3.7.11.r1-6
- removed -doc package, not really needed

* Sun Oct 28 2012 Marcel Wysocki <maci@satgnu.net> 3.7.11.r1-5
- fixed changelog rpmlint error

* Sat Oct 27 2012 Marcel Wysocki <maci@satgnu.net> 3.7.11.r1-4
- use global instead of define macro
- filter private-shared-object-provides 
- removed python from requires

* Tue Oct 23 2012 Marcel Wysocki <maci@satgnu.net> 3.7.11.r1-3
- don't use rm macro
- remove doc/.buildinfo
- add missing dependencies

* Fri Oct 05 2012 Marcel Wysocki <maci@satgnu.net> 3.7.11.r1-2
- add missing builddep

* Thu Oct 04 2012 Marcel Wysocki <maci@satgnu.net> 3.7.11.r1-1
- fedora port
- update to 3.7.11-r1

* Wed Nov 30 2011 Dmitry Mikhirev <dmikhirev@mandriva.org> 3.7.7.1.r1-1
+ Revision: 735584
- imported package python-apsw