File bibletime.spec of Package bibletime
#
# spec file for package bibletime
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2012-2014 Lars Vogdt
#
# 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/
#
Name: bibletime
Version: 2.10.1
Release: 0
Summary: An easy to use Bible study tool
License: GPL-2.0+
Group: Productivity/Scientific/Other
Url: http://www.bibletime.info/
Source0: %name-%version.tar.xz
Source2: bibletime-rpmlintrc
BuildRequires: boost-devel
BuildRequires: cmake
BuildRequires: curl-devel
BuildRequires: libqt4-devel
BuildRequires: sword-devel >= 1.7
Provides: %{name}-i18n = %version
Obsoletes: %{name}-devel < 1.7
Obsoletes: %{name}-i18n < 1.7
Provides: %{name}-devel = %version
Provides: sword-frontend
#
# openSUSE
#
%if 0%{?suse_version}
BuildRequires: clucene-core-devel
BuildRequires: fdupes
BuildRequires: libQtWebKit-devel
BuildRequires: pkg-config
BuildRequires: update-desktop-files
Recommends: sword-bible
Recommends: sword-commentary
%endif
#
# Fedora
#
%if 0%{?fedora_version}
BuildRequires: clucene-core-devel
BuildRequires: desktop-file-utils
BuildRequires: gcc-c++
BuildRequires: pkgconfig
%if 0%{?fedora_version} > 11
#BuildRequires: webkitkde-devel
BuildRequires: qt-webkit-devel
%else
BuildRequires: WebKit-qt-devel
%endif
%endif
#
# Mandriva
#
%if 0%{?mandriva_version}
BuildRequires: desktop-file-utils
BuildRequires: libclucene-devel
BuildRequires: pkgconfig
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define kdeprefix %{_prefix}
%description
BibleTime is a completely free Bible study program.
The software uses the SWORD programming library to work with over 200 free
Bible texts, commentaries, dictionaries and books provided by the Crosswire
Bible Society.
BibleTime provides easy handling of digitalized texts (Bibles, commentaries and
lexicons) and powerful features to work with these texts (search in texts,
write own notes, save, print etc.).
%prep
%setup -q
%build
mkdir build
pushd build >/dev/null
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="%{_prefix}" ../
%{__make} %{?_smp_mflags}
popd >/dev/null
%install
pushd build >/dev/null
make install DESTDIR="%{buildroot}"
popd >/dev/null
# fix language pathnames
test -d %{buildroot}%kdeprefix/share/locale/pt_br && mv %{buildroot}%kdeprefix/share/locale/pt_br %{buildroot}%kdeprefix/share/locale/pt_BR
test -d %{buildroot}%kdeprefix/share/doc/HTML/pt-br && mv %{buildroot}%kdeprefix/share/doc/HTML/pt-br %{buildroot}%kdeprefix/share/doc/HTML/pt_BR
# install manpages
install -Dm644 docs/manpages/bibletime.1 %{buildroot}%{_mandir}/man1/bibletime.1
install -Dm644 docs/manpages/bibletime.de.1 %{buildroot}%{_mandir}/de/man1/bibletime.1
# move the icon to a valid place (/usr/share/icons is not valid... it has to be in a theme; hicolor as the usual falback)
# this is only a link pointing out of the icons
rm %{buildroot}%{_datadir}/icons/%{name}.svg
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/scalable/apps
mv %{buildroot}%{_datadir}/%{name}/icons/%{name}.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
# then link back the icon into the app directory
ln -sf %{_datadir}/icons/hicolor/scalable/apps/%{name}.svg %{buildroot}%{_datadir}/%{name}/icons/%{name}.svg
%if 0%{?suse_version}
%fdupes -s %{buildroot}
sed -i "s|bibletime/handbook/index.html|bibletime/handbook/en/index.html|" %{buildroot}%{_datadir}/applications/%{name}.desktop
%suse_update_desktop_file -r %{name} Education Teaching
%endif
#
%if 0%{?fedora_version} || 0%{?mandriva_version}
install -Dm644 ./cmake/platforms/linux/bibletime.desktop.cmake %{buildroot}%{_datadir}/applications/bibletime.desktop
%endif
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root)
%doc %{_mandir}/man1/bibletime.1*
%doc %{_mandir}/de/man1/bibletime.1*
%dir %kdeprefix/share/bibletime
%kdeprefix/bin/*
%kdeprefix/share/icons/*
%kdeprefix/share/applications/bibletime.desktop
%kdeprefix/share/bibletime/*
%changelog