| |
@@ -1,3 +1,23 @@
|
| |
+ %if 0%{?fedora}
|
| |
+ %bcond_without python3
|
| |
+ # If the definition isn't available for python3_pkgversion, define it
|
| |
+ %{?!python3_pkgversion:%global python3_pkgversion 3}
|
| |
+ %else
|
| |
+ %bcond_with python3
|
| |
+ %endif
|
| |
+
|
| |
+ # Compatibility with RHEL. These macros have been added to EPEL but
|
| |
+ # not yet to RHEL proper.
|
| |
+ # https://bugzilla.redhat.com/show_bug.cgi?id=1307190
|
| |
+ %{!?__python2: %global __python2 /usr/bin/python2}
|
| |
+ %{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
|
| |
+ %{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
|
| |
+ %{!?py2_build: %global py2_build %{expand: CFLAGS="%{optflags}" %{__python2} setup.py %{?py_setup_args} build --executable="%{__python2} -s"}}
|
| |
+ %{!?py2_install: %global py2_install %{expand: CFLAGS="%{optflags}" %{__python2} setup.py %{?py_setup_args} install -O1 --skip-build --root %{buildroot}}}
|
| |
+
|
| |
+ # If the definition isn't available for python3_pkgversion, define it
|
| |
+ %{?!python3_pkgversion:%global python3_pkgversion 3}
|
| |
+
|
| |
Name: koji-tools
|
| |
Version: 1.3
|
| |
Release: 2%{?dist}
|
| |
@@ -8,14 +28,33 @@
|
| |
Source0: %{name}-%{version}.tar.gz
|
| |
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
|
| |
BuildArch: noarch
|
| |
-
|
| |
BuildRequires: python-devel
|
| |
+ %if 0%{with python3}
|
| |
+ BuildRequires: python3-devel
|
| |
+ %endif
|
| |
Requires: koji
|
| |
|
| |
%description
|
| |
provides a collection of tools/utilities that interacts
|
| |
and automates koji tasks for the user.
|
| |
|
| |
+ %package -n python2-%{name}-plugins-cli
|
| |
+ Summary: Koji tools for use as plugins
|
| |
+ Requires: python2-koji
|
| |
+
|
| |
+ %description -n python2-%{name}-plugins-cli
|
| |
+ Various plugins for koji
|
| |
+
|
| |
+ %if 0%{with python3}
|
| |
+ %package -n python%{python3_pkgversion}-%{name}-plugins-cli
|
| |
+ Summary: Koji tools for use as plugins
|
| |
+ Requires: python%{python3_pkgversion}-koji
|
| |
+ %{?python_provide:%python_provide python%{python3_pkgversion}-%{name}-hub}
|
| |
+
|
| |
+ %description -n python%{python3_pkgversion}-%{name}-plugins-cli
|
| |
+ Various plugins for koji
|
| |
+ %endif
|
| |
+
|
| |
%prep
|
| |
%setup -q
|
| |
|
| |
@@ -25,16 +64,30 @@
|
| |
rm -rf $RPM_BUILD_ROOT
|
| |
install -d $RPM_BUILD_ROOT%{_bindir}
|
| |
install -pm 0755 src/bin/* $RPM_BUILD_ROOT%{_bindir}
|
| |
+ install -d $RPM_BUILD_ROOT%{python2_sitelib}/koji_cli_plugins
|
| |
+ install -pm 0644 src/plugins/cli/* $RPM_BUILD_ROOT%{python2_sitelib}/koji_cli_plugins
|
| |
+ %if 0%{with python3}
|
| |
+ install -d $RPM_BUILD_ROOT%{python3_sitelib}/koji_cli_plugins
|
| |
+ install -pm 0644 src/plugins/cli/* $RPM_BUILD_ROOT%{python3_sitelib}/koji_cli_plugins
|
| |
+ %endif
|
| |
|
| |
%clean
|
| |
rm -rf $RPM_BUILD_ROOT
|
| |
|
| |
-
|
| |
%files
|
| |
%defattr(-,root,root,-)
|
| |
%{_bindir}/*
|
| |
%doc COPYING LGPL
|
| |
|
| |
+ %files -n python2-%{name}-plugins-cli
|
| |
+ %defattr(-,root,root,-)
|
| |
+ %{python2_sitelib}/koji_cli_plugins
|
| |
+
|
| |
+ %if 0%{with python3}
|
| |
+ %files -n python%{python3_pkgversion}-%{name}-plugins-cli
|
| |
+ %defattr(-,root,root,-)
|
| |
+ %{python3_sitelib}/koji_cli_plugins
|
| |
+ %endif
|
| |
|
| |
%changelog
|
| |
* Mon Sep 26 2016 Jay Greguske <jgregusk@redhat.com> 1.3-2
|
| |
%if 0%{?fedora} || 0%{?rhel} >= 8