Blob Blame History Raw
# RHEL 6 compatibility.
%if 0%{?fedora} > 12
%global with_python3 1
%else
%{!?__python2: %global __python2 /usr/bin/python2}
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
%endif

%global srcname fedfind

Name:           fedfind
Version:        1.6.2
Release:        2%{?dist}
Summary:        Fedora Finder finds Fedora

Group:          Applications/Productivity
License:        GPLv3+
URL:            https://www.happyassassin.net/fedfind
Source0:        https://www.happyassassin.net/fedfind/releases/%{srcname}-%{version}.tar.xz
BuildArch:      noarch

BuildRequires:  python2-devel
%if 0%{?with_python3}
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
%endif # if with_python3
BuildRequires:  python-setuptools
Requires:       python-setuptools
# Not available on EPEL, so made optional in code
# Recommends:   python-subprocess32
Requires:       python-argparse
Requires:       python2-cached_property
Requires:       python-six
Provides:       python2-fedfind
Provides:       python-fedfind

%description
Fedora Finder finds Fedora. For now, that means it finds Fedora images -
for stable releases, milestone pre-releases, TC/RC composes, and nightly
builds.

%if 0%{?with_python3}
%package -n python3-fedfind
Summary:        Fedora Finder finds Fedora (using Python 3)
Group:          Applications/Productivity
# Yes, it's really named differently between py2 and py3...
Requires:       python3-cached-property
Requires:       python3-six
Requires:       python3-setuptools
# old name from pre-Fedora packaging on happyassassin
Obsoletes:      fedfind3 < %{version}-%{release}
Provides:       fedfind3 = %{version}-%{release}

%description -n python3-fedfind
Fedora Finder finds Fedora. For now, that means it finds Fedora images -
for stable releases, milestone pre-releases, TC/RC composes, and nightly
builds. This is the Python 3 build of the fedfind module.
%endif # with_python3


%prep
%setup -q -n %{srcname}-%{version}
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!.*python2|#!%{__python3}|'
%endif # with_python3

%build
%{__python2} setup.py build

%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif # with_python3

%install
rm -rf %{buildroot}

# Must do the python3 install first because the scripts in /usr/bin are
# overwritten with every setup.py install (and we want the python2 version
# to be the default for now).
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install --skip-build --root %{buildroot}
popd
%endif # with_python3

%{__python2} setup.py install --skip-build --root %{buildroot}

%files
%{!?_licensedir:%global license %%doc}
%doc README.md CHANGELOG.md
%license COPYING
%{python2_sitelib}/%{srcname}*
%{_bindir}/fedfind

%if 0%{?with_python3}
%files -n python3-fedfind
%doc README.md CHANGELOG.md
%license COPYING
%{python3_sitelib}/%{srcname}*
%endif # with_python3


%changelog
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6.2-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Fri Oct 02 2015 Adam Williamson <awilliam@redhat.com> - 1.6.2-1
- new release 1.6.2: adjust for new Postrelease nightly location

* Tue Sep 29 2015 Adam Williamson <awilliam@redhat.com> - 1.6.1-1
- new release 1.6.1: behind the scenes stuff, docs changes

* Sat Sep 19 2015 Adam Williamson <awilliam@redhat.com> - 1.6-1
- new release 1.6: image tweaks, post-release daily handling

* Thu Sep 03 2015 Adam Williamson <awilliam@redhat.com> - 1.5.1-1
- new release 1.5.1: image 'size' property, more image parsing tweaks

* Thu Aug 27 2015 Adam Williamson <awilliam@redhat.com> - 1.5-1
- new release 1.5: rsync retries, release wait, tests, expected image changes

* Fri Aug 21 2015 Adam Williamson <awilliam@redhat.com> - 1.4.2-1
- new release 1.4.2: py3 fix

* Fri Aug 21 2015 Adam Williamson <awilliam@redhat.com> - 1.4.1-1
- new release 1.4.1: branched guessing, rsync cleanups, bugfixes

* Thu Aug 20 2015 Adam Williamson <awilliam@redhat.com> - 1.4-1
- new release 1.4: use multicall instead of multiprocess, improve caching

* Thu Aug 20 2015 Adam Williamson <awilliam@redhat.com> - 1.3-1
- new release 1.3: check compose status, image parsing improvements, speedups

* Thu Jul 23 2015 Adam Williamson <awilliam@redhat.com> - 1.2-1
- new release 1.2: proper logging, some small fixes

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Thu Apr 30 2015 Adam Williamson <awilliam@redhat.com> - 1.1.5-1
- new release: add a 'generic URL' output, allow --milestone Branched/Rawhide

* Thu Apr 23 2015 Adam Williamson <awilliam@redhat.com> - 1.1.4-1
- new release: drop shebangs from non-exec files, fix them in exec files
- rename 'fedfind3' to 'python3-fedfind'
- drop the executables from the python3 package (not really needed)

* Thu Apr 16 2015 Adam Williamson <awilliam@redhat.com> - 1.1.3-1
- new release: drop bundled cached_property

* Tue Mar 10 2015 Adam Williamson <awilliam@redhat.com> - 1.1.2-1
- new release: fix path for milestone releases

* Thu Feb 26 2015 Adam Williamson <awilliam@redhat.com> - 1.1.1-1
- 1.1.1: handle a python3 argparse bug causing a crash when no subcmd given

* Thu Feb 26 2015 Adam Williamson <awilliam@redhat.com> - 1.1.0-1
- new release 1.1.0: cleaner URL pref implementation, Python 3 support
- add a fedfind3 package for Python 3

* Wed Feb 25 2015 Adam Williamson <awilliam@redhat.com> - 1.0.8-1
- 1.0.8: use dl.fp.o not download.fp.o URLs for TC/RC images

* Wed Feb 25 2015 Adam Williamson <awilliam@redhat.com> - 1.0.7-1
- 1.0.7: fix a bug in finding nightly images by type

* Wed Feb 18 2015 Adam Williamson <awilliam@redhat.com> - 1.0.6-1
- consolidate image versioning with python-wikitcms/relval, bugfixes

* Thu Feb 12 2015 Adam Williamson <awilliam@redhat.com> - 1.0.5-1
- new release 1.0.5: image detection bugfixes, no koji dep, cleanups

* Mon Feb 09 2015 Adam Williamson <awilliam@redhat.com> - 1.0.4-1
- new release 1.0.4: fix EL 6 compat

* Mon Feb 09 2015 Adam Williamson <awilliam@redhat.com> - 1.0.3-1
- new release 1.0.3: bugfixes, Python 2.6 / RHEL 6 compatibility

* Fri Feb 06 2015 Adam Williamson <awilliam@redhat.com> - 1.0.2-1
- new release 1.0.2: misc. bugfixes and CLI reorg

* Fri Feb 06 2015 Adam Williamson <awilliam@redhat.com> - 1.0.1-1
- add ppc to arches

* Thu Feb 05 2015 Adam Williamson <awilliam@redhat.com> - 1.0-1
- first package build of fedfind