%global _build_id_links none %global debug_package %{nil} %undefine source_date_epoch_from_changelog %global upstream_version 0.8.0 %global software_name govault Name: %{software_name} Version: %{upstream_version} Release: 1%{?dist} Summary: Native desktop client for Vaultwarden and Bitwarden servers License: MIT URL: https://github.com/txchen/govault Source0: %{software_name}_%{upstream_version}.orig.tar.gz Source1: %{software_name}_%{upstream_version}.orig-vendor.tar.gz Source2: %{software_name}_%{upstream_version}.orig-desktop.tar.gz BuildRequires: tar, golang %if 0%{?suse_version} # openSUSE's filelist check validates directory ownership in the build root, # so the runtime Requires below is not sufficient by itself. BuildRequires: hicolor-icon-theme %endif # NSGo loads GTK 4, Pango and Cairo at runtime through purego; the Go build # itself needs no C compiler or graphics development headers. %if 0%{?suse_version} # openSUSE names the GTK 4 shared library package differently from Fedora. Requires: libgtk-4-1 Requires: hicolor-icon-theme %else Requires: gtk4 %endif Requires: pango Requires: cairo Requires: fontconfig %description GoVault is a small native desktop client for Vaultwarden and Bitwarden-compatible servers. It includes the govault desktop application and gv, a command-line client compatible with the Bitwarden CLI. %prep %autosetup -p1 -n %{software_name}-%{upstream_version} mkdir -p vendor tar -xf %{SOURCE1} -C vendor if [ ! -f vendor/modules.txt ]; then echo "ERROR: vendor/modules.txt not found in Source1." >&2 exit 1 fi %build export GOTOOLCHAIN=local export GOPROXY=off export GOSUMDB=off export GOMODCACHE="$PWD/.gomodcache" export CGO_ENABLED=0 go build -mod=vendor -trimpath -buildvcs=false \ -ldflags "-s -w" -o govault ./cmd/govault go build -mod=vendor -trimpath -buildvcs=false \ -ldflags "-s -w -X main.version=%{upstream_version}" -o gv ./cmd/gv %install install -Dm755 govault %{buildroot}%{_bindir}/govault install -Dm755 gv %{buildroot}%{_bindir}/gv tar -xzf %{SOURCE2} install -Dm644 dev.txchen.govault.desktop \ %{buildroot}%{_datadir}/applications/dev.txchen.govault.desktop install -Dm644 cmd/govault/assets/Icon.png \ %{buildroot}%{_datadir}/icons/hicolor/512x512/apps/dev.txchen.govault.png install -Dm644 cmd/govault/linux/share/metainfo/dev.txchen.govault.metainfo.xml \ %{buildroot}%{_datadir}/metainfo/dev.txchen.govault.metainfo.xml %check %files %license LICENSE %doc README.md %{_bindir}/govault %{_bindir}/gv %{_datadir}/applications/dev.txchen.govault.desktop %{_datadir}/icons/hicolor/512x512/apps/dev.txchen.govault.png %{_datadir}/metainfo/dev.txchen.govault.metainfo.xml %changelog