mirror of
https://abf.rosa.ru/djam/lima.git
synced 2025-02-23 14:52:48 +00:00
1.0.2
This commit is contained in:
parent
9782934327
commit
288ac8aac9
1 changed files with 38 additions and 8 deletions
46
lima.spec
46
lima.spec
|
@ -15,7 +15,8 @@ BuildRequires: upx
|
|||
BuildRequires: pkgconfig(openssl3.3)
|
||||
BuildRequires: gcc
|
||||
BuildRequires: cmake
|
||||
Provides: %{name}ctl
|
||||
BuildRequires: pkgconfig(systemd)
|
||||
Provides: %{name}ctl == %{version}
|
||||
|
||||
%description
|
||||
Lima launches Linux virtual machines with automatic file
|
||||
|
@ -25,18 +26,46 @@ sharing and port forwarding (similar to WSL2).
|
|||
%setup -q
|
||||
|
||||
# fix version
|
||||
sed -i '/^VERSION=/s/=.*/=%{version}/' Makefile
|
||||
#sed -i '/^VERSION/s/=.*/=#{version}/' Makefile
|
||||
|
||||
# fix gcc
|
||||
sed -i '/^CC/d' Makefile
|
||||
|
||||
|
||||
%build
|
||||
export GOPROXY=https://proxy.golang.org/cached-only
|
||||
export CC=cc
|
||||
#make
|
||||
CGO_ENABLED=1 CC=%{__cc} go build -ldflags="-s -w -X github.com/lima-vm/lima/pkg/version.Version=%{version}" -o _output/bin/limactl ./cmd/limactl
|
||||
export CC=%{__cc}
|
||||
|
||||
upx _output/bin/%{name}ctl
|
||||
%make VERSION=%{version} native
|
||||
%make manpages
|
||||
chmod +x _output/share/lima/lima-*
|
||||
|
||||
./_output/bin/limactl completion bash > lima-completion-bash
|
||||
|
||||
upx _output/bin/%{name}ctl _output/share/lima/lima-*
|
||||
|
||||
%install
|
||||
%makeinstall PREFIX=%{_prefix} DEST=%{buildroot}%{_prefix}
|
||||
%makeinstall PREFIX=%{_prefix} DEST=%{buildroot}%{_prefix} native
|
||||
|
||||
install -Dm0644 lima-completion-bash %{buildroot}%{_datadir}/bash-completion/completions/%{name}
|
||||
|
||||
# install unit
|
||||
install -d %{buildroot}%{_unitdir}
|
||||
cat > %{buildroot}%{_unitdir}/lima-guestagent.service << EOF
|
||||
[Unit]
|
||||
Description=lima-guestagent
|
||||
|
||||
[Service]
|
||||
ExecStart=%{_datadir}/lima/lima-guestagent.Linux-x86_64 daemon
|
||||
Type=simple
|
||||
Restart=on-failure
|
||||
OOMPolicy=continue
|
||||
OOMScoreAdjust=-500
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
|
||||
%files
|
||||
%doc README.md LICENSE
|
||||
|
@ -49,4 +78,5 @@ upx _output/bin/%{name}ctl
|
|||
%{_bindir}/podman.lima
|
||||
%{_datadir}/%{name}/*
|
||||
%{_mandir}/man1/*
|
||||
|
||||
%{_datadir}/bash-completion/completions/%{name}
|
||||
%{_unitdir}/lima-guestagent.service
|
||||
|
|
Loading…
Add table
Reference in a new issue