LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File xiphos.spec of Package xiphos (Project Education)

#
# spec file for package xiphos
#
# Copyright (c) 2012 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/
#


%if ( 0%{?suse_version} >= 1200 || 0%{?fedora} > 14 )
%define		gtk3 1
%endif

Name:           xiphos
Version:        3.1.5
Release:        0
License:        GPL-2.0
Summary:        GNOME-based Bible research tool
Url:            http://xiphos.org/
Group:          Productivity/Scientific/Other
Source0:        xiphos-3.1.5.tar.bz2
Source1:        %{name}.desktop

BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  gettext-devel
BuildRequires:  glibc-devel
BuildRequires:  intltool
%if %{undefined mdkversion}
BuildRequires:  libbonobo-devel
BuildRequires:  libgnomeui-devel
%endif
BuildRequires:  libgsf-devel
BuildRequires:  libidn-devel
BuildRequires:  pcre-devel
BuildRequires:  perl-XML-Parser
BuildRequires:  scrollkeeper
BuildRequires:  sword-devel > 1.6.2
%if ( %{undefined centos_version} && 0%{?suse_version} != 1110 )
BuildRequires:  pkgconfig(cairo)
BuildRequires:  pkgconfig(dbus-glib-1)
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(gtk+-2.0)
BuildRequires:  pkgconfig(libglade-2.0)
%endif

%if ( %{undefined fedora} && %{undefined centos_version} && %{undefined mdkversion} && 0%{?suse_version} != 1110 )

BuildRequires:  gnome-doc-utils-devel
BuildRequires:  libMagick++-devel
BuildRequires:  xorg-x11-libXdmcp-devel

  %if %{defined gtk3}
BuildRequires:  libwebkitgtk3-devel
  %else
BuildRequires:  libwebkitgtk-devel
  %endif
%endif
#
# CentOS
#
%if %{defined centos_version}
BuildRequires:  perl-Compress-Zlib
BuildRequires:  cairo-devel
BuildRequires:  dbus-glib-devel
BuildRequires:  glib2-devel
BuildRequires:  gtk2-devel
BuildRequires:  libglade2-devel
BuildRequires:  gnome-doc-utils
BuildRequires:  libXdmcp-devel
BuildRequires:  sane-backends-libs
BuildRequires:  gtkhtml3-devel
  %if 0%{?centos_version} >= 600
BuildRequires:  webkitgtk-devel
BuildRequires:  libcurl-devel
  %else
BuildRequires:  curl-devel
BuildRequires:  xulrunner-devel
BuildRequires:  python26
BuildRequires:  sqlite
%define		xulbuild 1
  %endif
%endif
#
# openSUSE
#
%if %{defined suse_version}
BuildRequires:  update-desktop-files
%if %{defined gtk3}
BuildRequires:  gtkhtml-devel
%else
BuildRequires:  gtkhtml2-devel
%endif
Recommends:     sword-bible
Recommends:     sword-commentary
%if 0%{?suse_version} <= 1130
BuildRequires:  gnome-spell2
%endif
%endif
#
# SLES
#
%if 0%{?suse_version} == 1110
BuildRequires:  mozilla-xulrunner190-devel
BuildRequires:  gnome-doc-utils
%define		xulbuild 1
%endif
#
# Fedora
#
%if %{defined fedora}
BuildRequires:  gnome-doc-utils
BuildRequires:  libXdmcp-devel
BuildRequires:  sane-backends-libs
BuildRequires:  gtkhtml3-devel
BuildRequires:  webkitgtk3-devel
%endif
#
# Mandriva
#
%if %{defined mdkversion}
BuildRequires:  pkgconfig(libbonobo-2.0)
BuildRequires:  libgnomeui2-devel
BuildRequires:  gnome-doc-utils
BuildRequires:  libMagick-devel
BuildRequires:  libxdmcp-devel
BuildRequires:  polkit-gnome
%endif

Provides:       sword-frontend
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Bible Study Software for the Linux community. Lookup and search Bible texts and
commentaries. Xiphos uses modules and libraries from the SWORD Project.
Display multiple translations in the interlinear window. Search for passages in
any translation by word, phrase, or regular expression. Install this package
if you want to browse the Bible translations and reference works distributed
by Crosswire Bible Society through the SWORD Project.

%prep
%setup -q -n xiphos-3.1.5

%build
# SLES lacks the abillity to build help files for some reason
%if %{defined sles_version}
%define EXTRAOPTS --disable-help
%endif

rm -rf build
export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags}"
%if ( %{defined centos_version} && 0%{?centos_version} < 600 )
/usr/bin/python26 \
%endif
%if %{defined xulbuild}
./waf configure --prefix=%{_prefix} --backend=xulrunner --gtk=2 %{?EXTRAOPTS}
%else
  %if %{defined gtk3}
./waf configure --prefix=%{_prefix} --backend=webkit --gtk=3
  %else
./waf configure --prefix=%{_prefix} --backend=webkit --gtk=2
  %endif
%endif
./waf build

%install
./waf install --destdir=%{buildroot}

install -D -m 644 %{SOURCE1} %{buildroot}%{_datadir}/applications/%{name}.desktop
%if 0%{?suse_version}
%suse_update_desktop_file -n %{buildroot}%{_datadir}/applications/%{name}.desktop
%endif

%if ( %{undefined fedora} && %{undefined centos_version} )
mkdir -p %{buildroot}%_defaultdocdir/%{name}
mv %{buildroot}%{_datadir}/doc/%{name}/* %{buildroot}%_defaultdocdir/%{name}/
rmdir %{buildroot}%{_datadir}/doc/%{name}
%endif

rm %{buildroot}%_defaultdocdir/%{name}/INSTALL

install -Dm644 xiphos.1 %{buildroot}%{_mandir}/man1/xiphos.1

%find_lang %{name}

%if %{undefined fedora}
%fdupes -s %{buildroot}
%endif

%clean
rm -rf %{buildroot}

%post
%if 0%{?suse_version} > 1130
%icon_theme_cache_post
%endif

%postun
%if 0%{?suse_version} > 1130
%icon_theme_cache_postun
%endif

%files -f %{name}.lang
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING NEWS README RELEASE-NOTES TODO TRANSLATION-HOWTO
%dir %{_datadir}/%{name}
%{_bindir}/xiphos*
%{_datadir}/xiphos/*
%{_datadir}/icons/hicolor/scalable/apps/*
%{_datadir}/applications/%{name}.desktop
%{_mandir}/man1/*
%if ( %{defined centos_version} || %{defined fedora} )
%{_defaultdocdir}/%{name}/*
%{_datadir}/gnome/help/%{name}/*
%{_datadir}/omf/%{name}/*
%endif

%changelog