Skip to content

Commit

Permalink
Update rpm to build a rust binary instead of python
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Bottriell <ryan@bottriell.ca>
  • Loading branch information
rydrman committed Apr 9, 2022
1 parent f90a632 commit 700fa2b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 28 deletions.
2 changes: 1 addition & 1 deletion packages/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ import:

%.spk : %.spk.yaml
spk info -l $<@source > /dev/null 2>&1 || spk make-source -v $<
spk mkb -dr origin -lv $<
spk mkb -r origin -lv $<
spk export $< $@

.PRECIOUS: bootstrap/*.spk.yaml
Expand Down
31 changes: 4 additions & 27 deletions spk.spec
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,11 @@ Source0: https://github.com/imageworks/spk/archive/refs/tags/v%{version}.tar.gz

BuildRequires: gcc
BuildRequires: git
BuildRequires: which
BuildRequires: gcc-c++
BuildRequires: chrpath
BuildRequires: libcap-devel
BuildRequires: openssl-devel
BuildRequires: python3-devel
BuildRequires: python3-pip
Requires: rsync
Requires: bash
Requires: spfs >= 0.28.1

Expand All @@ -28,39 +25,19 @@ Package manager for SPFS
%setup -q -n %{name}-%{version}

%build
pip3 install pipenv
export LANG=en_US.UTF-8
mkdir -p ./build
pipenv sync --dev
source $(pipenv --venv)/bin/activate
python setup.py install
python -m nuitka \
--standalone \
--jobs $(nproc) \
--follow-imports \
--output-dir=./build \
--include-package='sentry_sdk.integrations.stdlib' \
--include-package='sentry_sdk.integrations.excepthook' \
--include-package='sentry_sdk.integrations.dedupe' \
--include-package='sentry_sdk.integrations.atexit' \
--include-package='sentry_sdk.integrations.logging' \
--include-package='sentry_sdk.integrations.argv' \
--include-package='sentry_sdk.integrations.modules' \
--include-package='sentry_sdk.integrations.threading' \
spk
cargo build --release

%install
mkdir -p %{buildroot}/usr/local/bin
mkdir -p %{buildroot}/opt/spk.dist
rsync -rvapog --chmod 755 %{_builddir}/%{name}-%{version}/build/spk.dist/* %{buildroot}/opt/spk.dist/
install -m 0755 %{_builddir}/%{name}-%{version}/target/release/spk %{buildroot}/usr/local/bin/spk-%{version}

%files
/opt/spk.dist/
/usr/local/bin/spk-%{version}

%preun
[ -e /usr/local/bin/spk ] && unlink /usr/local/bin/spk

%posttrans
# must run at the absolute end in case we are updating
# and the uninstallation of the old version removes the symlink
ln -sf /opt/spk.dist/spk /usr/local/bin/spk
ln -sf spk-%{version} /usr/local/bin/spk

0 comments on commit 700fa2b

Please sign in to comment.