e88861a
%global srcname hgdistver
e88861a
Fabian Affolter 466589e
%if 0%{?fedora}
Fabian Affolter 466589e
%global with_python3 1
Fabian Affolter 466589e
%endif
Fabian Affolter 466589e
Fabian Affolter 466589e
Fabian Affolter ee53820
Name:           python-hgdistver
Fabian Affolter 11a61c7
Version:        0.21
be755a9
Release:        4%{?dist}
Fabian Affolter 11a61c7
Summary:        A Python library to generate package version info from mercurial tags
e88861a
e88861a
License:        MIT
Fabian Affolter 11a61c7
URL:            https://bitbucket.org/RonnyPfannschmidt/hgdistver/
e88861a
Source0:        http://pypi.python.org/packages/source/h/%{srcname}/%{srcname}-%{version}.tar.gz
e88861a
BuildArch:      noarch
e88861a
e88861a
BuildRequires:  python2-devel
e88861a
BuildRequires:  python-setuptools
e88861a
Fabian Affolter ee53820
%if 0%{?with_python3}
Fabian Affolter 466589e
BuildRequires:  python3-devel
Fabian Affolter 466589e
BuildRequires:  python3-setuptools
Fabian Affolter ee53820
%endif
Fabian Affolter ee53820
e88861a
%description
e88861a
hgdistver is a simple drop-in to support setup.py in mercurial based projects.
e88861a
It's supposed to generate version numbers from mercurial's meta-data. It tries
e88861a
to use the current tag and falls back to the next reachable tagged ancestor
e88861a
and using the distance to it as .post marker.
e88861a
Fabian Affolter ee53820
Fabian Affolter ee53820
%if 0%{?with_python3}
Fabian Affolter ee53820
%package -n python3-%{srcname}
Fabian Affolter ee53820
Summary:        A Python library to generate package version info from mercurial tags
Fabian Affolter ee53820
Fabian Affolter ee53820
%description -n python3-%{srcname}
Fabian Affolter ee53820
hgdistver is a simple drop-in to support setup.py in mercurial based projects.
Fabian Affolter ee53820
It's supposed to generate version numbers from mercurial's meta-data. It tries
Fabian Affolter ee53820
to use the current tag and falls back to the next reachable tagged ancestor
Fabian Affolter ee53820
and using the distance to it as .post marker.
Fabian Affolter ee53820
%endif
Fabian Affolter ee53820
e88861a
%prep
e88861a
%setup -q -n %{srcname}-%{version}
e88861a
rm -rf %{srcname}.egg-info
Fabian Affolter ee53820
find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|'
Fabian Affolter ee53820
%if 0%{?with_python3}
Fabian Affolter ee53820
rm -rf %{py3dir}
Fabian Affolter ee53820
cp -a . %{py3dir}
Fabian Affolter ee53820
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
Fabian Affolter ee53820
%endif
e88861a
e88861a
%build
Fabian Affolter c64ebb7
%{__python2} setup.py build
Fabian Affolter ee53820
%if 0%{?with_python3}
Fabian Affolter ee53820
pushd %{py3dir}
Fabian Affolter ee53820
%{__python3} setup.py build
Fabian Affolter ee53820
popd
Fabian Affolter ee53820
%endif
e88861a
e88861a
%install
Fabian Affolter ee53820
%if 0%{?with_python3}
Fabian Affolter ee53820
pushd %{py3dir}
Fabian Affolter ee53820
%{__python3} setup.py install -O1 --skip-build --root=%{buildroot}
Fabian Affolter ee53820
popd
Fabian Affolter ee53820
%endif
Fabian Affolter ee53820
%{__python2} setup.py install -O1 --skip-build --root=%{buildroot}
e88861a
e88861a
%files
Fabian Affolter bbe5881
%doc README.txt
Fabian Affolter c64ebb7
%{python2_sitelib}/%{srcname}.*
Fabian Affolter c64ebb7
%{python2_sitelib}/%{srcname}*.egg-info
e88861a
Fabian Affolter ee53820
%if 0%{?with_python3}
Fabian Affolter ee53820
%files -n python3-%{srcname}
Fabian Affolter ee53820
%doc README.txt
Fabian Affolter ee53820
%{python3_sitelib}/%{srcname}.py
Fabian Affolter ee53820
%{python3_sitelib}/%{srcname}*.egg-info
Fabian Affolter ee53820
%{python3_sitelib}/__pycache__/%{srcname}*
Fabian Affolter ee53820
%endif
Fabian Affolter ee53820
e88861a
%changelog
be755a9
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.21-4
be755a9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
be755a9
Fabian Affolter 466589e
* Tue Feb 17 2015 Ken Dreyer <ktdreyer@ktdreyer.com> - 0.21-3
Fabian Affolter 466589e
- Activate python3 package
Fabian Affolter 466589e
Fabian Affolter ee53820
* Fri Oct 03 2014 Fabian Affolter <mail@fabian-affolter.ch> - 0.21-2
Fabian Affolter ee53820
- Add python3 package
Fabian Affolter ee53820
Fabian Affolter 11a61c7
* Sun Sep 14 2014 Fabian Affolter <mail@fabian-affolter.ch> - 0.21-1
Fabian Affolter 11a61c7
- Update URL
Fabian Affolter 11a61c7
- Update to new upstream release 0.21
Fabian Affolter 11a61c7
Fabian Affolter 0241405
* Fri Sep 12 2014 Fabian Affolter <mail@fabian-affolter.ch> - 0.20-1
Fabian Affolter 0241405
- Update to new upstream release 0.20
Fabian Affolter 0241405
Fabian Affolter c64ebb7
* Wed Sep 03 2014 Fabian Affolter <mail@fabian-affolter.ch> - 0.19-1
Fabian Affolter c64ebb7
- Update to new upstream release 0.19
Fabian Affolter c64ebb7
1497c2c
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.16-5
1497c2c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
1497c2c
33adde1
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.16-4
33adde1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
33adde1
daaccd7
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.16-3
daaccd7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
daaccd7
e88861a
* Thu Nov 01 2012 Fabian Affolter <mail@fabian-affolter.ch> - 0.16-2
e88861a
- Bundled egg-info removed
e88861a
e88861a
* Sun Oct 21 2012 Fabian Affolter <mail@fabian-affolter.ch> - 0.16-1
Fabian Affolter c64ebb7
- Update to new upstream release 0.16
e88861a
e88861a
* Fri Jun 08 2012 Fabian Affolter <mail@fabian-affolter.ch> - 0.15-1
e88861a
- Initial package