diff --git a/cobbler.spec b/cobbler.spec index a403e66..6294f5f 100644 --- a/cobbler.spec +++ b/cobbler.spec @@ -1,5 +1,8 @@ -%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} -%{!?pyver: %define pyver %(%{__python} -c "import sys ; print sys.version[:3]" || echo 0)} +%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())")} +%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} +%endif %define _binaries_in_noarch_packages_terminate_build 0 %global debug_package %{nil} @@ -17,10 +20,11 @@ Url: http://www.cobblerd.org/ BuildRequires: redhat-rpm-config BuildRequires: git +BuildRequires: python2-devel BuildRequires: PyYAML BuildRequires: python-cheetah +BuildRequires: python-setuptools -Requires: python >= 2.3 Requires: httpd Requires: tftp-server Requires: mod_wsgi @@ -34,12 +38,10 @@ Requires: rsync Requires: syslinux %if 0%{?fedora} || 0%{?rhel} >= 6 -Requires: python(abi) >= %{pyver} Requires: genisoimage %else Requires: mkisofs %endif -BuildRequires: python-setuptools Requires: yum-utils %if 0%{?fedora} || 0%{?rhel} >= 7 BuildRequires: systemd-units @@ -68,11 +70,11 @@ other applications. %setup -q %build -%{__python} setup.py build +%{__python2} setup.py build %install test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT -%{__python} setup.py install --optimize=1 --root=$RPM_BUILD_ROOT $PREFIX +%{__python2} setup.py install --skip-build --root=$RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/etc/httpd/conf.d mv config/cobbler.conf $RPM_BUILD_ROOT/etc/httpd/conf.d/ mv config/cobbler_web.conf $RPM_BUILD_ROOT/etc/httpd/conf.d/ @@ -228,7 +230,7 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT /etc/init.d/cobblerd %endif -%{python_sitelib}/cobbler +%{python2_sitelib}/cobbler %config(noreplace) /var/lib/cobbler %exclude /var/lib/cobbler/webui_sessions @@ -240,9 +242,9 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT %config(noreplace) /etc/httpd/conf.d/cobbler.conf -%exclude %{python_sitelib}/cobbler/sub_process.py* +%exclude %{python2_sitelib}/cobbler/sub_process.py* %if 0%{?fedora} || 0%{?rhel} > 5 -%{python_sitelib}/cobbler*.egg-info +%{python2_sitelib}/cobbler*.egg-info /var/lib/tftpboot/images %else /tftpboot/images @@ -254,9 +256,7 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT Summary: Helper tool that performs cobbler orders on remote machines Group: Applications/System -Requires: python >= 2.0 %if 0%{?fedora} || 0%{?rhel} >= 6 -Requires: python(abi) >= %{pyver} Requires: python-simplejson Requires: virt-install %endif @@ -274,11 +274,11 @@ of an existing system. For use with a boot-server configured with Cobbler %{_bindir}/koan %{_bindir}/ovz-install %{_bindir}/cobbler-register -%{python_sitelib}/koan +%{python2_sitelib}/koan -%exclude %{python_sitelib}/koan/sub_process.py* -%exclude %{python_sitelib}/koan/opt_parse.py* -%exclude %{python_sitelib}/koan/text_wrap.py* +%exclude %{python2_sitelib}/koan/sub_process.py* +%exclude %{python2_sitelib}/koan/opt_parse.py* +%exclude %{python2_sitelib}/koan/text_wrap.py* %{_mandir}/man1/koan.1.gz %{_mandir}/man1/cobbler-register.1.gz @@ -294,9 +294,6 @@ Requires: cobbler Requires: Django >= 1.1.2 Requires: mod_wsgi Requires: mod_ssl -%if 0%{?fedora} || 0%{?rhel} >= 6 -Requires: python(abi) >= %{pyver} -%endif %description -n cobbler-web