python-rpm-generators/python-rpm-generators.spec

123 lines
4.3 KiB
RPMSpec
Raw Normal View History

2017-05-15 14:06:24 +00:00
# This package is part of the Python 3 bootstrapping sequence.
#
# The python3-devel subpackage has a runtime dependency on this package.
# Therefore it needs to be built before Python 3 itself. To facilitate this,
# this package has a bootstrapping mode—triggered by the macro below—that skips
# bytecompilation and therefore no Python is actually needed for building of
# this package. After Python 3 is built, this package can be rebuilt in
# normal mode again.
#
# Note, however, that even the bootstrapping version of this package is fully
# functional as Python will simply bytecompile the Python files when they are
# run. There will be a warning that the bytecompiled file cannot be saved
# (unless Python is run with root privileges), but the script will work.
#
# More info on the Python 3 bootstrapping sequence in the `python3` spec file.
#
%global bootstrapping_python 0
# Disable automatic (Python 2) bytecompilation in %%__os_install_post.
# When not in bootstrapping mode, the scripts are bytecompiled
# in the %%install section.
%undefine py_auto_byte_compile
%global srcname rpm
# These macros are copied from the `rpm` package so it's trivial to keep
# the two packages on the same upstream version.
%global rpmver 4.13.0.1
#global snapver rc2
%global srcver %{version}%{?snapver:-%{snapver}}
%global srcdir %{?snapver:testing}%{!?snapver:rpm-%(echo %{version} | cut -d'.' -f1-2).x}
Name: python-rpm-generators
Summary: Requires and Provides generators for Python RPMs
Version: %{rpmver}
2017-05-18 09:07:51 +00:00
Release: %{?snapver:0.%{snapver}.}2%{?dist}
2017-05-15 14:06:24 +00:00
License: GPLv2+
Url: http://www.rpm.org/
Source0: http://ftp.rpm.org/releases/%{srcdir}/%{srcname}-%{srcver}.tar.bz2
BuildArch: noarch
%if ! 0%{?bootstrapping_python}
BuildRequires: python3-devel
%endif
# Patches already upstream:
Patch0: rpm-4.13.x-pythondistdeps.patch
Patch1: rpm-4.13.x-pythondistdeps-Makefile.patch
Patch2: rpm-4.13.x-pythondistdeps-fileattr.patch
Patch3: rpm-4.13.x-pythondistdeps.py-skip-distribution-metadata-if-ther.patch
Patch4: rpm-4.13.x-pythondistdeps.py-show-warning-if-version-is-not-fou.patch
Patch5: rpm-4.13.x-pythondistdeps.py-skip-.egg-link-files.patch
Patch6: rpm-4.13.x-pythondistdeps.py-add-forgotten-import.patch
Patch7: rpm-4.13.x-pythondistdeps.py-fix-processing-wheels.patch
# Switch the shebang of pythondistdeps.py to Python 3
# Downstream only: https://github.com/rpm-software-management/rpm/pull/212
Patch8: rpm-4.13.x-pythondistdeps-python3.patch
%description
This package provides scripts that analyse Python binary RPM packages
and add appropriate Provides and Requires tags to them.
%package -n python3-rpm-generators
Summary: %{summary}
Requires: python3-setuptools
2017-05-18 09:07:51 +00:00
# We're installing files into rpm's directories, therefore we're requiring it
# to be installed so the directories are created.
Requires: rpm
# Conflicts with older versions of `rpm-build` because it copies several files
# to the same locations which is ok only when they have the same contents.
Conflicts: rpm-build < 4.13.0.1-2
2017-05-15 14:06:24 +00:00
%{?python_provide:%python_provide python3-rpm-generators}
%description -n python3-rpm-generators
This package provides scripts that analyse Python binary RPM packages
and add appropriate Provides and Requires tags to them.
%prep
%autosetup -n %{srcname}-%{srcver} -p1
%build
%if ! 0%{?bootstrapping_python}
%{__python3} -m compileall scripts/
%endif
%install
install -Dm 644 fileattrs/python.attr -t %{buildroot}/%{_fileattrsdir}
install -Dm 755 scripts/pythondeps.sh \
scripts/pythondistdeps.py \
-t %{buildroot}/%{_rpmconfigdir}
%if ! 0%{?bootstrapping_python}
install -Dm 755 scripts/__pycache__/* \
-t %{buildroot}/%{_rpmconfigdir}/__pycache__
%endif
%files -n python3-rpm-generators
2017-05-18 09:07:51 +00:00
%license COPYING
2017-05-15 14:06:24 +00:00
%{_fileattrsdir}/python.attr
%{_rpmconfigdir}/pythondeps.sh
%{_rpmconfigdir}/pythondistdeps.py
%if ! 0%{?bootstrapping_python}
2017-05-18 09:07:51 +00:00
%{_rpmconfigdir}/__pycache__
2017-05-15 14:06:24 +00:00
%endif
%changelog
2017-05-18 09:07:51 +00:00
* Thu May 18 2017 Tomas Orsava <torsava@redhat.com> - 4.13.0.1-2
- Added a license file
- Added a dependency on rpm for the proper directory structure
- Properly owning the __pycache__ directory
2017-05-15 14:06:24 +00:00
* Tue May 02 2017 Tomas Orsava <torsava@redhat.com> - 4.13.0.1-1
- Splitting Python RPM generators from the `rpm` package to standalone one