Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
fix amazonlinux 2 dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryce Larson committed May 26, 2021
1 parent b53c692 commit c2c71c8
Show file tree
Hide file tree
Showing 11 changed files with 262 additions and 86 deletions.
37 changes: 37 additions & 0 deletions file_roots/pkg/python-contextvars/2_4/amzn2/init.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{% import "setup/amazon/map.jinja" as buildcfg %}
{% import "setup/macros.jinja" as macros with context %}
{% set pkg_data = salt["pillar.get"]("pkgbuild_registry:" ~ buildcfg.build_release, {}) %}
{% set force = salt["pillar.get"]("pkgbuild_force.all", False) or salt["pillar.get"]("pkgbuild_force." ~ slspath, False) %}
{% set sls_name = "python-contextvars" %}
{% set pypi_name = "contextvars" %}
{% set pkg_info = pkg_data.get(sls_name, {}) %}
{% if "version" in pkg_info %}
{% set pkg_name = pkg_info.get("name", sls_name) %}
{% set version, release = pkg_info["version"].split("-", 1) %}
{% if pkg_info.get("noarch", False) %}
{% set arch = "noarch" %}
{% else %}
{% set arch = buildcfg.build_arch %}
{% endif %}
{{ macros.includes(sls_name, pkg_data) }}
{{sls_name}}-{{version}}:
pkgbuild.built:
- runas: {{buildcfg.build_runas}}
- force: {{force}}
{{ macros.results(sls_name, pkg_data) }}
- dest_dir: {{buildcfg.build_dest_dir}}
- spec: salt://{{slspath}}/spec/{{pkg_name}}.spec
- template: jinja
- tgt: {{buildcfg.build_tgt}}
{{ macros.build_deps(sls_name, pkg_data) }}
{{ macros.requires(sls_name, pkg_data) }}
- sources:
- {{ macros.pypi_source(pypi_name, version) }}
{% endif %}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
%{!?python3_pkgversion:%global python3_pkgversion 3}

Name: python-contextvars
Version: 2.4
Release: 1%{?dist}
Summary: python-contextvars
License: ASL 2.0
URL: https://github.com/MagicStack/contextvars
Source0: https://pypi.org/packages/source/c/contextvars/contextvars-%{version}.tar.gz

BuildArch: noarch
BuildRequires: python%{python3_pkgversion}-setuptools
#BuildRequires: epel-rpm-macros
BuildRequires: python3-rpm-macros
#BuildRequires: python3-rpm-generators

%description
Python Contextvars Backport

%package -n python%{python3_pkgversion}-contextvars
Summary: python-contextvars
Requires: python%{python3_pkgversion}
Requires: python%{python3_pkgversion}-immutables
%{?python_provide:%python_provide python%{python3_pkgversion}-contextvars}

%description -n python%{python3_pkgversion}-contextvars


%prep
%autosetup -n contextvars-2.4

%build
#%%py3_build
CFLAGS="%{optflags}" %{__python3} setup.py %{?py_setup_args} build --executable="%{__python3} %{py3_shbang_opts}" %{?*}
sleep 1


%install
#%%py3_install
CFLAGS="%{optflags}" %{__python3} setup.py %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*}


%files -n python%{python3_pkgversion}-contextvars
%license LICENSE
%doc README.rst
%{python3_sitelib}/contextvars-*.egg-info/
%{python3_sitelib}/contextvars/
37 changes: 37 additions & 0 deletions file_roots/pkg/python-immutables/0_14/amzn2/init.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{% import "setup/amazon/map.jinja" as buildcfg %}
{% import "setup/macros.jinja" as macros with context %}
{% set pkg_data = salt["pillar.get"]("pkgbuild_registry:" ~ buildcfg.build_release, {}) %}
{% set force = salt["pillar.get"]("pkgbuild_force.all", False) or salt["pillar.get"]("pkgbuild_force." ~ slspath, False) %}
{% set sls_name = "python-immutables" %}
{% set pypi_name = "immutables" %}
{% set pkg_info = pkg_data.get(sls_name, {}) %}
{% if "version" in pkg_info %}
{% set pkg_name = pkg_info.get("name", sls_name) %}
{% set version, release = pkg_info["version"].split("-", 1) %}
{% if pkg_info.get("noarch", False) %}
{% set arch = "noarch" %}
{% else %}
{% set arch = buildcfg.build_arch %}
{% endif %}
{{ macros.includes(sls_name, pkg_data) }}
{{sls_name}}-{{version}}:
pkgbuild.built:
- runas: {{buildcfg.build_runas}}
- force: {{force}}
{{ macros.results(sls_name, pkg_data) }}
- dest_dir: {{buildcfg.build_dest_dir}}
- spec: salt://{{slspath}}/spec/{{pkg_name}}.spec
- template: jinja
- tgt: {{buildcfg.build_tgt}}
{{ macros.build_deps(sls_name, pkg_data) }}
{{ macros.requires(sls_name, pkg_data) }}
- sources:
- {{ macros.pypi_source(pypi_name, version) }}
{% endif %}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
%{!?python3_pkgversion:%global python3_pkgversion 3}

Name: python-immutables
Version: 0.14
Release: 1%{?dist}
Summary: python-immutables
License: ASL 2.0
URL: https://github.com/MagicStack/immutables
Source0: https://pypi.org/packages/source/i/immutables/immutables-%{version}.tar.gz

BuildRequires: gcc
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-setuptools
#BuildRequires: epel-rpm-macros
BuildRequires: python3-rpm-macros
#BuildRequires: python3-rpm-generators

%description
Python Immutables Backport

%package -n python%{python3_pkgversion}-immutables
Summary: python-immutables
Requires: python%{python3_pkgversion}
%{?python_provide:%python_provide python%{python3_pkgversion}-immutables}

%description -n python%{python3_pkgversion}-immutables


%prep
%autosetup -n immutables-0.14

%build
CFLAGS="%{optflags}" %{__python3} setup.py %{?py_setup_args} build --executable="%{__python3} %{py3_shbang_opts}" %{?*}

%install
CFLAGS="%{optflags}" %{__python3} setup.py %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*}


%files -n python%{python3_pkgversion}-immutables
%license LICENSE
%doc README.rst
%{python3_sitearch}/immutables-*.egg-info/
%{python3_sitearch}/immutables/
5 changes: 3 additions & 2 deletions file_roots/pkg/salt/master/amzn2/spec/salt.spec
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ Requires: python%{python3_pkgversion}-requests
Requires: python%{python3_pkgversion}-zmq >= 17.0.0
Requires: python%{python3_pkgversion}-markupsafe
Requires: python%{python3_pkgversion}-rpm
# Only needed for python < 3.7 (including salt-ssh targets)
Requires: python%{python3_pkgversion}-contextvars

## Tornado removed in Neon
## Requires: python%%{python3_pkgversion}-tornado >= 4.2.1, python%%{python3_pkgversion}-tornado < 5.0
Expand All @@ -108,8 +110,7 @@ Requires: python%{python3_pkgversion}-rpm
Requires: python%{python3_pkgversion}-pycurl

Requires: python%{python3_pkgversion}-six
# not using python3_pkgversion to avoid epel conflicts
Requires: python37-psutil
Requires: python%{python3_pkgversion}-psutil
%if 0%{?with_amzn2}
Requires: python%{python3_pkgversion}-pyyaml
Requires: python%{python3_pkgversion}-distro
Expand Down
2 changes: 1 addition & 1 deletion file_roots/pkg/salt/master/rhel7/spec/salt.spec
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Requires: python%{python3_pkgversion}-requests
Requires: python%{python3_pkgversion}-zmq >= 17.0.0
Requires: python%{python3_pkgversion}-markupsafe
Requires: python%{python3_pkgversion}-rpm
# Only needed for python < 3.7
# Only needed for python < 3.7 (including salt-ssh targets)
Requires: python%{python3_pkgversion}-contextvars

## Tornado removed in Neon, hence need its BuildRequires
Expand Down
2 changes: 1 addition & 1 deletion file_roots/pkg/salt/master/rhel8/spec/salt.spec
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Requires: python%{python3_pkgversion}-requests
Requires: python%{python3_pkgversion}-zmq >= 17.0.0
Requires: python%{python3_pkgversion}-markupsafe
Requires: python%{python3_pkgversion}-rpm
# Only needed for python < 3.7
# Only needed for python < 3.7 (including salt-ssh targets)
Requires: python%{python3_pkgversion}-contextvars

## Tornado removed in Neon
Expand Down
24 changes: 13 additions & 11 deletions file_roots/versions/master/amazon_pkg.sls
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ include:
- pkg.python-atomicwrites.1_1_5.amzn2
- pkg.python-babel.2_6_0.amzn2
- pkg.python-backports_abc.0_5.amzn2
- pkg.python-bottle.0_12_13.amzn2
- pkg.python-chardet.3_0_4.amzn2
# - pkg.python-bottle.0_12_13.amzn2
# - pkg.python-chardet.3_0_4.amzn2
- pkg.python-cherrypy.5_6_0.amzn2
- pkg.python-contextvars.2_4.amzn2
- pkg.python-coverage.4_5_1.amzn2
- pkg.python-crypto.2_6_1.amzn2
- pkg.python-dateutil.2_7_3.amzn2
Expand All @@ -28,42 +29,43 @@ include:
- pkg.python-funcsigs.1_0_2.amzn2
- pkg.python-gnupg.0_4_4.amzn2
- pkg.python-hypothesis.3_66_11.amzn2
- pkg.python-idna.2_7.amzn2
# - pkg.python-idna.2_7.amzn2
- pkg.python-immutables.0_14.amzn2
- pkg.python-jinja2.2_10.amzn2
- pkg.python-libcloud.2_2_1.amzn2
- pkg.python-m2crypto.0_31_0.amzn2
- pkg.python-markupsafe.1_0.amzn2
- pkg.python-mock.2_0_0.amzn2 ## should not be needed since Py3.3 as part of Standard Library, list as dependencies in some packages
# - pkg.python-mock.2_0_0.amzn2 ## should not be needed since Py3.3 as part of Standard Library, list as dependencies in some packages
- pkg.python-msgpack.0_5_6.amzn2
- pkg.python-more-itertools.4_1_0.amzn2
- pkg.python-nose.1_3_7.amzn2
- pkg.python-pbr.5_1_2.amzn2
# - pkg.python-nose.1_3_7.amzn2
# - pkg.python-pbr.5_1_2.amzn2
- pkg.python-pluggy.0_7_1.amzn2
- pkg.python-psutil.5_4_3.amzn2
# - pkg.python-psutil.5_4_3.amzn2
- pkg.python-py.1_5_4.amzn2
- pkg.python-pycryptodome.3_6_1.amzn2
- pkg.python-pycurl.7_43_0_2.amzn2
- pkg.python-pyflakes.2_0_0.amzn2
- pkg.python-pyroute2.0_5_3.amzn2
- pkg.python-pysocks.1_6_8.amzn2
# - pkg.python-pysocks.1_6_8.amzn2
- pkg.python-pytest.3_6_4.amzn2
- pkg.python-pytest-runner.4_0.amzn2
- pkg.python-pytz.2018_5.amzn2
- pkg.python-pyzmq.17_0_0.amzn2
- pkg.python-requests.2_19_1.amzn2
# - pkg.python-requests.2_19_1.amzn2
## - pkg.python-rpm.4_11_3.amzn2
- pkg.python-setuptools_scm.3_1_0.amzn2
- pkg.python-simplejson.3_16_0.amzn2
- pkg.python-singledispatch.3_4_0_3.amzn2
- pkg.python-six.1_11_0.amzn2
# - pkg.python-six.1_11_0.amzn2
- pkg.python-sure.1_4_11.amzn2
## - pkg.python-tornado.4_5_2.amzn2 ## build and use this till salt updated
## - pkg.python-tornado4.4_5_2.amzn2 ## build and use this till salt updated
## - pkg.python-tornado.5_0_2.amzn2 ## latest 5.1.1
- pkg.python-timelib.0_2_4.amzn2
- pkg.python-typing.3_5_2_2.amzn2
- pkg.python-unittest2.1_1_0.amzn2
- pkg.python-urllib3.1_23.amzn2
# - pkg.python-urllib3.1_23.amzn2
- pkg.python-yaml.4_2.amzn2
- pkg.python-zope-event.4_2_0.amzn2
- pkg.python-zope-interface.4_5_0.amzn2
Expand Down
Loading

0 comments on commit c2c71c8

Please sign in to comment.