Blame SPECS/python-gflags.spec

a69133
%global srcname gflags
a69133
a69133
%if 0%{?fedora} || 0%{?rhel} > 7
a69133
%global with_python3 1
a69133
%endif
a69133
a69133
%if 0%{?rhel} > 7
a69133
# Disable python2 build by default
a69133
%bcond_with python2
a69133
%else
a69133
%bcond_without python2
a69133
%endif
a69133
a69133
Name:           python-%{srcname}
a69133
Version:        2.0
a69133
Release:        13%{?dist}
a69133
Summary:        Commandline flags module for Python
a69133
a69133
Group:          Development/Languages
a69133
License:        BSD
a69133
URL:            https://github.com/gflags/python-gflags
a69133
Source0:        https://github.com/gflags/python-gflags/archive/python-gflags-%{version}.tar.gz#/%{name}-%{version}.tar.gz
a69133
a69133
BuildArch:      noarch
a69133
a69133
%description
a69133
This project is the python equivalent of google-gflags, a Google commandline
a69133
flag implementation for C++. It is intended to be used in situations where a
a69133
project wants to mimic the command-line flag handling of a C++ app that uses
a69133
google-gflags, or for a Python app that, via swig or some other means, is
a69133
linked with a C++ app that uses google-gflags.
a69133
a69133
The gflags package contains a library that implements commandline flags
a69133
processing. As such it's a replacement for getopt(). It has increased
a69133
flexibility, including built-in support for Python types, and the ability to
a69133
define flags in the source file in which they're used. (This last is its major
a69133
difference from OptParse.)
a69133
a69133
%if %{with python2}
a69133
%package -n python2-%{srcname}
a69133
Summary:        Commandline flags module for Python 2
a69133
BuildRequires:  python2-devel
a69133
BuildRequires:  python-setuptools
a69133
%{?python_provide:%python_provide python2-%{srcname}}
a69133
a69133
%description -n python2-%{srcname}
a69133
This project is the python equivalent of google-gflags, a Google commandline
a69133
flag implementation for C++. It is intended to be used in situations where a
a69133
project wants to mimic the command-line flag handling of a C++ app that uses
a69133
google-gflags, or for a Python app that, via swig or some other means, is
a69133
linked with a C++ app that uses google-gflags.
a69133
a69133
The gflags package contains a library that implements commandline flags
a69133
processing. As such it's a replacement for getopt(). It has increased
a69133
flexibility, including built-in support for Python types, and the ability to
a69133
define flags in the source file in which they're used. (This last is its major
a69133
difference from OptParse.)
a69133
%endif # with python2
a69133
a69133
%if 0%{?with_python3}
a69133
%package -n python3-%{srcname}
a69133
Summary:        Commandline flags module for Python 3
a69133
BuildRequires:  python3-devel
a69133
BuildRequires:  python3-setuptools
a69133
BuildRequires:  python3-tools
a69133
%{?python_provide:%python_provide python3-%{srcname}}
a69133
a69133
%description -n python3-%{srcname}
a69133
This project is the python equivalent of google-gflags, a Google commandline
a69133
flag implementation for C++. It is intended to be used in situations where a
a69133
project wants to mimic the command-line flag handling of a C++ app that uses
a69133
google-gflags, or for a Python app that, via swig or some other means, is
a69133
linked with a C++ app that uses google-gflags.
a69133
a69133
The gflags package contains a library that implements commandline flags
a69133
processing. As such it's a replacement for getopt(). It has increased
a69133
flexibility, including built-in support for Python types, and the ability to
a69133
define flags in the source file in which they're used. (This last is its major
a69133
difference from OptParse.)
a69133
%endif
a69133
a69133
a69133
%prep
a69133
%setup -qc
a69133
%if %{with python2}
a69133
cp -a %{name}-%{version} python2
a69133
sed -i '1s|^#!/usr/bin/env python$|#!%{__python2}|' python2/gflags2man.py
a69133
sed -i '/^#!\/usr\/bin\/env python$/,+1 d' python2/gflags*.py
a69133
%endif # with python2
a69133
%if 0%{?with_python3}
a69133
cp -a %{name}-%{version} python3
a69133
pathfix.py -i %{__python3} -pn python3/*.py \
a69133
python3/tests/*py
a69133
2to3 --write --nobackup python3
a69133
%endif
a69133
a69133
a69133
%build
a69133
%if %{with python2}
a69133
pushd python2
a69133
%py2_build
a69133
popd
a69133
%endif # with python2
a69133
%if 0%{?with_python3}
a69133
pushd python3
a69133
%py3_build
a69133
popd
a69133
%endif
a69133
a69133
a69133
%install
a69133
%if 0%{?with_python3}
a69133
pushd python3
a69133
%py3_install
a69133
%if %{without python2}
a69133
mv %{buildroot}%{_bindir}/gflags2man.py  %{buildroot}%{_bindir}/gflags2man
a69133
chmod +x %{buildroot}%{_bindir}/gflags2man
a69133
%else
a69133
mv %{buildroot}%{_bindir}/gflags2man.py  %{buildroot}%{_bindir}/gflags2man-3
a69133
chmod +x %{buildroot}%{_bindir}/gflags2man-3
a69133
%endif
a69133
popd
a69133
%endif
a69133
a69133
%if %{with python2}
a69133
pushd python2
a69133
%py2_install
a69133
mv %{buildroot}%{_bindir}/gflags2man.py  %{buildroot}%{_bindir}/gflags2man
a69133
chmod +x %{buildroot}%{_bindir}/gflags2man
a69133
popd
a69133
%endif # with python2
a69133
a69133
a69133
%check
a69133
%if %{with python2}
a69133
pushd python2
a69133
%{__python2} setup.py test
a69133
popd
a69133
%endif # with python2
a69133
a69133
%if 0%{?with_python3}
a69133
pushd python3
a69133
%{__python3} setup.py test
a69133
popd
a69133
%endif
a69133
a69133
%if %{with python2}
a69133
%files -n python2-%{srcname}
a69133
%license python2/COPYING
a69133
%doc python2/AUTHORS python2/ChangeLog python2/COPYING python2/README
a69133
%{python2_sitelib}/%{srcname}.py*
a69133
%{python2_sitelib}/%{srcname}_validators.py*
a69133
%{python2_sitelib}/python_gflags-%{version}-*egg-info
a69133
%{_bindir}/gflags2man
a69133
%endif # with python2
a69133
a69133
%if 0%{?with_python3}
a69133
%files -n python3-%{srcname}
a69133
%license python3/COPYING
a69133
%doc python3/AUTHORS python3/ChangeLog python3/COPYING python3/README
a69133
%{python3_sitelib}/%{srcname}.py*
a69133
%{python3_sitelib}/%{srcname}_validators.py*
a69133
%{python3_sitelib}/python_gflags-%{version}-*egg-info
a69133
%{python3_sitelib}/__pycache__/*
a69133
%if %{without python2}
a69133
%{_bindir}/gflags2man
a69133
%else
a69133
%{_bindir}/gflags2man-3
a69133
%endif
a69133
%endif
a69133
a69133
a69133
%changelog
a69133
* Thu Jun 14 2018 Charalampos Stratakis <cstratak@redhat.com> - 2.0-13
a69133
- Conditionalize the python2 subpackage
a69133
a69133
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.0-12
a69133
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
a69133
a69133
* Fri Sep 29 2017 Troy Dawson <tdawson@redhat.com> - 2.0-11
a69133
- Cleanup spec file conditionals
a69133
a69133
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0-10
a69133
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
a69133
a69133
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0-9
a69133
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
a69133
a69133
* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 2.0-8
a69133
- Rebuild for Python 3.6
a69133
a69133
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0-7
a69133
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
a69133
a69133
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.0-6
a69133
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
a69133
a69133
* Wed Nov 18 2015 Orion Poplawski <orion@cora.nwra.com> - 2.0-5
a69133
- Update spec, make python3 package optional for EPEL7
a69133
a69133
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0-4
a69133
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
a69133
a69133
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0-3
a69133
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
a69133
a69133
* Mon Apr 6 2015 Orion Poplawski <orion@cora.nwra.com> - 2.0-2
a69133
- Create python3 package (bug #1209201)
a69133
a69133
* Mon Apr 6 2015 Orion Poplawski <orion@cora.nwra.com> - 2.0-1
a69133
- Update to 2.0
a69133
a69133
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.1-6
a69133
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
a69133
a69133
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.1-5
a69133
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
a69133
a69133
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.1-4
a69133
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
a69133
a69133
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.1-3
a69133
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
a69133
a69133
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.1-2
a69133
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
a69133
a69133
* Sun Jul 24 2011 Silas Sewell <silas@sewell.org> - 1.5.1-1
a69133
- Update to 1.5.1
a69133
a69133
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4-3
a69133
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
a69133
a69133
* Tue Oct 26 2010 Silas Sewell <silas@sewell.ch> - 1.4-2
a69133
- Fix non-executable-script error
a69133
a69133
* Wed Oct 13 2010 Silas Sewell <silas@sewell.ch> - 1.4-1
a69133
- Initial package