File irstlm.spec of Package irstlm

#
# spec file for package irstlm
#
# Copyright (c) 2015 SUSE LINUX 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 so_ver 0

Name:           irstlm
Version:        5.80.08
Release:        0
Summary:        Statistical language model tool
License:        LGPL-2.1+
Group:          Development/Libraries/C and C++
Url:            http://hlt.fbk.eu/technologies/irstlm-irst-language-modelling-toolkit
Source0:        http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tgz
# Fix a case of violating the ANSI strict aliasing rules.
# https://sourceforge.net/tracker/?func=detail&aid=3608176&group_id=183064&atid=903742
Patch0:         %{name}-alias.patch
# Update configure.in.  Sent upstream 24 Oct 2013.
Patch1:         %{name}-configure.patch
BuildRequires:  gcc-c++
BuildRequires:  libtool
BuildRequires:  tex(epsf.sty)
BuildRequires:  tex(framed.sty)
BuildRequires:  tex(fullpage.sty)
BuildRequires:  tex(latex)
BuildRequires:  tex(version.sty)
BuildRequires:  pkgconfig(zlib)
# date and rm are invoked at runtime
Requires:       coreutils

%description
Irstlm is a tool for the estimation, representation, and computation of
statistical language models.

%package -n lib%{name}%{so_ver}
Summary:        Statistical language model tool --shared library
Group:          System/Libraries

%description -n lib%{name}%{so_ver}
Irstlm is a tool for the estimation, representation, and computation of
statistical language models.

%package devel
Summary:        Headers and libraries for building with %{name}
Group:          Development/Libraries/C and C++
Requires:       lib%{name}%{so_ver} = %{version}-%{release}

%description devel
The headers and libraries needed to build applications that use %{name}.

%package tools
Summary:        Programs and scripts that use the %{name} library
Group:          Development/Libraries/C and C++
Requires:       lib%{name}%{so_ver} = %{version}-%{release}

%description tools
Programs and scripts that use the %{name} library.

%prep
%setup -q
%patch0
%patch1

cd trunk

# Fix executable bits
find src -type f -perm /0111 | xargs chmod a-x
chmod a+x scripts/rm-start-end.sh scripts/wrapper

# Upstream doesn't ship the actual configure script
autoreconf -fi

%build
cd trunk
%configure --enable-shared --disable-static --enable-interpolatedsearch \
  --enable-caching --enable-doc
make %{?_smp_mflags}

%install
cd trunk
mkdir -p %{buildroot}%{_bindir}
make DESTDIR=%{buildroot} install %{?_smp_mflags}

# Move the header files into their own directory to avoid name clashes
mkdir -p %{buildroot}%{_includedir}/%{name}
mv %{buildroot}%{_includedir}/*.h %{buildroot}%{_includedir}/%{name}

# We don't want libtool archives
find %{buildroot} -type f -name "*.la" -delete -print

# We will install the documentation our own way
rm -fr %{buildroot}%{_prefix}/doc

%post -n lib%{name}%{so_ver} -p /sbin/ldconfig

%postun -n lib%{name}%{so_ver} -p /sbin/ldconfig

%files -n lib%{name}%{so_ver}
%defattr(-,root,root)
%doc trunk/README trunk/RELEASE trunk/Copyright
%{_libdir}/lib%{name}.so.*

%files devel
%defattr(-,root,root)
%{_includedir}/%{name}/
%{_libdir}/lib%{name}.so

%files tools
%defattr(-,root,root)
%{_bindir}/*

%changelog
openSUSE Build Service is sponsored by