File libircclient.spec of Package libircclient

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


Name:           libircclient
%define soname 1
Version:        1.9
Release:        0
Summary:        Library implementing client-server IRC protocol
License:        LGPL-2.0+
Group:          System/Libraries
Url:            http://libircclient.sourceforge.net/
Source0:        http://sourceforge.net/projects/%{name}/files/%{name}/%{version}/%{name}-%{version}.tar.gz
# PATCH-FIX-OPENSUSE  libircclient-memory-overflow.diff
Patch0:         libircclient-memory-overflow.diff
# PATCH-FIX-UPSTREAM libircclient-cipher-suite.patch bnc#857151
Patch1:         libircclient-cipher-suite.diff
BuildRequires:  automake
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  libopenssl-devel
BuildRequires:  libtool
BuildRequires:  python-Sphinx
BuildRequires:  python-rst2pdf
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
It is designed to be small, fast, portable and compatible to RFC standards and most IRC clients.

%package -n %{name}%{soname}
Summary:        Library implementing client-server IRC protocol
Group:          Development/Libraries/C and C++

%description -n %{name}%{soname}
It is designed to be small, fast, portable and compatible to RFC standards and most IRC clients.

%package -n %{name}-devel
Summary:        Header files and libraries for compiling against libircclient
Group:          Development/Libraries/C and C++
Requires:       %{name}%{soname} = %{version}

%description -n %{name}-devel
It is designed to be small, fast, portable and compatible to RFC standards and most IRC clients.

%package -n %{name}-doc
Summary:        Documentation for libircclient
Group:          Development/Libraries/C and C++

%description -n %{name}-doc
It is designed to be small, fast, portable and compatible to RFC standards and most IRC clients.

%prep
%setup -q
%patch0 -p1
%patch1 -p1

%build
export CFLAGS="%{optflags} -fno-strict-aliasing"
export CPPFLAGS="$CFLAGS"
%configure --enable-ipv6 --enable-openssl --enable-shared
make %{?_smp_mflags}
cd doc
make html

%install
%makeinstall
rm -f "%{buildroot}/%{_libdir}"/*.la
mkdir -p "%{buildroot}/%{_mandir}/man1";
install -pm0644 man/libircclient.1 "%{buildroot}/%{_mandir}/man1/";
%fdupes -s %{buildroot}

%post -n %{name}%{soname} -p /sbin/ldconfig

%postun -n %{name}%{soname} -p /sbin/ldconfig

%files -n %{name}%{soname}
%defattr(-,root,root)
%doc Changelog LICENSE README THANKS
%{_libdir}/libircclient.so.%{soname}

%files -n %{name}-devel
%defattr(-,root,root)
%{_includedir}/*
%{_libdir}/libircclient.so
%{_mandir}/man1/*

%files -n %{name}-doc
%defattr(-,root,root)
%doc doc/_build/html examples/*.cpp examples/*.c

%changelog
openSUSE Build Service is sponsored by