Compare commits

...

20 Commits

Author SHA1 Message Date
Miro Hrončok 99a8a3e31e Included in RHEL 7.7+ 2019-10-07 19:10:57 +02:00
Kevin Fenzi 82adee8667 Update to larger than 30 so rhel7.7 python2 will work in koji.
Note: this package should be retired as soon as centos 7.7 is out.
Note: this package should NOT be pushed as an update, only used as a override.
2019-08-14 08:05:31 -07:00
Mohan Boddu 0c6d6cedbb Revert "Included in RHEL 7.7+"
Unretirement for https://pagure.io/releng/issue/8607

This reverts commit b6f2fa0c76.
2019-08-11 03:48:56 -04:00
Miro Hrončok b6f2fa0c76 Included in RHEL 7.7+ 2019-08-09 15:40:26 +02:00
Miro Hrončok 255d30c7f4 Split python3-other-rpm-macros from python-rpm-macros to python-epel-rpm-macros 2019-04-30 11:25:57 +02:00
Miro Hrončok efb740f820 %python_provide: Obsolete and provide py36- from py3-, provide py3- from py36-
The "python36" is intentionally hardcoded and does not use the
%python3_pkgversion macro, as that can be overridden in spec for
various reasons.

See https://lists.fedoraproject.org/archives/list/epel-devel@lists.fedoraproject.org/message/RYDGY4BKYTLYH5IOECMPEZYFUZEXCDRN/
2019-04-25 16:39:04 +02:00
Miro Hrončok 99f8b82d04 Switch 3.4 and 3.6 2019-03-07 16:21:06 +01:00
Tomas Orsava 0fe7b8e184 Move macros.pybytecompile in here from python3X-devel
macros.pybytecompile: Detect Python version through sys.version_info

...instead of guessing from the executable name.

This should make it work on EPEL7 as well where we ship 3.4 and 3.6

https://bugzilla.redhat.com/show_bug.cgi?id=1599809
2018-07-19 14:57:46 +02:00
Jason Tibbitts ef7f75882a Add %python3(_other)?_platform macros. 2018-07-09 14:44:54 -05:00
Tadej Janež 8ef228123a
Add %python3_other_* counterparts for %python3_* macros in EPEL 7 2018-06-21 21:54:43 +02:00
Jason Tibbitts 06d80134eb Add %pypi_source macro. 2018-06-18 18:12:26 -05:00
Charalampos Stratakis 6c29671c63 Add python36 as EPEL's other python 2017-12-20 23:06:54 +01:00
Orion Poplawski 6c4c3f3681 Merge commit 'd0fdb0d759b960b41b57bf7c9539901f16062e0a' into epel7 2017-03-09 12:19:54 -07:00
Orion Poplawski 096c42c121 Merge branch 'master' into epel7 2016-08-24 16:51:15 -06:00
Tomas Orsava 87acff351c Merge branch 'master' into epel7 2016-08-22 17:18:34 +02:00
Orion Poplawski cc0b15603c Set %__python3 to /usr/bin/python3.4 2016-01-25 16:55:23 -07:00
Orion Poplawski 0795b1d7b1 Merge branch 'master' into epel7 2016-01-14 20:51:58 -07:00
Orion Poplawski 68a7e6e10b Merge branch 'master' into epel7
Conflicts:
	macros.python
	macros.python-srpm
	python-rpm-macros.spec
2016-01-14 16:22:53 -07:00
Orion Poplawski 237061d265 Handle python3_other_pkgversion in python_provide; Drop duplicate py3_other macros from macros.python 2016-01-14 14:46:42 -07:00
Orion Poplawski 86a7ec8de5 EPEL version 2016-01-14 14:32:55 -07:00
8 changed files with 1 additions and 337 deletions

0
.gitignore vendored
View File

1
dead.package Normal file
View File

@ -0,0 +1 @@
Included in RHEL 7.7+

View File

@ -1,73 +0,0 @@
%py_setup setup.py
%py_shbang_opts -s
# Use the slashes after expand so that the command starts on the same line as
# the macro
%py_build() %{expand:\\\
CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args} build --executable="%{__python2} %{py_shbang_opts}" %{?*}
sleep 1
}
%py_build_egg() %{expand:\\\
CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args} bdist_egg %{?*}
sleep 1
}
%py_build_wheel() %{expand:\\\
CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args} bdist_wheel %{?*}
sleep 1
}
%py_install() %{expand:\\\
CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*}
}
%py_install_egg() %{expand:\\\
mkdir -p %{buildroot}%{python_sitelib}
easy_install -m --prefix %{buildroot}%{_prefix} -Z dist/*-py%{python_version}.egg %{?*}
}
%py_install_wheel() %{expand:\\\
pip install -I dist/%{1} --root %{buildroot} --strip-file-prefix %{buildroot} --no-deps
}
%python_provide() %{lua:
function string.starts(String,Start)
return string.sub(String,1,string.len(Start))==Start
end
package = rpm.expand("%{?1}")
vr = rpm.expand("%{?epoch:%{epoch}:}%{version}-%{release}")
if (string.starts(package, "python2-")) then
if (rpm.expand("%{?buildarch}") ~= "noarch") then
str = "Provides: python-" .. string.sub(package,9,string.len(package)) .. "%{?_isa} = " .. vr
print(rpm.expand(str))
end
print("\\nProvides: python-")
print(string.sub(package,9,string.len(package)))
print(" = ")
print(vr)
--Obsoleting the previous default python package
print("\\nObsoletes: python-")
print(string.sub(package,9,string.len(package)))
print(" < ")
print(vr)
elseif (string.starts(package, "python" .. rpm.expand("%{python3_pkgversion}") .. "-")) then
--No unversioned provides as python3 is not default
elseif (rpm.expand("%{?python3_other_pkgversion}") ~= "" and string.starts(package, "python" .. rpm.expand("%{python3_other_pkgversion}") .. "-")) then
--No unversioned provides as python3_other 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("%python_provide: ERROR: ")
print(package)
print(" not recognized.")
end
}

View File

@ -1,63 +0,0 @@
# python3_pkgversion specifies the version of Python 3 in the distro. It can be
# a specific version (e.g. 34 in Fedora EPEL7)
%python3_pkgversion 3
# Set to /bin/true to avoid %ifdefs and %{? in specfiles
%__python3_other /bin/true
%py3_other_build /bin/true
%py3_other_install /bin/true
# === Macros for Build/Requires tags using Python dist tags ===
# - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
# - These macros need to be in macros.python-srpm, because BuildRequires tags
# get rendered as runtime requires into the metadata of SRPMs.
# Converts Python dist name to a canonical format
%py_dist_name() %{lua:\
name = rpm.expand("%{?1:%{1}}");\
canonical = string.gsub(string.lower(name), "%W+", "-");\
print(canonical);\
}
# Creates Python 2 dist tag(s) after converting names to canonical format
# Needs to first put all arguments into a list, because invoking a different
# macro (%py_dist_name) overwrites them
%py2_dist() %{lua:\
args = {}\
arg = 1\
while (true) do\
name = rpm.expand("%{?" .. arg .. ":%{" .. arg .. "}}");\
if (name == nil or name == '') then\
break\
end\
args[arg] = name\
arg = arg + 1\
end\
for arg, name in ipairs(args) do\
canonical = rpm.expand("%py_dist_name " .. name);\
print("python2dist(" .. canonical .. ") ");\
end\
}
# Creates Python 3 dist tag(s) after converting names to canonical format
# Needs to first put all arguments into a list, because invoking a different
# macro (%py_dist_name) overwrites them
%py3_dist() %{lua:\
args = {}\
arg = 1\
while (true) do\
name = rpm.expand("%{?" .. arg .. ":%{" .. arg .. "}}");\
if (name == nil or name == '') then\
break\
end\
args[arg] = name\
arg = arg + 1\
end\
for arg, name in ipairs(args) do\
canonical = rpm.expand("%py_dist_name " .. name);\
print("python3dist(" .. canonical .. ") ");\
end\
}

View File

@ -1,37 +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
# Use the slashes after expand so that the command starts on the same line as
# the macro
%py2_build() %{expand:\\\
CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} build --executable="%{__python2} %{py2_shbang_opts}" %{?*}
sleep 1
}
%py2_build_egg() %{expand:\\\
CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} bdist_egg %{?*}
sleep 1
}
%py2_build_wheel() %{expand:\\\
CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} bdist_wheel %{?*}
sleep 1
}
%py2_install() %{expand:\\\
CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*}
}
%py2_install_egg() %{expand:\\\
mkdir -p %{buildroot}%{python2_sitelib}
easy_install-%{python2_version} -m --prefix %{buildroot}%{_prefix} -Z dist/*-py%{python2_version}.egg %{?*}
}
%py2_install_wheel() %{expand:\\\
pip%{python2_version} install -I dist/%{1} --root %{buildroot} --strip-file-prefix %{buildroot} --no-deps
}

View File

@ -1,38 +0,0 @@
%__python3 /usr/bin/python3
%python3_sitelib %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
%python3_sitearch %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")
%python3_version %(%{__python3} -c "import sys; sys.stdout.write(sys.version[:3])")
%python3_version_nodots %(%{__python3} -c "import sys; sys.stdout.write(sys.version[:3].replace('.',''))")
%py3dir %{_builddir}/python3-%{name}-%{version}-%{release}
%py3_shbang_opts -s
# Use the slashes after expand so that the command starts on the same line as
# the macro
%py3_build() %{expand:\\\
CFLAGS="%{optflags}" %{__python3} %{py_setup} %{?py_setup_args} build --executable="%{__python3} %{py3_shbang_opts}" %{?*}
sleep 1
}
%py3_build_egg() %{expand:\\\
CFLAGS="%{optflags}" %{__python3} %{py_setup} %{?py_setup_args} bdist_egg %{?*}
sleep 1
}
%py3_build_wheel() %{expand:\\\
CFLAGS="%{optflags}" %{__python3} %{py_setup} %{?py_setup_args} bdist_wheel %{?*}
sleep 1
}
%py3_install() %{expand:\\\
CFLAGS="%{optflags}" %{__python3} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*}
}
%py3_install_egg() %{expand:\\\
mkdir -p %{buildroot}%{python3_sitelib}
easy_install-%{python3_version} -m --prefix %{buildroot}%{_prefix} -Z dist/*-py%{python3_version}.egg %{?*}
}
%py3_install_wheel() %{expand:\\\
pip%{python3_version} install -I dist/%{1} --root %{buildroot} --strip-file-prefix %{buildroot} --no-deps
}

View File

@ -1,126 +0,0 @@
Name: python-rpm-macros
Version: 3
Release: 17%{?dist}
Summary: The unversioned Python RPM macros
License: MIT
Source0: macros.python
Source1: macros.python-srpm
Source2: macros.python2
Source3: macros.python3
BuildArch: noarch
# For %%python3_pkgversion used in %%python_provide
Requires: python-srpm-macros
Obsoletes: python-macros < 3
Provides: python-macros = %{version}-%{release}
%description
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 -n python-srpm-macros
Summary: RPM macros for building Python source packages
%description -n python-srpm-macros
RPM macros for building Python source packages.
%package -n python2-rpm-macros
Summary: RPM macros for building Python 2 packages
# Would need to be different for each release - worth it?
#Conflicts: python2-devel < 2.7.11-3
%description -n python2-rpm-macros
RPM macros for building Python 2 packages.
%package -n python3-rpm-macros
Summary: RPM macros for building Python 3 packages
# Would need to be different for each release - worth it?
#Conflicts: python3-devel < 3.5.1-3
%description -n python3-rpm-macros
RPM macros for building Python 3 packages.
%prep
%build
%install
mkdir -p %{buildroot}/%{rpmmacrodir}
install -m 644 %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} \
%{buildroot}/%{rpmmacrodir}/
%files
%{rpmmacrodir}/macros.python
%files -n python-srpm-macros
%{rpmmacrodir}/macros.python-srpm
%files -n python2-rpm-macros
%{rpmmacrodir}/macros.python2
%files -n python3-rpm-macros
%{rpmmacrodir}/macros.python3
%changelog
* Mon Jan 23 2017 Michal Cyprian <mcyprian@redhat.com> - 3-17
- Add --no-deps option to py_install_wheel macros
* Tue Jan 17 2017 Tomas Orsava <torsava@redhat.com> - 3-16
- Added macros for Build/Requires tags using Python dist tags:
https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
* Thu Nov 24 2016 Orion Poplawski <orion@cora.nwra.com> 3-15
- Make expanded macros start on the same line as the macro
* Wed Nov 16 2016 Orion Poplawski <orion@cora.nwra.com> 3-14
- Fix %%py3_install_wheel (bug #1395953)
* Wed Nov 16 2016 Orion Poplawski <orion@cora.nwra.com> 3-13
- Add missing sleeps to other build macros
- Fix build_egg macros
- Add %%py_build_wheel and %%py_install_wheel macros
* Tue Nov 15 2016 Orion Poplawski <orion@cora.nwra.com> 3-12
- Add %%py_build_egg and %%py_install_egg macros
- Allow multiple args to %%py_build/install macros
- Tidy up macro formatting
* Wed Aug 24 2016 Orion Poplawski <orion@cora.nwra.com> 3-11
- Use %%rpmmacrodir
* Tue Jul 12 2016 Orion Poplawski <orion@cora.nwra.com> 3-10
- Do not generate useless Obsoletes with %%{?_isa}
* Fri May 13 2016 Orion Poplawski <orion@cora.nwra.com> 3-9
- Make python-rpm-macros require python-srpm-macros (bug #1335860)
* Thu May 12 2016 Jason L Tibbitts III <tibbs@math.uh.edu> - 3-8
- Add single-second sleeps to work around setuptools bug.
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Thu Jan 14 2016 Orion Poplawski <orion@cora.nwra.com> 3-6
- Fix typo in %%python_provide
* Thu Jan 14 2016 Orion Poplawski <orion@cora.nwra.com> 3-5
- Handle noarch python sub-packages (bug #1290900)
* Wed Jan 13 2016 Orion Poplawski <orion@cora.nwra.com> 3-4
- Fix python2/3-rpm-macros package names
* Thu Jan 7 2016 Orion Poplawski <orion@cora.nwra.com> 3-3
- Add empty %%prep and %%build
* Mon Jan 4 2016 Orion Poplawski <orion@cora.nwra.com> 3-2
- Combined package
* Wed Dec 30 2015 Orion Poplawski <orion@cora.nwra.com> 3-1
- Initial package

View File