From db7284c1f3205b7359e1d4e4d0f80702610fd264 Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Apr 15 2019 11:56:04 +0000 Subject: spec file --- diff --git a/sidetag-koji-plugin.spec b/sidetag-koji-plugin.spec new file mode 100644 index 0000000..c0f7107 --- /dev/null +++ b/sidetag-koji-plugin.spec @@ -0,0 +1,122 @@ +# Enable Python 3 builds for Fedora +%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 + +%if 0%{?rhel} && 0%{?rhel} <= 6 +%{!?__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 + +Name: koji-sidetag-plugin +Version: 0.1 +Release: 1%{?dist} +Summary: Koji support for sidetags +Group: Applications/System +License: GPLv2 +URL: https://pagure.io/sidetag-koji-plugin +Source0: %{name}-%{version}.tar.bz2 +# generated by +# git archive --format=tar --prefix=$(name)-$(version)/ HEAD |bzip2 > $(name)-$(version).tar.bz2 +BuildArch: noarch +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildRequires: python +BuildRequires: python2-devel +%if 0%{with python3} +BuildRequires: python3-devel +%endif +BuildRequires: python-setuptools + +%description +Koji support for sidetags + +%package -n python2-%{name}-hub +Summary: Sidetag plugin for koji hub +Requires: python2-koji-hub + +%description -n python2-%{name}-hub +Koji hub plugin for handling sidetags. + +%if 0%{with python3} +%package -n python%{python3_pkgversion}-%{name}-hub +%{?python_provide:%python_provide python%{python3_pkgversion}-%{name}-hub} +Summary: Sidetag plugin for koji hub +Provides: koji-containerbuild-hub +Requires: python%{python3_pkgversion}-koji-hub + +%description -n python%{python3_pkgversion}-%{name}-hub +Koji hub plugin for handling sidetags. +%endif + +%package -n python2-%{name}-cli +%{?python_provide:%python_provide python2-%{name}-cli} +Summary: Sidetag plugin for koji CLI +Provides: koji-containerbuild-cli +Requires: python2-koji + +%description -n python2-%{name}-cli +Koji CLI plugin for handling sidetags. + +%if 0%{with python3} +%package -n python%{python3_pkgversion}-%{name}-cli +%{?python_provide:%python_provide python%{python3_pkgversion}-%{name}-cli} +Summary: Sidetag plugin for koji CLI +Provides: koji-containerbuild-cli +Requires: python%{python3_pkgversion}-koji + +%description -n python%{python3_pkgversion}-%{name}-cli +Koji CLI plugin for handling sidetags. +%endif + +%if 0%{with python3} +%package -n python%{python3_pkgversion}-%{name}-tools +%{?python_provide:%python_provide python%{python3_pkgversion}-%{name}-tools} +Summary: Sidetag plugin tools +Provides: koji-containerbuild-tools +Requires: python%{python3_pkgversion}-koji + +%description -n python%{python3_pkgversion}-%{name}-tools +Koji sidetag plugin's tools. +%endif + +%prep +%setup -q + +%build + +%install +%{__install} -d $RPM_BUILD_ROOT%{_prefix}/lib/koji-hub-plugins +%{__install} -p -m 0644 sidetag_hub.py $RPM_BUILD_ROOT%{_prefix}/lib/koji-hub-plugins/sidetag_hub.py +%{__install} -d $RPM_BUILD_ROOT%{python2_sitelib}/koji_cli_plugins +%{__install} -p -m 0644 sidetag_cli.py $RPM_BUILD_ROOT%{python2_sitelib}/koji_cli_plugins/sidetag_cli.py +%if 0%{with python3} +%{__install} -d $RPM_BUILD_ROOT%{python3_sitelib}/koji_cli_plugins +%{__install} -p -m 0644 sidetag_cli.py $RPM_BUILD_ROOT%{python3_sitelib}/koji_cli_plugins/sidetag_cli.py +%{__install} -d $RPM_BUILD_ROOT%{_prefix}/bin +%{__install} -p -m 0755 koji-sidetag-cleanup $RPM_BUILD_ROOT%{_prefix}/bin/koji-sidetag-cleanup +%endif + +%clean +rm -rf $RPM_BUILD_ROOT + +%files -n python2-%{name}-cli +%{python2_sitelib}/koji_cli_plugins + +%files -n python2-%{name}-hub +%{_prefix}/lib/koji-hub-plugins + +%if 0%{with python3} +%files -n python%{python3_pkgversion}-%{name}-cli +%{python3_sitelib}/koji_cli_plugins + +%files -n python%{python3_pkgversion}-%{name}-hub +%{_prefix}/lib/koji-hub-plugins/sidetag_hub.py + +%files -n python%{python3_pkgversion}-%{name}-tools +%{_prefix}/bin/koji-sidetag-cleanup +%endif +