Add platform-python macros
This commit is contained in:
parent
b58450b1f3
commit
cb52c18aa9
38
macros.platform-python
Normal file
38
macros.platform-python
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
%__platform_python /usr/libexec/platform-python
|
||||||
|
%platform_python_sitelib %(%{__platform_python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
|
||||||
|
%platform_python_sitearch %(%{__platform_python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")
|
||||||
|
%platform_python_version %(%{__platform_python} -c "import sys; sys.stdout.write(sys.version[:3])")
|
||||||
|
%platform_python_version_nodots %(%{__platform_python} -c "import sys; sys.stdout.write(sys.version[:3].replace('.',''))")
|
||||||
|
%platform_py_dir %{_builddir}/platform-python-%{name}-%{version}-%{release}
|
||||||
|
|
||||||
|
%platform_py_shbang_opts -s
|
||||||
|
|
||||||
|
# Use the slashes after expand so that the command starts on the same line as
|
||||||
|
# the macro
|
||||||
|
%platform_py_build() %{expand:\\\
|
||||||
|
CFLAGS="%{optflags}" %{__platform_python} %{py_setup} %{?py_setup_args} build --executable="%{__platform_python} %{platform_py_shbang_opts}" %{?*}
|
||||||
|
sleep 1
|
||||||
|
}
|
||||||
|
|
||||||
|
%platform_py_build_egg() %{expand:\\\
|
||||||
|
CFLAGS="%{optflags}" %{__platform_python} %{py_setup} %{?py_setup_args} bdist_egg %{?*}
|
||||||
|
sleep 1
|
||||||
|
}
|
||||||
|
|
||||||
|
%platform_py_build_wheel() %{expand:\\\
|
||||||
|
CFLAGS="%{optflags}" %{__platform_python} %{py_setup} %{?py_setup_args} bdist_wheel %{?*}
|
||||||
|
sleep 1
|
||||||
|
}
|
||||||
|
|
||||||
|
%platform_py_install() %{expand:\\\
|
||||||
|
CFLAGS="%{optflags}" %{__platform_python} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*}
|
||||||
|
}
|
||||||
|
|
||||||
|
%platform_py_install_egg() %{expand:\\\
|
||||||
|
mkdir -p %{buildroot}%{platform_python_sitelib}
|
||||||
|
CFLAGS="%{optflags}" %{__platform_python} -m easy_install -m --prefix %{buildroot}%{_prefix} -Z dist/*-py%{platform_python_version}.egg %{?*}
|
||||||
|
}
|
||||||
|
|
||||||
|
%platform_py_install_wheel() %{expand:\\\
|
||||||
|
CFLAGS="%{optflags}" %{__platform_python} -m pip install -I dist/%{1} --root %{buildroot} --strip-file-prefix %{buildroot} --no-deps
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
Name: python-rpm-macros
|
Name: python-rpm-macros
|
||||||
Version: 3
|
Version: 3
|
||||||
Release: 21%{?dist}
|
Release: 22%{?dist}
|
||||||
Summary: The unversioned Python RPM macros
|
Summary: The unversioned Python RPM macros
|
||||||
|
|
||||||
License: MIT
|
License: MIT
|
||||||
@ -8,6 +8,7 @@ Source0: macros.python
|
|||||||
Source1: macros.python-srpm
|
Source1: macros.python-srpm
|
||||||
Source2: macros.python2
|
Source2: macros.python2
|
||||||
Source3: macros.python3
|
Source3: macros.python3
|
||||||
|
Source4: macros.platform-python
|
||||||
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
# For %%python3_pkgversion used in %%python_provide
|
# For %%python3_pkgversion used in %%python_provide
|
||||||
@ -44,6 +45,12 @@ Summary: RPM macros for building Python 3 packages
|
|||||||
%description -n python3-rpm-macros
|
%description -n python3-rpm-macros
|
||||||
RPM macros for building Python 3 packages.
|
RPM macros for building Python 3 packages.
|
||||||
|
|
||||||
|
%package -n platform-python-rpm-macros
|
||||||
|
Summary: RPM macros for building Platform-Python packages
|
||||||
|
|
||||||
|
%description -n platform-python-rpm-macros
|
||||||
|
RPM macros for building Platform-Python packages.
|
||||||
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
|
|
||||||
@ -51,7 +58,7 @@ RPM macros for building Python 3 packages.
|
|||||||
|
|
||||||
%install
|
%install
|
||||||
mkdir -p %{buildroot}/%{rpmmacrodir}
|
mkdir -p %{buildroot}/%{rpmmacrodir}
|
||||||
install -m 644 %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} \
|
install -m 644 %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} \
|
||||||
%{buildroot}/%{rpmmacrodir}/
|
%{buildroot}/%{rpmmacrodir}/
|
||||||
|
|
||||||
|
|
||||||
@ -67,8 +74,14 @@ install -m 644 %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} \
|
|||||||
%files -n python3-rpm-macros
|
%files -n python3-rpm-macros
|
||||||
%{rpmmacrodir}/macros.python3
|
%{rpmmacrodir}/macros.python3
|
||||||
|
|
||||||
|
%files -n platform-python-rpm-macros
|
||||||
|
%{rpmmacrodir}/macros.platform-python
|
||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Aug 02 2017 Tomas Orsava <torsava@redhat.com> - 3-22
|
||||||
|
- Add platform-python macros (https://fedoraproject.org/wiki/Changes/Platform_Python_Stack)
|
||||||
|
|
||||||
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3-21
|
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3-21
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user