pyenv/pyenv.spec
Tomáš Chvátal 3e3784836c Accepting request 740988 from home:cbcoutinho:branches:devel:languages:python
- Update to 1.2.13
  * python-build: Add CPython 3.7.4
  * python-build: Add CPython 3.6.9
- Update to 1.2.12
  * python-build: Find zlib from Xcode or brew on Mojave (#1353)
  * python-build: Add PyPy 7.1.1 (#1335)
  * python-build: Add CPython 3.8.0b1
- Update to 1.2.11
  * python-build: Fix posix_close name collision in 2.4 builds (#1321)
  * python-build: Add CPython 3.4.10 (#1322)
  * python-build: Add Anaconda 2019.03
  * python-build: Allow overriding the preference of OpenSSL version per definition basis (#1302, #1325, #1326)
  * python-build: Imported changes from rbenv/ruby-build 20190401 (#1327)
  * python-build: Use GNU Readline 8.0 on macOS if brew's package isn't available (#1329)
- Update to 1.2.10
  * python-build: Force y, Y, yes or YES to confirm installation (#1217)
  * python-build: Add PyPy 7.0.0, 7.1.0
  * python-build: Add CPython 2.7.16, 3.5.7 and 3.7.3
  * python-build: Install python-gdb.py (#1190, #1289)
  * python-build: Add micropython 1.10
  * python-build: Prefer Homebrew's OpenSSL 1.1 over 1.0 (#839, #1302)

OBS-URL: https://build.opensuse.org/request/show/740988
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/pyenv?expand=0&rev=11
2019-10-18 10:15:27 +00:00

175 lines
4.8 KiB
RPMSpec

#
# spec file for package pyenv
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define pyenv_dir %{_libexecdir}/pyenv
#
Name: pyenv
Version: 1.2.13
Release: 0
Summary: Python Version Management
License: MIT
Group: Development/Languages/Python
URL: https://github.com/yyuu/pyenv
Source0: https://github.com/pyenv/pyenv/archive/v%{version}.tar.gz
Source1: %{name}-rpmlintrc
Source2: %{name}.rst
BuildRequires: bash-completion
BuildRequires: fdupes
BuildRequires: fish
BuildRequires: gcc
BuildRequires: make
BuildRequires: python3-Sphinx
BuildRequires: zsh
%description
pyenv lets the user switch between multiple versions of Python.
This project was forked from rbenv and ruby-build, and modified for Python.
%package bash-completion
Summary: Bash completion for %{name}
Group: System/Shells
Requires: %{name} = %{version}
Supplements: packageand(pyenv:bash-completion)
BuildArch: noarch
%description bash-completion
Bash command line completion support for %{name}.
%package fish-completion
Summary: Fish completion for %{name}
Group: System/Shells
Requires: %{name} = %{version}
Supplements: packageand(pyenv:fish)
BuildArch: noarch
%description fish-completion
Fish command line completion support for %{name}.
%package zsh-completion
Summary: Zsh completion for %{name}
Group: System/Shells
Requires: %{name} = %{version}
Supplements: packageand(pyenv:zsh)
BuildArch: noarch
%description zsh-completion
Zsh command line completion support for %{name}.
%prep
%setup -q
install -D %{SOURCE2} docs/%{name}.rst
sed -i -e '1s,^#!%{_bindir}/env bash,#!/bin/bash,' libexec/* pyenv.d/exec/pip-rehash/* plugins/python-build/bin/*
%build
##
pushd src
%configure
make %{?_smp_mflags}
popd
##
cat << EOF > docs/conf.py
# The master toctree document.
master_doc = '%{name}'
project = '%{name}'
copyright = '2017, Yuu Yamashita'
author = 'Yuu Yamashita'
# The short X.Y version.
version = '%{version}'
# The full version, including alpha/beta/rc tags.
release = version
# Usually you set "language" from the command line for these cases.
language = 'en'
man_pages = [
(master_doc, 'pyenv', 'Simple Python Version Management',
[author], 1)
]
man_show_urls=True
EOF
sphinx-build -b man -v docs man/
%install
mkdir -p %{buildroot}%{pyenv_dir} \
%{buildroot}%{pyenv_dir}/plugins \
%{buildroot}%{pyenv_dir}/shims/ \
%{buildroot}%{pyenv_dir}/share/python-build/ \
%{buildroot}%{_sysconfdir}/pyenv.d/ \
%{buildroot}%{_bindir}
cp -R libexec %{buildroot}%{pyenv_dir}
cp -R bin %{buildroot}%{pyenv_dir}
cp -a pyenv.d %{buildroot}%{_sysconfdir}/
## Install shell completions:
install -D -m0644 completions/pyenv.bash %{buildroot}%{_datadir}/bash-completion/completions/pyenv
install -D -m0644 completions/pyenv.fish %{buildroot}%{_datadir}/fish/completions/pyenv.fish
install -D -m0644 completions/pyenv.zsh %{buildroot}%{_sysconfdir}/zsh_completion.d/pyenv
## Install manpage
install -D -m0644 man/%{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1
pushd %{buildroot}%{_mandir}/man1/
ln -s %{name}.1 python-build.1
popd
ln -s %{pyenv_dir}/bin/pyenv %{buildroot}%{_bindir}/pyenv
## python-build
pushd plugins/python-build
install -m755 bin/* %{buildroot}%{pyenv_dir}/libexec
cp -a share/python-build %{buildroot}%{pyenv_dir}/share/
popd
%fdupes %{buildroot}%{pyenv_dir}
%files
%doc CHANGELOG.md COMMANDS.md README.md
%license LICENSE
%exclude %{_sysconfdir}/pyenv.d/rehash/*/.gitignore
%config %{_sysconfdir}/pyenv.d/rehash/*.d/default.list
%config %{_sysconfdir}/pyenv.d/exec/pip-rehash.bash
%config %{_sysconfdir}/pyenv.d/rehash/*.bash
%{pyenv_dir}
%dir %{_sysconfdir}/pyenv.d
%dir %{_sysconfdir}/pyenv.d/exec/
%dir %{_sysconfdir}/pyenv.d/rehash/
%dir %{_sysconfdir}/pyenv.d/rehash/*.d/
%{_sysconfdir}/pyenv.d/exec/pip-rehash
%{_bindir}/pyenv
#
%{_mandir}/man1/%{name}.1%{?ext_man}
%{_mandir}/man1/python-build.1%{?ext_man}
%files bash-completion
%{_datadir}/bash-completion/completions/pyenv
%files fish-completion
%{_datadir}/fish/completions/pyenv.fish
%files zsh-completion
%config %{_sysconfdir}/zsh_completion.d/pyenv
%changelog