initial commit
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
name: Build and Publish RPM
|
||||
name: Build and Publish RPM
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build-and-publish:
|
||||
runs-on: "ubuntu-latest-intranet"
|
||||
container:
|
||||
image: gitea.psi.ch/images/rhel9-developer-gitea-actions
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build RPM
|
||||
run: |
|
||||
rpmbuild -ba hdfview.spec
|
||||
|
||||
- name: Publish RPM package
|
||||
run: |
|
||||
echo curl -X PUT \
|
||||
--user "ebner:${{ secrets.PACKAGE_DEPLOY_TOKEN }}" \
|
||||
--upload-file RPMS/x86_64/*.rpm \
|
||||
"${{ github.server_url }}/api/packages/${{ github.repository_owner }}/rpm/upload"
|
||||
curl -X PUT \
|
||||
--user "ebner:${{ secrets.PACKAGE_DEPLOY_TOKEN }}" \
|
||||
--upload-file RPMS/x86_64/*.rpm \
|
||||
"${{ github.server_url }}/api/packages/${{ github.repository_owner }}/rpm/upload"
|
||||
@@ -0,0 +1,4 @@
|
||||
BUILD
|
||||
BUILDROOT
|
||||
RPMS
|
||||
SRPMS
|
||||
@@ -0,0 +1,89 @@
|
||||
# Overview
|
||||
|
||||
https://github.com/pyenv/pyenv
|
||||
|
||||
Ideas for RPM packaging:
|
||||
https://github.com/niligulmohar/pyenv-rpm
|
||||
|
||||
# Development
|
||||
|
||||
```
|
||||
docker run --platform linux/amd64 -it --rm -v $(pwd):/data --workdir /data gitea.psi.ch/images/rhel9-developer
|
||||
|
||||
rpmbuild -ba pyenv.spec
|
||||
```
|
||||
|
||||
|
||||
# Installation
|
||||
https://github.com/pyenv/pyenv
|
||||
|
||||
Installing pyenv dependencies (https://github.com/pyenv/pyenv/wiki#how-to-build-cpython-with-framework-support-on-os-x):
|
||||
|
||||
```bash
|
||||
dnf install gcc make patch zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel tk-devel libffi-devel xz-devel
|
||||
```
|
||||
|
||||
Install/clone pyenv:
|
||||
```bash
|
||||
|
||||
[root@lxdev04 ~]# mkdir /opt/pyenv
|
||||
|
||||
[root@lxdev04 ~]# git clone https://github.com/pyenv/pyenv.git /opt/pyenv
|
||||
Cloning into '/opt/pyenv'...
|
||||
remote: Enumerating objects: 24035, done.
|
||||
remote: Counting objects: 100% (100/100), done.
|
||||
remote: Compressing objects: 100% (44/44), done.
|
||||
remote: Total 24035 (delta 42), reused 89 (delta 38), pack-reused 23935
|
||||
Receiving objects: 100% (24035/24035), 4.91 MiB | 23.30 MiB/s, done.
|
||||
Resolving deltas: 100% (16199/16199), done.
|
||||
|
||||
[root@lxdev04 ~]# ln -s /opt/pyenv/bin/pyenv /usr/bin/pyenv
|
||||
```
|
||||
|
||||
Create profile script:
|
||||
```bash
|
||||
[root@lxdev04 bin]# cat /etc/profile.d/pyenv.sh
|
||||
if [[ ${UID} -ge 1000 && ! ${USER} =~ -adm$ ]]; then
|
||||
export PYENV_ROOT="$HOME/.pyenv"
|
||||
# export PYENV_ROOT="/tmp/$USER/.pyenv"
|
||||
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
|
||||
eval "$(pyenv init -)"
|
||||
fi
|
||||
```
|
||||
|
||||
Installation virtualenv plugin (https://github.com/pyenv/pyenv-virtualenv):
|
||||
```bash
|
||||
git clone https://github.com/pyenv/pyenv-virtualenv.git /opt/pyenv/plugins/pyenv-virtualenv
|
||||
```
|
||||
|
||||
Use pyenv:
|
||||
```bash
|
||||
# show installed versions
|
||||
pyenv versions
|
||||
# show current python version
|
||||
pyenv version
|
||||
# show possible python versions to install
|
||||
pyenv install --list
|
||||
# install a python version
|
||||
pyenv install <versions>
|
||||
|
||||
# activate python version for current shell:
|
||||
pyenv shell <version>
|
||||
|
||||
# uninstall python version
|
||||
pyenv uninstall <version>
|
||||
|
||||
# create a python environment
|
||||
pyenv virtualenv <version> <name>
|
||||
|
||||
# activate virtual environment in current shell
|
||||
pyenv shell <name>
|
||||
|
||||
# remove virtualenv
|
||||
pyenv virtualenv-delete <name>
|
||||
```
|
||||
|
||||
|
||||
*INFO: Somehow `pyenv local` does not work (i.e. switching python version based on directory!)*
|
||||
|
||||
Tutorial: https://realpython.com/intro-to-pyenv
|
||||
@@ -0,0 +1,6 @@
|
||||
if [[ ${UID} -ge 1000 && ! ${USER} =~ -adm$ ]]; then
|
||||
export PYENV_ROOT="$HOME/.pyenv"
|
||||
# export PYENV_ROOT="/tmp/$USER/.pyenv"
|
||||
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
|
||||
eval "$(pyenv init -)"
|
||||
fi
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
Summary: pyenv
|
||||
Name: pyenv
|
||||
Version: 2.6.3
|
||||
Release: 1%{?dist}
|
||||
License: MIT
|
||||
Group: Applications/System
|
||||
BuildArch: noarch
|
||||
Vendor: PSI
|
||||
URL: https://github.com/pyenv/pyenv
|
||||
|
||||
Requires: gcc, make, patch, zlib-devel, bzip2, bzip2-devel, readline-devel, sqlite, sqlite-devel, openssl-devel, tk-devel, libffi-devel, xz-devel
|
||||
|
||||
%description
|
||||
Provides pyenv
|
||||
|
||||
# do not mangle shebangs
|
||||
%global __brp_mangle_shebangs %{nil}
|
||||
|
||||
%install
|
||||
mkdir -p %{buildroot}/opt/pyenv
|
||||
mkdir -p %{buildroot}/etc/profile.d/
|
||||
git clone --depth 1 --branch v2.6.3 https://github.com/pyenv/pyenv %{buildroot}/opt/pyenv
|
||||
git clone --depth 1 --branch v1.2.4 https://github.com/pyenv/pyenv-virtualenv.git %{buildroot}/opt/pyenv/plugins/pyenv-virtualenv
|
||||
rm -rf %{buildroot}/opt/pyenv/.git
|
||||
rm -rf %{buildroot}/opt/pyenv/.github
|
||||
rm -rf %{buildroot}/opt/pyenv/test
|
||||
rm -rf %{buildroot}/opt/pyenv/src
|
||||
rm -rf %{buildroot}/opt/pyenv/plugins/pyenv-virtualenv/.git
|
||||
cp %{_topdir}/pyenv.sh %{buildroot}/etc/profile.d/pyenv.sh
|
||||
mkdir -p %{buildroot}/usr/bin
|
||||
ln -s /opt/pyenv/bin/pyenv %{buildroot}/usr/bin/pyenv
|
||||
|
||||
%files
|
||||
# %defattr(-,root,root,0755)
|
||||
/opt/pyenv
|
||||
/etc/profile.d/pyenv.sh
|
||||
/usr/bin/pyenv
|
||||
|
||||
Reference in New Issue
Block a user