Package init

This commit is contained in:
dogsheng 2019-12-25 15:54:39 +08:00
parent 33e4c4a2ca
commit a2a8e83752

View File

@ -2,7 +2,7 @@
Name: librepo Name: librepo
Version: 1.9.1 Version: 1.9.1
Release: 1 Release: 2
Summary: Repodata downloading library Summary: Repodata downloading library
License: LGPLv2.1 License: LGPLv2.1
URL: https://github.com/rpm-software-management/librepo URL: https://github.com/rpm-software-management/librepo
@ -24,6 +24,18 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel %description devel
Development files for librepo. Development files for librepo.
%package -n python2-%{name}
Summary: Python 2 bindings for the librepo library
%{?python_provide:%python_provide python2-%{name}}
BuildRequires: python2-gpg python2-devel python2-flask
BuildRequires: python2-nose python2-sphinx python2-pyxattr
Requires: %{name}%{?_isa} = %{version}-%{release}
Obsoletes: platform-python-%{name} < %{version}-%{release}
Conflicts: python2-dnf < %{dnf_conflict}
%description -n python2-%{name}
Python 2 bindings for the librepo library.
%package -n python3-%{name} %package -n python3-%{name}
Summary: Python 3 bindings for the librepo library Summary: Python 3 bindings for the librepo library
%{?python_provide:%python_provide python3-%{name}} %{?python_provide:%python_provide python3-%{name}}
@ -39,20 +51,36 @@ Python 3 bindings for the librepo library.
%prep %prep
%autosetup -p1 %autosetup -p1
mkdir build-py2
mkdir build-py3 mkdir build-py3
%build %build
cd build-py2
%cmake -DPYTHON_DESIRED:FILEPATH=%{__python2} ..
%make_build
cd ..
cd build-py3 cd build-py3
%cmake -DPYTHON_DESIRED:FILEPATH=%{__python3} .. %cmake -DPYTHON_DESIRED:FILEPATH=%{__python3} ..
%make_build %make_build
cd .. cd ..
%check %check
cd build-py2
make ARGS="-V" test
cd ..
cd build-py3 cd build-py3
make ARGS="-V" test make ARGS="-V" test
cd .. cd ..
%install %install
cd build-py2
%make_install
cd ..
cd build-py3 cd build-py3
%make_install %make_install
cd .. cd ..
@ -69,9 +97,15 @@ cd ..
%{_libdir}/pkgconfig/%{name}.pc %{_libdir}/pkgconfig/%{name}.pc
%{_includedir}/%{name}/ %{_includedir}/%{name}/
%files -n python2-%{name}
%{python2_sitearch}/%{name}/
%files -n python3-%{name} %files -n python3-%{name}
%{python3_sitearch}/%{name}/ %{python3_sitearch}/%{name}/
%changelog %changelog
* Sat Dec 21 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.9.1-2
- Support python2
* Fri Aug 17 2018 openEuler Buildteam <buildteam@openeuler.org> - 1.9.1-1 * Fri Aug 17 2018 openEuler Buildteam <buildteam@openeuler.org> - 1.9.1-1
- Package init - Package init