From db7284c1f3205b7359e1d4e4d0f80702610fd264 Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Apr 15 2019 11:56:04 +0000 Subject: [PATCH 1/3] 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 + From 101b732ea5f5080a26060190a31218ddd0fc7fc7 Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Apr 16 2019 07:59:07 +0000 Subject: [PATCH 2/3] package config --- diff --git a/sidetag-koji-plugin.spec b/sidetag-koji-plugin.spec index c0f7107..ee4eb65 100644 --- a/sidetag-koji-plugin.spec +++ b/sidetag-koji-plugin.spec @@ -89,8 +89,11 @@ Koji sidetag plugin's tools. %build %install +%{__install} -d $RPM_BUILD_ROOT/etc/koji-hub/plugins +%{__install} -p -m 0644 sidetag.conf $RPM_BUILD_ROOT/etc/koji-hub/plugins/sidetag.conf %{__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%{_prefix}/lib/koji-hub-plugins %{__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} @@ -107,6 +110,7 @@ rm -rf $RPM_BUILD_ROOT %{python2_sitelib}/koji_cli_plugins %files -n python2-%{name}-hub +%config(noreplace) /etc/koji-hub/plugins/sidetag.conf %{_prefix}/lib/koji-hub-plugins %if 0%{with python3} @@ -114,6 +118,7 @@ rm -rf $RPM_BUILD_ROOT %{python3_sitelib}/koji_cli_plugins %files -n python%{python3_pkgversion}-%{name}-hub +%config(noreplace) /etc/koji-hub/plugins/sidetag.conf %{_prefix}/lib/koji-hub-plugins/sidetag_hub.py %files -n python%{python3_pkgversion}-%{name}-tools From 48224d88d15134f812cd6f0e696c036e6c331247 Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: May 21 2019 07:03:56 +0000 Subject: [PATCH 3/3] remove rhel6 conditional --- diff --git a/sidetag-koji-plugin.spec b/sidetag-koji-plugin.spec index ee4eb65..7f1b097 100644 --- a/sidetag-koji-plugin.spec +++ b/sidetag-koji-plugin.spec @@ -7,11 +7,6 @@ %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}