File tc-play.spec of Package tc-play

#
# spec file for package tc-play
#
# Copyright (c) 2014 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/
# https://github.com/bwalex/tc-play/archive/v2.0.tar.gz
Source0:        %{name}-%{version}.tar.gz
BuildRequires:  cmake
BuildRequires:	device-mapper-devel
BuildRequires:  gcc-c++
BuildRequires:  libgcrypt-devel
BuildRequires:  libuuid-devel
BuildRequires:  pkg-config
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%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
%setup -q

%build
export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags}"
rm -rf build
mkdir build
cd build
cmake \
    -DCMAKE_INSTALL_PREFIX=%{_prefix} \
    ..
make %{?_smp_mflags} VERBOSE=1
cd ..

%install
%make_install -C build

# 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
%defattr(-,root,root,-)
%doc CHANGELOG LICENSE README.md
%{_sbindir}/tcplay
%doc %{_mandir}/man8/tcplay.8%{ext_man}

%files devel
%defattr(-,root,root,-)
%{_includedir}/tcplay_api.h
%{_libdir}/*.so
%{_libdir}/pkgconfig/tcplay.pc
%doc %{_mandir}/man3/tcplay.3%{ext_man}

%files -n libtcplay%{so_ver}
%defattr(-,root,root,-)
%{_libdir}/libtcplay.so.2.0*

%changelog
openSUSE Build Service is sponsored by