File passwordsafe.spec of Package passwordsafe

#
# spec file for package passwordsafe
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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/
#

%bcond_without passwordsafe_yubikey

Name:           passwordsafe
Version:        1.21.0
Release:        0
%define pkg_branch  %{version}
%define pkg_version %{version}
License:        Artistic-2.0
Summary:        A password database utility
Url:            https://github.com/pwsafe/pwsafe
Group:          Productivity/Security
Source:         pwsafe-%{pkg_version}.tar.gz
Source2:        series
Patch0:          linking.patch
Requires:       ykpers
Recommends:     %{name}-cli
BuildRequires:  cmake
BuildRequires:  libcurl-devel
BuildRequires:  file-devel
BuildRequires:  gcc-c++
BuildRequires:  libuuid-devel
BuildRequires:  libxerces-c-devel
BuildRequires:  libXt-devel
BuildRequires:  libXtst-devel
BuildRequires:  qrencode-devel
BuildRequires:  openssl-devel
BuildRequires:  wxWidgets-3_0-devel
BuildRequires:  zip
%if %{with passwordsafe_yubikey}
BuildRequires:  libyubikey-devel
BuildRequires:  libykpers-devel
%endif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Password Safe is a password database utility. Like many other such
products, commercial and otherwise, it stores your passwords in an
encrypted file, allowing you to remember only one password (the "safe
combination"), instead of all the username/password combinations that
you use.

%package cli
Group:          Productivity/Security
#
Summary:        A password database utility - commandline interface
%description cli
Password Safe is a password database utility. Like many other such
products, commercial and otherwise, it stores your passwords in an
encrypted file, allowing you to remember only one password (the "safe
combination"), instead of all the username/password combinations that
you use.

This package holds the commandline interface for pwsafe.

%prep
%autosetup -p1 -n pwsafe-%{pkg_version}

FAKE_BUILDDATE=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%b %%e %%Y')
FAKE_BUILDTIME=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%H:%%M:%%S')
sed -i -e "s/__DATE__/\"$FAKE_BUILDDATE\"/" -e "s/__TIME__/\"$FAKE_BUILDTIME\"/" src/ui/wxWidgets/AboutDlg.cpp
chmod a-x docs/*.md

%build
%cmake \
  %if ! %{with passwordsafe_yubikey}
  -DNO_YUBI:BOOL=ON        \
  %endif
  -DINSTALL_GTEST:BOOL=OFF \
  -DNO_GTEST:BOOL=ON
%cmake_build

%install
%cmake_install
%find_lang pwsafe

%files -f pwsafe.lang
%defattr(-,root,root)
%doc README.md docs/ReleaseNotes.md docs/ChangeLog.txt
%license LICENSE install/copyright
%{_bindir}/pwsafe
%{_datadir}/applications/pwsafe.desktop
%{_datadir}/metainfo/org.pwsafe.pwsafe.metainfo.xml
%{_datadir}/icons/hicolor/128x128/apps/pwsafe.png
%{_datadir}/icons/hicolor/48x48/apps/pwsafe.png
%{_mandir}/man1/pwsafe.1*
%{_datadir}/passwordsafe/

%files cli
%defattr(-,root,root)
%doc README.md docs/ReleaseNotes.md docs/ChangeLog.txt
%license LICENSE install/copyright
%{_bindir}/pwsafe-cli

%changelog
openSUSE Build Service is sponsored by