File hyphen.spec of Package hyphen

#
# spec file for package hyphen
#
# 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/
#


%define libname libhyphen0

Name:           hyphen
Version:        2.8.6
Release:        0
License:        GPL-2.0+ or LGPL-2.0+ or MPL-1.1+
Summary:        A text hyphenation library
URL:            http://hunspell.sourceforge.net/
Group:          System/Libraries
Source0:        http://downloads.sourceforge.net/hunspell/%name-%version.tar.gz
BuildRequires:  pkgconfig
BuildRequires:  hunspell-devel
BuildRequires:  gcc-c++
BuildRoot:      %_tmppath/%name-%version-build

%description
Hyphen is a library for high quality hyphenation and justification.

%package -n %libname
Summary:        A simple thesaurus for Libreoffice
Group:          System/Libraries

%description -n %libname
Hyphen is a library for high quality hyphenation and justification.

%package en
Requires:       hyphen
Summary:        English hyphenation rules
Group:          Productivity/Text/Spell
BuildArch:      noarch

%description en
English text hyphenation rules.

%package devel
Summary:        Files for Developing with %name
Group:          Development/Libraries/C and C++
Requires:       %libname = %version

%description devel
Hyphen is a library for high quality hyphenation and justification.

This package contains the %name development files.

%prep
%setup -q

%build
%configure \
	--disable-static
make %{?_smp_mflags}

%install
make DESTDIR=%buildroot install

rm %buildroot%_libdir/*.la

pushd %buildroot/%_datadir/%name/
en_US_aliases="en_AU en_BS en_BZ en_CA en_GH en_GB en_IE en_IN en_JM en_NA en_NZ en_PH en_TT en_ZA en_ZW"
for lang in $en_US_aliases; do
	ln -s hyph_en_US.dic hyph_$lang.dic
done
popd

%post -n %libname -p /sbin/ldconfig

%postun -n %libname -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog README README.hyphen README.nonstandard TODO
%dir %{_datadir}/hyphen

%files en
%defattr(-,root,root,-)
%_datadir/%name/hyph_en*.dic

%files -n %libname
%defattr(-,root,root)
%_libdir/*.so.*

%files devel
%defattr(-,root,root)
%_libdir/*.so
%_includedir/%{name}*
%_bindir/substrings.pl

%changelog
openSUSE Build Service is sponsored by