mirror of
https://github.com/gwebu-team/profile.d.git
synced 2025-12-11 12:15:47 +00:00
Compare commits
2 commits
2ad5d376af
...
2f07d57c86
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2f07d57c86 | ||
|
|
6271df868c |
4 changed files with 18 additions and 10 deletions
12
Makefile
12
Makefile
|
|
@ -11,11 +11,12 @@ help:
|
||||||
@echo "▀▀▀▀▀▀"
|
@echo "▀▀▀▀▀▀"
|
||||||
@echo
|
@echo
|
||||||
@echo "Available targets:"
|
@echo "Available targets:"
|
||||||
@echo " dist: create source distribution package in dist/"
|
@echo " dist: Create source distribution package in dist/."
|
||||||
@echo " rpm: create an RPM package"
|
@echo " rpm: Create an RPM package."
|
||||||
@echo " changelog: Add a changelog entry to gwebu-profile.spec.in"
|
@echo " podman_rpm Create an RPM package using podman on MacOS."
|
||||||
|
@echo " changelog: Add a changelog entry to gwebu-profile.spec.in."
|
||||||
@echo
|
@echo
|
||||||
@echo " clean: clean all generated files"
|
@echo " clean: Clean all generated files."
|
||||||
@echo
|
@echo
|
||||||
@echo "Version $(ver), rpm_ver=$(rpm_ver), rpm_rev=$(rpm_rev)."
|
@echo "Version $(ver), rpm_ver=$(rpm_ver), rpm_rev=$(rpm_rev)."
|
||||||
.PHONY: help
|
.PHONY: help
|
||||||
|
|
@ -50,10 +51,9 @@ clean:
|
||||||
|
|
||||||
|
|
||||||
.PHONY: podman_rpm
|
.PHONY: podman_rpm
|
||||||
podman_rpm:
|
podman_rpm: dist
|
||||||
podman buildx build -t podman_rpm_build -f Dockerfile-build . # --platform linux/amd64
|
podman buildx build -t podman_rpm_build -f Dockerfile-build . # --platform linux/amd64
|
||||||
# Extract the RPMs from the container to ./dist/ locally.
|
# Extract the RPMs from the container to ./dist/ locally.
|
||||||
if ! test -d dist; then mkdir dist; fi
|
|
||||||
podman run --rm -d --name=build localhost/podman_rpm_build /usr/bin/bash -c "trap : TERM INT; sleep infinity & wait"
|
podman run --rm -d --name=build localhost/podman_rpm_build /usr/bin/bash -c "trap : TERM INT; sleep infinity & wait"
|
||||||
podman cp build:/tmp/RPMS/. ./dist/
|
podman cp build:/tmp/RPMS/. ./dist/
|
||||||
podman stop build
|
podman stop build
|
||||||
|
|
|
||||||
2
build.sh
2
build.sh
|
|
@ -13,7 +13,7 @@ DIST_PRE="${PLATFORM_ID##*:}" # el8
|
||||||
DIST="${DIST:-${DIST_PRE%%[0-9]*}}" # el
|
DIST="${DIST:-${DIST_PRE%%[0-9]*}}" # el
|
||||||
OUT_DIR="/tmp/RPMS"
|
OUT_DIR="/tmp/RPMS"
|
||||||
|
|
||||||
export LANG='en_US.UTF-8'
|
export LANG='C.UTF-8'
|
||||||
export LANGUAGE="${LANG}"
|
export LANGUAGE="${LANG}"
|
||||||
export LC_ALL="${LANG}"
|
export LC_ALL="${LANG}"
|
||||||
export LC_MEASUREMENT="${LANG}"
|
export LC_MEASUREMENT="${LANG}"
|
||||||
|
|
|
||||||
|
|
@ -81,9 +81,13 @@ function prompt_command() {
|
||||||
local prompt="--($my_D, Err ${my_P[*]}, $my_TTY)---($PWD)--"
|
local prompt="--($my_D, Err ${my_P[*]}, $my_TTY)---($PWD)--"
|
||||||
|
|
||||||
if [ -n "${VIRTUAL_ENV:-}" ] && [ -n "$_OLD_VIRTUAL_PS1" ]; then
|
if [ -n "${VIRTUAL_ENV:-}" ] && [ -n "$_OLD_VIRTUAL_PS1" ]; then
|
||||||
my_VENV="${VIRTUAL_ENV_PROMPT}"
|
if [ -n "$VIRTUAL_ENV_PROMPT" ]; then
|
||||||
|
export my_VENV="$VIRTUAL_ENV_PROMPT"
|
||||||
|
else
|
||||||
|
export my_VENV="${VIRTUAL_ENV##*/}"
|
||||||
|
fi
|
||||||
prompt="--($my_D, Err ${my_P[*]}, $my_TTY, $my_VENV)---($PWD)--"
|
prompt="--($my_D, Err ${my_P[*]}, $my_TTY, $my_VENV)---($PWD)--"
|
||||||
if [ "${PS1:1:${#VIRTUAL_ENV_PROMPT}}" == "$VIRTUAL_ENV_PROMPT" ]; then
|
if [ "${PS1:0:${#my_VENV}+3}" == "($my_VENV) " ]; then
|
||||||
# PS1 will be restored by virtual environment's deactivate script.
|
# PS1 will be restored by virtual environment's deactivate script.
|
||||||
# Yeah, that has to be done better, 172 is correct but magic number.
|
# Yeah, that has to be done better, 172 is correct but magic number.
|
||||||
export PS1="${_OLD_VIRTUAL_PS1:0:172}, ${my_VENV}${_OLD_VIRTUAL_PS1:172}"
|
export PS1="${_OLD_VIRTUAL_PS1:0:172}, ${my_VENV}${_OLD_VIRTUAL_PS1:172}"
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
Summary: Gwebu profile.d - cool date, prompt with history, aliases
|
Summary: Gwebu profile.d - cool date, prompt with history, aliases
|
||||||
Name: gwebu-profile
|
Name: gwebu-profile
|
||||||
Version: 1.0.3
|
Version: 1.0.4
|
||||||
Release: 0
|
Release: 0
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
License: GPLv2
|
License: GPLv2
|
||||||
|
|
@ -41,6 +41,10 @@ install -m 0644 etc/profile.d/*.sh %{buildroot}%{_sysconfdir}/profile.d/
|
||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Jul 15 2024 Doncho Gunchev <doncho.gunchev@flyrlabs.com> - 1.0.4-0
|
||||||
|
- Fix python virtual environment support.
|
||||||
|
This works on MacOS with python 3.9, 3.10, 3.11 and 3.12.
|
||||||
|
|
||||||
* Sun Jul 14 2024 Doncho Gunchev <doncho.gunchev@flyrlabs.com> - 1.0.3-0
|
* Sun Jul 14 2024 Doncho Gunchev <doncho.gunchev@flyrlabs.com> - 1.0.3-0
|
||||||
- Initial python virtual environment support.
|
- Initial python virtual environment support.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue