File tc-play.spec of Package tc-play

#
# spec file for package tc-play
#
# Copyright (c) 2024 Asterios Dramis <asterios.dramis@gmail.com>.
#
# 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.


%define so_ver 2_0
Name:           tc-play
Version:        2.0
Release:        0
Summary:        Free and Simple TrueCrypt Implementation Based on dm-crypt
License:        BSD-2-Clause
Group:          Productivity/Security
URL:            https://github.com/bwalex/tc-play/
Source0:        https://github.com/bwalex/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
# PATCH-FIX-UPSTREAM sysmacros.patch asterios.dramis@gmail.com -- Fix build with newer glibc
Patch0:         sysmacros.patch
BuildRequires:  cmake
BuildRequires:  device-mapper-devel
BuildRequires:  gcc-c++
BuildRequires:  libgcrypt-devel
BuildRequires:  libuuid-devel
BuildRequires:  pkgconfig

%description
tcplay is a free, pretty much fully featured (including multiple keyfiles,
cipher cascades, etc) and stable TrueCrypt implementation.

%package devel
Summary:        Development files for tc-play
Group:          Development/Libraries/C and C++
Requires:       libtcplay%{so_ver} = %{version}

%description devel
This package includes development files for tc-play.

%package -n libtcplay%{so_ver}
Summary:        Free and Simple TrueCrypt Implementation Based on dm-crypt
Group:          System/Libraries

%description -n libtcplay%{so_ver}
tcplay is a free, pretty much fully featured (including multiple keyfiles,
cipher cascades, etc) and stable TrueCrypt implementation.

%prep
%autosetup -p1

# Let package honor RPM_OPT_FLAGS
sed -i -e "s,-O3,," -e "s,-fPIE,," CMakeLists.txt

%build
%cmake
%make_jobs

%install
%cmake_install

# Remove static libraries
rm -f %{buildroot}%{_libdir}/libtcplay.a

%post -n libtcplay%{so_ver} -p /sbin/ldconfig
%postun -n libtcplay%{so_ver} -p /sbin/ldconfig

%files
%license LICENSE
%doc CHANGELOG README.md
%{_sbindir}/tcplay
%{_mandir}/man8/tcplay.8%{?ext_man}

%files devel
%{_includedir}/tcplay_api.h
%{_libdir}/*.so
%{_libdir}/pkgconfig/tcplay.pc
%{_mandir}/man3/tcplay.3%{?ext_man}

%files -n libtcplay%{so_ver}
%{_libdir}/libtcplay.so.2.0*

%changelog
openSUSE Build Service is sponsored by