File libzen.spec of Package libzen

# spec file for package libzen
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2008-2010 oc2pus
#
# 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 sover	0
Name:           libzen
Version:        0.4.31
Release:        0
Summary:        C++ utility library
License:        Zlib
Group:          Development/Libraries/C and C++
Url:            http://zenlib.sourceforge.net/
Source:         https://prdownloads.sourceforge.net/zenlib/libzen_%{version}.tar.bz2
Source1:        baselibs.conf
BuildRequires:  doxygen
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  libtool
BuildRequires:  pkgconfig
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
ZenLib is a C++ utility library. It includes classes for handling
strings, configuration, bit streams, threading, translation
and cross-platform operating system functions.

%package -n %{name}%{sover}
Summary:        The ZenLib C++ utility library
Group:          System/Libraries

%description -n %{name}%{sover}
ZenLib is a C++ utility library. It includes classes for handling
strings, configuration, bit streams, threading, translation
and cross-platform operating system functions.

%package -n libzen-devel
Summary:        Include files to develop for %{name}
Group:          Development/Libraries/C and C++
Requires:       %{name}%{sover} = %{version}

%description -n libzen-devel
Include files and mandatory libraries to develop
for %{name}.

%prep
%setup -q -n ZenLib
sed -i 's/\r$//' *.txt Source/Doc/*.html
chmod 644 *.txt Source/Doc/*.html

%build
# generate docs
pushd Source/Doc
    doxygen -u 2> /dev/null
    doxygen Doxyfile
popd

pushd Project/GNU/Library
    chmod +x autogen
    NOCONFIGURE=1 ./autogen
    %configure --enable-shared --disable-static
    make %{?_smp_mflags}
popd

%install
pushd Project/GNU/Library
%make_install
popd

# Zenlib headers and ZenLib-config
install -dm 755 %{buildroot}%{_includedir}/ZenLib
install -m 644 Source/ZenLib/*.h \
    %{buildroot}%{_includedir}/ZenLib
for i in HTTP_Client Format/Html Format/Http; do
    install -dm 755 %{buildroot}%{_includedir}/ZenLib/$i
    install -m 644 Source/ZenLib/$i/*.h \
    	%{buildroot}%{_includedir}/ZenLib/$i
done

sed -i -e 's|Version: |Version: %{version}|g' \
    Project/GNU/Library/libzen.pc
install -dm 755 %{buildroot}%{_libdir}/pkgconfig
install -m 644 Project/GNU/Library/libzen.pc \
    %{buildroot}%{_libdir}/pkgconfig

rm %{buildroot}%{_libdir}/libzen.la

# we don't need libzen-config
rm %{buildroot}%{_bindir}/libzen-config

%fdupes %{buildroot}/%{_prefix}

%post   -n %{name}%{sover} -p /sbin/ldconfig
%postun -n %{name}%{sover} -p /sbin/ldconfig

%files -n %{name}%{sover}
%defattr(-,root,root,-)
%doc *.txt
%{_libdir}/libzen.so.%{sover}
%{_libdir}/libzen.so.%{sover}.*

%files -n libzen-devel
%defattr(-,root,root,-)
%doc Source/Doc/Documentation.html
%doc Doc/*
%{_includedir}/ZenLib/
%{_libdir}/libzen.so
%{_libdir}/pkgconfig/*.pc

%changelog
openSUSE Build Service is sponsored by