File osslsigncode.spec of Package osslsigncode

# ==================
# Top-level metadata
# ==================

Name: osslsigncode
Summary: Code signing tool
URL: https://github.com/mtrojnar/osslsigncode
License: GPLv3

Version: 2.5
Release: 1%{?dist}

# =======================
# Build-time requirements
# =======================

BuildRequires: gcc-c++
BuildRequires: make
BuildRequires: glibc-devel
BuildRequires: libcurl-devel
BuildRequires: openssl-devel
BuildRequires: cmake

# =======================
# Source code and patches
# =======================

%undefine _disable_source_fetch
Source0: https://github.com/mtrojnar/osslsigncode/archive/refs/tags/%{version}.tar.gz

%global archive_file    %{version}.tar.gz
%global archive_dir     osslsigncode-%{version}

# ==========================================
# Descriptions, and metadata for subpackages
# ==========================================

Requires: glibc
Requires: openssl
Requires: curl

%description
osslsigncode is a small tool that implements part of the functionality of the
Microsoft tool signtool.exe - more exactly the Authenticode signing and
timestamping.

# ======================================================
# The prep phase of the build:
# ======================================================

%prep
cd %{_topdir}/BUILD
rm -rf %{archive_dir}
tar zxvf %{_topdir}/SOURCES/%{archive_file}
cd %{archive_dir}

# ======================================================
# Configuring and building the code:
# ======================================================

%build
cd %{archive_dir}
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr ..
%make_build

# ======================================================
# Installing the built code:
# ======================================================

%install
rm -rf $RPM_BUILD_ROOT
cd %{archive_dir}/build
DESTDIR=%{buildroot} cmake --install .


%files
/usr/bin/osslsigncode
/usr/share/bash-completion/completions/osslsigncode.bash

%changelog
* Fri Aug 14 2020 tim.vandermeersch@vortex-financials.be
- Initial version
openSUSE Build Service is sponsored by