File spectre-cli.spec of Package spectre-cli

# spec file for package spectre-cli
#
# Copyright (c) 2023 Malcolm J Lewis <malcolmlewis@opensuse.org>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
## Weird git versioning, use cmake -LH in source to identify correct cli version
%define MP_VERSION 2.6-cli-5-116-g26c01a5

Name:           spectre-cli
Version:        3.0+git20230114.26c01a5
Release:        0
License:        GPL-3.0
Summary:        Command-line interface brings the Spectre algorithm to POSIX platforms
URL:            https://gitlab.com/spectre.app
Source0:        %{name}-%{version}.tar.xz
#PATCH-FIX-UPSTREAM spectre-cli-version.patch gl#spectre.app/cli#32 malcolmlewis@opensuse.org -- Fix version definition
Patch0:         spectre-cli-version.patch
BuildRequires:  cmake
BuildRequires:  git
BuildRequires:  pkgconfig(json-c)
BuildRequires:  pkgconfig(libsodium)
BuildRequires:  pkgconfig(ncurses)
BuildRequires:  pkgconfig(xmlb)

%description
Spectre introduces a completely new way of thinking about passwords.

The command-line interface brings the Spectre algorithm to POSIX platforms.

%prep
%autosetup -p1
## Move build script as conflicts with our macro
mv build build_tool
## Weird git versioning, use cmake -LH in source to identify correct cli version
## but still need to patch as well.
echo %{MP_VERSION} > VERSION

%build
## json-c calls a static library, openSUSE only builds shared libraries, so skip
%cmake -DCMAKE_BUILD_TYPE=Release \
       -DUSE_JSON=OFF \
       -DMP_VERSION=%{MP_VERSION}
make %{?_smp_mflags}

%install
%cmake_install

%files
%license LICENSE
%{_bindir}/spectre

%changelog
openSUSE Build Service is sponsored by