%define debug_package %{nil} Name: bitwarden_rs-sqlite Version: 1.19.0 Release: 1%{?dist} Summary: Unofficial Bitwarden compatible server written in Rust (SQLite backend) License: GPL-3.0-only URL: https://github.com/dani-garcia/bitwarden_rs Provides: bitwarden_rs = %{version} Conflicts: bitwarden_rs-mysql Conflicts: bitwarden_rs-postgresql Source0: https://github.com/dani-garcia/bitwarden_rs/archive/%{version}.tar.gz Source1: bitwarden_rs.service Patch0: config.patch BuildRequires: pkgconfig(openssl) BuildRequires: pkgconfig(sqlite3) BuildRequires: systemd BuildRequires: /usr/bin/cc Requires: bitwarden_rs-web %description A Bitwarden server API implementation written in Rust compatible with upstream Bitwarden clients. This version uses SQLite as its backend. %prep %setup -qn bitwarden_rs-%{version} %patch0 -p1 curl -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain $(cat rust-toolchain) %build source $HOME/.cargo/env cargo build --features sqlite --release %install install -Dpm 755 target/release/bitwarden_rs %{buildroot}%{_bindir}/bitwarden_rs install -Dpm 644 %{SOURCE1} %{buildroot}%{_unitdir}/bitwarden_rs.service install -Dpm 644 .env.template %{buildroot}%{_sysconfdir}/bitwarden_rs/config.env %files %license LICENSE.txt %{_bindir}/bitwarden_rs %{_unitdir}/bitwarden_rs.service %config(noreplace) %{_sysconfdir}/bitwarden_rs/config.env %pre getent group bitwarden > /dev/null || groupadd -r bitwarden getent passwd bitwarden > /dev/null || useradd -M -r -g bitwarden -c "Bitwarden User" -s /sbin/nologin bitwarden