Drop macros, require python/python2-rpm-macros

This commit is contained in:
Orion Poplawski 2016-01-13 12:02:55 -07:00
parent 8d55496acc
commit 9e0b4c9182
3 changed files with 6 additions and 96 deletions

View File

@ -1,49 +0,0 @@
%py_setup setup.py
%py_shbang_opts -s
%py_build() %{expand:\
CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args} build --executable="%{__python2} %{py_shbang_opts}" %{?1}\
}
%py_install() %{expand:\
CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?1}\
}
%python_provide() %{lua:\
function string.starts(String,Start)\
return string.sub(String,1,string.len(Start))==Start\
end\
package = rpm.expand("%{?1:%{1}}");\
vr = rpm.expand("%{?epoch:%{epoch}:}%{version}-%{release}")
if (string.starts(package, "python2-")) then\
str = "Provides: python-" .. string.sub(package,9,string.len(package)) .. "%{?_isa} = " .. vr;\
print(rpm.expand(str));\
print("\\nProvides: python-");\
print(string.sub(package,9,string.len(package)));\
print(" = ");\
print(vr);\
--Obsoleting the previous default python package\
str = "\\nObsoletes: python-" .. string.sub(package,9,string.len(package)) .. "%{?_isa} < " .. vr;\
print(rpm.expand(str));\
print("\\nObsoletes: python-");\
print(string.sub(package,9,string.len(package)));\
print(" < ");\
print(vr);\
elseif (string.starts(package, "python3-")) then\
--No unversioned provides as python3 is not default\
elseif (string.starts(package, "pypy-")) then\
--No unversioned provides as pypy is not default\
elseif (string.starts(package, "pypy3-")) then\
--No unversioned provides as pypy is not default\
elseif (string.starts(package, "python-")) then\
--Providing the current default python\
print("Provides: python2-");\
print(string.sub(package,8,string.len(package)));\
print(" = ");\
print(vr);\
else\
print("ERROR: ");\
print(package);\
print("not recognized.");\
end\
}

View File

@ -1,15 +0,0 @@
%__python2 /usr/bin/python2
%python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
%python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")
%python2_version %(%{__python2} -c "import sys; sys.stdout.write('{0.major}.{0.minor}'.format(sys.version_info))")
%python2_version_nodots %(%{__python2} -c "import sys; sys.stdout.write('{0.major}{0.minor}'.format(sys.version_info))")
%py2_shbang_opts -s
%py2_build() %{expand:\
CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} build --executable="%{__python2} %{py2_shbang_opts}" %{?1}\
}
%py2_install() %{expand:\
CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?1}\
}

View File

@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.11
Release: 2%{?dist}
Release: 3%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@ -201,16 +201,8 @@ Source4: systemtap-example.stp
# Written by dmalcolm; not yet sent upstream
Source5: pyfuntop.stp
# Supply various useful macros for building python 2 modules:
# __python2, python2_sitelib, python2_sitearch, python2_version
Source6: macros.python2
Source7: pynche
# Supply version independent macros such as python_provide, py_build and
# py_install
Source8: macros.python
# Modules/Setup.dist is ultimately used by the "makesetup" script to construct
# the Makefile and config.c
#
@ -1018,7 +1010,8 @@ a scripting language, and by the main "python" executable
Summary: The libraries and header files needed for Python development
Group: Development/Libraries
Requires: %{python}%{?_isa} = %{version}-%{release}
Requires: python-macros
Requires: python-rpm-macros
Requires: python2-rpm-macros
Requires: pkgconfig
# Needed here because of the migration of Makefile from -devel to the main
# package
@ -1040,18 +1033,6 @@ python package will also need to be installed. You'll probably also
want to install the python-docs package, which contains Python
documentation.
%package -n python-macros
Summary: The unversioned Python RPM macros
Group: Development/Libraries
BuildArch: noarch
%description -n python-macros
This package contains the unversioned Python RPM macros, that most
implementations should rely on.
You should not need to install this package manually as the various
python?-devel packages require it. So install a python-devel package instead.
%package tools
Summary: A collection of development tools included with Python
Group: Development/Tools
@ -1652,11 +1633,6 @@ sed -i -e "s/'pyconfig.h'/'%{_pyconfig_h}'/" \
%{buildroot}%{pylibdir}/distutils/sysconfig.py \
%{buildroot}%{pylibdir}/sysconfig.py
# Install macros for rpm:
mkdir -p %{buildroot}/%{_rpmconfigdir}/macros.d/
install -m 644 %{SOURCE6} %{buildroot}/%{_rpmconfigdir}/macros.d/
install -m 644 %{SOURCE8} %{buildroot}/%{_rpmconfigdir}/macros.d/
# Ensure that the curses module was linked against libncursesw.so, rather than
# libncurses.so (bug 539917)
ldd %{buildroot}/%{dynload_dir}/_curses*.so \
@ -1968,11 +1944,6 @@ rm -fr %{buildroot}
%endif
%{_bindir}/python%{pybasever}-config
%{_libdir}/libpython%{pybasever}.so
%{_rpmconfigdir}/macros.d/macros.python2
%files -n python-macros
%defattr(-,root,root,-)
%{_rpmconfigdir}/macros.d/macros.python
%files tools
%defattr(-,root,root,755)
@ -2155,6 +2126,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
* Wed Jan 13 2016 Orion Poplawski <orion@cora.nwra.com> - 2.7.11-3
- Drop macros, require python/python2-rpm-macros
* Wed Dec 30 2015 Orion Poplawski <orion@cora.nwra.com> - 2.7.11-2
- Get ready for separate python-macros package