Commit Graph

29 Commits

Author SHA1 Message Date
Miro Hrončok 601d83d35a Support defining %py3_shebang_flags to %nil 2020-12-19 18:47:31 +01:00
Miro Hrončok d9233c9e55 Add %python3_platform_triplet and %python3_ext_suffix
Also add %python_platform_triplet, %python_ext_suffix and %python_platform.

The CI tests are limited to x86_64 for now.

https://fedoraproject.org/wiki/Changes/Python_Upstream_Architecture_Names
2020-09-24 23:36:58 +02:00
Miro Hrončok 1bdef041df Implement %pyX_shebang_fix
See https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproject.org/thread/UGCMDDG3S32U7JJK36OEZNHLUVQQRG3M/
2020-05-20 14:34:35 +02:00
Miro Hrončok e9f07b72aa Define %py(2|3)?_shbang_opts_nodash to be used with pathfix.py -a 2020-02-06 10:26:04 +01:00
Anna Khaitovich 2314fd928a Remove stray __pycache__ directory from /usr/bin when running %py_install, %py_install_wheel and %py_install_egg macros
Solves bz#1739848
2019-12-28 19:16:16 +01:00
Miro Hrončok 64119cef2c Switch %python_provide behavior between Python 2 <--> 3
https://fedoraproject.org/wiki/Changes/Python_means_Python3

Welcome to the future.
2019-07-15 13:22:03 +02:00
Miro Hrončok b67b47d5b0 %python_provide: Don't try to obsolete %_isa provides
Based on recent changes in 04769fa014,
packagers might want to use:

    %{?python_provide:%python_provide python2-foo%{?_isa}}

...for backwards compatibility. However the macro adds obsoletes and
since RPM 4.15, obsoletes with %{?_isa} are not possible:

    Only package names are allowed in Obsoletes: Obsoletes: python-foo(x86-64) < ...

To allow such usage, %python_provide now only obsoletes if the argument
does not end with ")".
2019-07-09 13:45:18 +02:00
Miro Hrončok 04769fa014 Remove the arched provide from %python_provide macro
The way it fetched the information abut archfulness was not reliable
and will stop working entirely.

See https://bugzilla.redhat.com/show_bug.cgi?id=1705656
2019-06-17 09:34:06 +02:00
Miro Hrončok 536b2efe4e Move %__python definition to the srpm macros, so it is always present 2019-06-12 11:34:53 +02:00
Miro Hrončok d38048d54d Define %python_sitelib, %python_sitearch, %python_version, %python_version_nodots
In rpm 4.15 those are no longer defined.

The meaning of "python" is derived from %__python - and that errors by default
unless user defined.

Example usage:

    %global __python /usr/bin/pypy3

    ...

    %files
    %{python_sitelib}/foo/
2019-06-10 15:40:53 +02:00
Igor Gnatenko 9b8fac037d
Add %python_disable_dependency_generator
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-12-20 14:35:02 +01:00
Pavel Raiskup 90b0bf7480 macros.python: drop last %__python2 occurrence
This is needed so people can do things like:

    %if %{with python3}
    %global __python %__python3
    %else
    %global __python %__python2
    %else

And than just use %__python, %py_build, %py_install,
%python_sitelib, ...
2018-08-03 17:08:55 +02:00
Igor Gnatenko d3d040818d
Change way how enabling-depgen works internally
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-07-28 14:26:10 +02:00
Jan Pokorný 4904408b2f macros.python*: make LDFLAGS propagated whenever CFLAGS are
This is to ensure the right linker flags get propagated into binaries
accompanying python packages whenever distutils (or similar, env.
variables provided build flags aware) module is delegated to build them
(e.g. https://bugzilla.redhat.com/show_bug.cgi?id=1541106).  Instead of
using "%{__global_ldflags}" as the seed for the respective env. variable
one-off application, which would be a direct parallel to "%{optflags}"
seeding CFLAGS, use rather "${RPM_LD_FLAGS}" and "${RPM_OPT_FLAGS}",
as these are not directly bound to macros out of rpm proper (like
it would have been, e.g., on redhat-rpm-config package otherwise).

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
2018-03-23 13:33:48 +01:00
Igor Gnatenko ec476c84cc
add macros to enable dependency generator
References: https://fedoraproject.org/wiki/Changes/EnablingPythonGenerators
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-01-19 15:52:58 +01:00
Michal Cyprian d0fdb0d759 Add --no-deps option to py_install_wheel macros 2017-01-23 18:52:17 +01:00
Orion Poplawski 5ca1f525e5 Make expaned macros start on the same line as the macro 2016-11-24 07:53:47 -07:00
Orion Poplawski e7af332922 Add missing sleeps to other build macros
- Fix build_egg macros
- Add %py_build_wheel and %py_install_wheel macros
2016-11-16 16:28:31 -07:00
Orion Poplawski f798c43354 Add %py_build_egg and %py_install_egg macros 2016-11-15 16:23:27 -07:00
Orion Poplawski 6ce524f21d Allow multiple args to %py_build/install macros 2016-11-15 16:18:39 -07:00
Orion Poplawski 29e6636ccd Tidy up macro formatting 2016-11-15 16:16:16 -07:00
Orion Poplawski 81fee785df Do not generate useless Obsoletes with %{?_isa} 2016-07-12 11:14:21 -06:00
Orion Poplawski 34f5f4c7a4 Fix typo in %python_provide 2016-01-14 20:48:47 -07:00
Orion Poplawski 2553290f93 Better error message from %python_provide 2016-01-14 20:34:31 -07:00
Orion Poplawski f16464f0b6 Handle noarch python sub-packages (bug #1290900) 2016-01-14 16:17:51 -07:00
Orion Poplawski 608a3b9b3b Handle python3_other_pkgversion in python_provide; Drop duplicate py3_other macros from macros.python 2016-01-14 15:35:47 -07:00
Orion Poplawski cbf9c3d9a6 Move py3_other macros to srpm-macros 2016-01-14 15:32:18 -07:00
Orion Poplawski b2fc537309 Do not use %{?_isa} in obsoletes/provides for noarch sub-packages 2016-01-14 15:25:24 -07:00
Orion Poplawski ec28c775cd Initial import 2016-01-12 16:52:28 -07:00