Blob Blame History Raw
%global with_python3 1

Name:           pycmd
Version:        1.2
Release:        5%{?dist}
Summary:        Tools for managing/searching Python related files
Group:          Development/Languages
License:        MIT
URL:            http://pypi.python.org/pypi/pycmd
Source0:        http://pypi.python.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz
BuildArch:      noarch
BuildRequires:  python2-devel
BuildRequires:  python-setuptools
BuildRequires:  python-py >= 1.4.0
%if 0%{?with_python3}
BuildRequires:  python%{python3_pkgversion}-devel
BuildRequires:  python%{python3_pkgversion}-setuptools
BuildRequires:  python%{python3_pkgversion}-py >= 1.4.0
%endif # with_python3


%description
Pycmd is a collection of command line tools for helping with Python
development.

%package -n python2-pycmd
Summary:        Tools for managing/searching Python related files
Group:          Development/Languages
Requires:       python-setuptools
Requires:       python-py >= 1.4.0
%{?python_provide:%python_provide python2-pycmd}
Provides:       pycmd = %{version}-%{release}
Obsoletes:      pycmd < 1.2-4
# pycmd was separated from pylib at that point
Conflicts:      python-py < 1.4.0

%description -n python2-pycmd
Pycmd is a collection of command line tools for helping with Python
development.

%if 0%{?with_python3}
%package -n python%{python3_pkgversion}-pycmd
Summary:        Tools for managing/searching Python related files
Group:          Development/Languages
Requires:       python%{python3_pkgversion}-setuptools
Requires:       python%{python3_pkgversion}-py >= 1.4.0
%{?python_provide:%python_provide python%{python3_pkgversion}-pycmd}


%description -n python%{python3_pkgversion}-pycmd
Pycmd is a collection of command line tools for helping with Python
development.
%endif # with_python3


%prep
%setup -q


%build
%py2_build

%if 0%{?with_python3}
%py3_build
%endif # with_python3


%install
%py2_install

# remove shebangs
find %{buildroot}%{python2_sitelib} -name '*.py' \
     -exec sed -i -e '1{/^#!/d}' {} \;

# rename binaries
pushd %{buildroot}%{_bindir}
for cmd in py.cleanup py.convert_unittest py.countloc py.lookup py.svnwcrevert py.which; do
  mv ${cmd} ${cmd}-%{python2_version}
done
popd

%if 0%{?with_python3}
%py3_install

# remove shebangs from all scripts
find %{buildroot}%{python3_sitelib} -name '*.py' \
     -exec sed -i -e '1{/^#!/d}' {} \;

# rename binaries
pushd %{buildroot}%{_bindir}
for cmd in py.cleanup py.convert_unittest py.countloc py.lookup py.svnwcrevert py.which; do
  mv ${cmd} ${cmd}-%{python3_version}
done
%endif # with_python3

# 2.X binaries are called by default for now
pushd %{buildroot}%{_bindir}
for cmd in py.cleanup py.convert_unittest py.countloc py.lookup py.svnwcrevert py.which; do
  ln -s ${cmd}-%{python2_version} ${cmd}
done
popd


%files -n python2-pycmd
%doc README.txt
%doc CHANGELOG
%license LICENSE
%{_bindir}/py.cleanup
%{_bindir}/py.cleanup-%{python2_version}
%{_bindir}/py.convert_unittest
%{_bindir}/py.convert_unittest-%{python2_version}
%{_bindir}/py.countloc
%{_bindir}/py.countloc-%{python2_version}
%{_bindir}/py.lookup
%{_bindir}/py.lookup-%{python2_version}
%{_bindir}/py.svnwcrevert
%{_bindir}/py.svnwcrevert-%{python2_version}
%{_bindir}/py.which
%{_bindir}/py.which-%{python2_version}
%{python2_sitelib}/*


%if 0%{?with_python3}
%files -n python%{python3_pkgversion}-pycmd
%doc README.txt
%doc CHANGELOG
%license LICENSE
%{_bindir}/py.cleanup-%{python3_version}
%{_bindir}/py.convert_unittest-%{python3_version}
%{_bindir}/py.countloc-%{python3_version}
%{_bindir}/py.lookup-%{python3_version}
%{_bindir}/py.svnwcrevert-%{python3_version}
%{_bindir}/py.which-%{python3_version}
%{python3_sitelib}/*
%endif # with_python3


%changelog
* Thu Mar 07 2019 Troy Dawson <tdawson@redhat.com> - 1.2-5
- Rebuilt to change main python from 3.4 to 3.6

* Thu Dec 22 2016 Orion Poplawski <orion@cora.nwra.com> - 1.2-4
- Ship python2-pycmd
- Build python3 for EPEL
- Modernize spec

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

* Fri May 29 2015 Thomas Moschny <thomas.moschny@gmx.de> - 1.2-2
- Remove extra %%setup command.

* Thu Apr 23 2015 Thomas Moschny <thomas.moschny@gmx.de> - 1.2-1
- Update to 1.2.

* Mon Apr 20 2015 Thomas Moschny <thomas.moschny@gmx.de> - 1.1-2
- Apply updated Python packaging guidelines.
- Mark LICENSE with %%license.

* Fri Jul 18 2014 Thomas Moschny <thomas.moschny@gmx.de> - 1.1-1
- Update to 1.1.

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

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

* Sat Aug 17 2013 Thomas Moschny <thomas.moschny@gmx.de> - 1.0-10
- Update distribute_setup.py (fixes rhbz#992844).
- Modernize spec file.

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

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

* Sat Aug 04 2012 David Malcolm <dmalcolm@redhat.com> - 1.0-7
- rebuild for https://fedoraproject.org/wiki/Features/Python_3.3

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Sat Sep  3 2011 Thomas Moschny <thomas.moschny@gmx.de> - 1.0-4
- Fix: python3 dependencies.

* Thu Aug 11 2011 Thomas Moschny <thomas.moschny@gmx.de> - 1.0-3
- Update Requires and BuildRequires tags.

* Tue Jul  5 2011 Thomas Moschny <thomas.moschny@gmx.de> - 1.0-2
- Python3 subpackage.

* Sun Jan 16 2011 Thomas Moschny <thomas.moschny@gmx.de> - 1.0-1
- New package.