File pion-net.spec of Package pion-net

#
#spec file for package pion
#
Name:		pion-net
Version:	4.0.9
Release:	1
Summary:	C++ library for building lightweight HTTP interfaces
Group:      Development/Libraries/C and C++
License:	BSL-1.0
URL:		https://github.com/cloudmeter/pion
Source0:	%{name}-%{version}.tar.bz2
BuildRequires:	boost-devel >= 1.35.0, libopenssl-devel, log4cpp-devel, zlib-devel, libbz2-devel, libicu-devel
BuildRequires:  gcc-c++
BuildRequires:  pkgconfig
BuildRequires:	doxygen, autoconf, automake, libtool
Patch0:		pion-net-cflags.patch
Patch1:		pion-net-pkgconfig.patch
Patch2:		pion-net-gcc47-symbols-lookup.patch
Patch3:		pion-net-boost-linking.patch
Patch4:		pion-net-log4cpp-headers.patch
Patch5:		pion-net-boost-compatibility.patch
Patch6:		pion-net-boost-time-utc.patch

%description
Pion Network Library is a C++ framework for building lightweight HTTP
interfaces.

%package	devel
Summary:	Development files for pion-net
Group:      Development/Libraries/C and C++
License:	BSL-1.0
Requires:	%{name}%{?_isa} = %{version}-%{release}
Requires:	boost-devel >= 1.35.0, libopenssl-devel, log4cpp-devel, zlib-devel, libbz2-devel, libicu-devel

%description devel
This package contains the pkgconfig, header files, and libraries needed to
develop application that use %{name}.

%package	doc
Summary:	Documentation for pion-net
Group:      Documentation/HTML
BuildArch:	noarch

%description doc
This package contains Doxygen HTML documentation for pion-net library.


%prep
%setup -q
for patch in %patches; do
	echo "Applying $patch" >&2
	%__patch -p1 -i $patch
done


%build

./autogen.sh
%configure \
	--disable-static \
	--with-pic \
	--with-plugins=%{_libdir}/pion/plugins \
	--with-boost-extension=-mt \
	--with-zlib \
	--with-bzlib \
	--with-openssl \
	--with-log4cpp

make %{?_smp_mflags}

# regenerate upstream documentation
make doxygen-clean
make doxygen-run

%install
make install DESTDIR=%{buildroot}

# delete example apps
rm -f %{buildroot}%{_bindir}/PionHelloServer
rm -f %{buildroot}%{_bindir}/PionWebServer

# delete libtool archives
rm -f %{buildroot}%{_libdir}/*.la
rm -f %{buildroot}%{_libdir}/pion/plugins/*.la

# install documentation
install -d -m 0755 %{buildroot}%{_docdir}/%{name}-%{version}
cp -arv net/doc/html %{buildroot}%{_docdir}/%{name}-%{version}


%check
make check

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig


%files
%defattr (-,root,root)
%doc AUTHORS COPYING NEWS TODO
%dir %{_libdir}/pion
%dir %{_libdir}/pion/plugins
%{_libdir}/libpion-*4.0.so
%{_libdir}/pion/plugins/*.so
%exclude %{_docdir}/%{name}-%{version}/html


%files devel
%defattr (-,root,root)
%{_includedir}/pion/
%{_libdir}/pkgconfig/*.pc
%{_libdir}/libpion-common.so
%{_libdir}/libpion-net.so


%files doc
%defattr (-,root,root)
%dir %{_docdir}/%{name}-%{version}/
%doc %{_docdir}/%{name}-%{version}/html


%changelog