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