File sword.spec of Package sword

#
# spec file for package sword
#
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#

# norootforbuild


Name:           sword
Summary:        The SWORD Project framework for manipulating Bible texts
Version:        1.6.1
Release:        1
%define         soname 1_6_1
License:        GPL
Group:          Productivity/Other
Url:            http://www.crosswire.org/sword
Vendor:         openSUSE-Education
BuildRequires:  curl-devel gcc-c++ pkgconfig
BuildRequires:  libicu-devel
BuildRequires:  icu
BuildRequires:  zlib-devel
Requires:       libsword-%soname = %version
Source0:        %name-%version.tar.bz2
Patch1:         sword-1.6.1-fix_compiler_warnings.patch
Patch2:         sword-1.6.1-curl.patch
#
# openSUSE
#
%if 0%{?suse_version}
Recommends:     sword-bible
Recommends:     sword-commentary
Recommends:     sword-frontend
BuildRequires:  clucene-core-devel 
%endif
#
# Fedora
#
%if 0%{?fedora_version}
BuildRequires:  clucene-core-devel 
%endif
#
# Mandriva
#
%if 0%{?mandriva_version}
BuildRequires:  libclucene-devel
%endif

BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
The SWORD Project is an effort to create an ever expanding software package for 
research and study of God and His Word.

The SWORD Bible Framework allows easy manipulation of Bible texts, commentaries,
lexicons, dictionaries, etc.  Many frontends are build using this framework.
An installed module set may be shared between any frontend using the framework.


%package -n libsword-%soname
Summary:        Shared library for sword
Group:          Development/Libraries/Other
Provides:       libsword = %version
Provides:       libsword%soname

%description -n libsword-%soname
This package contains the shared library for applications using sword.


%package devel
Summary:        Include files and static libraries for developing sword applications
Group:          Development/Libraries/Other
Requires:       sword = %{version}
Requires:       libcurl-devel

%description devel
Include files and static libraries for developing sword applications. This package
is required to compile Sword frontends, too.


%prep
%setup -q
%patch1 -p0
%patch2 -p0

%build
%configure --disable-static \
           --with-icu \
           --enable-tests \
           --enable-examples
make %{?jobs:-j%jobs}

%check
cd tests/testsuite 
# could not run all tests, as verseparsing-utf8 tries to 
# use already installed locales and not the currently 
# build ones :-(
# && ./runall.sh
TESTSUITE=$(for i in *.good; do basename $i .good; done)
for i in $TESTSUITE; do
	case $i in 
		verseparsing*)
			continue
		;;
		*)
			echo -n "$i: "
			./runtest.sh $i -q
		    if [ $? -ne 0 ]; then
		        echo FAILED
		        echo ""
		        echo To see problems, try running:
		        echo ./runtest.sh $i
		        echo ""
		        exit 1
		    else
		        echo PASSED.
		    fi
		;;
	esac
done

%install
%makeinstall install_config
rm %buildroot/%_libdir/*.la
pushd %buildroot/%_bindir
strip *
strip %buildroot/%_libdir/libsword*.so
popd

%post -n libsword-%soname -p /sbin/ldconfig

%postun -n libsword-%soname -p /sbin/ldconfig

%clean
rm -rf %buildroot

%files
%defattr(-,root,root)
%doc AUTHORS COPYING ChangeLog NEWS README
%dir %{_datadir}/sword
%dir %{_datadir}/sword/locales.d
%dir %{_datadir}/sword/mods.d
%dir %{_libdir}/sword
%{_libdir}/sword/*
%config (noreplace) %_sysconfdir/sword.conf
%config (noreplace) %_datadir/sword/locales.d/*
%config (noreplace) %_datadir/sword/mods.d/globals.conf

%files -n libsword-%soname
%defattr(-,root,root)
%_libdir/libsword-%version.so

%files devel
%defattr(-,root,root)
%doc doc/*
%doc CODINGSTYLE
%_bindir/*
%_includedir/*
%_libdir/pkgconfig/sword.pc
%_libdir/*.so
%exclude %_libdir/libsword-%version.so

%changelog
openSUSE Build Service is sponsored by