File dclib.spec of Package dclib

# norootforbuild

%if %suse_version >= 1599
%define without_socks 1
%else
%define without_socks 0
%endif

%define soname		5
%define qtdir		/usr/lib/qt3

Name:				libdc%{soname}
Version:			0.3.23
Release:			0
Summary:			Direct Connect File Sharing Protocol Library
Source:			wxdcgui-dclib.tar.gz
URL:				http://wxdcgui.sourceforge.net/
Group:			Development/Libraries/C and C++
License:			GPL-2.0
BuildRoot:		%{_tmppath}/build-%{name}-%{version}
BuildRequires:	bzip2 libstdc++-devel qt3-devel
BuildRequires:	gcc-c++ libxml2-devel zlib-devel
%if 0%{?suse_version} >= 1500
BuildRequires:  libopenssl-1_0_0-devel -libopenssl-devel -openssl-1_1
%else
BuildRequires: openssl-devel
%endif
%if !%{without_socks}
BuildRequires:	dante-devel pam-devel
%endif
BuildRequires:	libbz2-devel
BuildRequires:	autoconf automake libtool
Provides:		libdc = %{version}-%{release}
Provides:		dclib = %{version}-%{release}
Obsoletes:		dclib < %{version}-%{release}

%description
This library implements the Direct Connect file sharing protocol.
The package contains the shared library required for running programs based on
dclib.

%package -n libdc-devel
Summary:			Development environment for %{name}
Group:			Development/Libraries/C and C++
Requires:		%{name} = %{version}-%{release}
Requires:		openssl-devel zlib-devel libxml2-devel
%if %suse_version >= 1030
Requires:		libbz2-devel
%else
Requires:		bzip2
%endif
%if !%{without_socks}
Requires:		dante-devel pam-devel
%endif
Provides:		libdc%{soname}-devel = %{version}-%{release}
Provides:		dclib-devel = %{version}-%{release}
Obsoletes:		dclib-devel < %{version}-%{release}

%description -n libdc-devel
This library implements the Direct Connect file sharing protocol.
The package contains the C++ headers to compile programs based on dclib.

%prep
%setup -q -n "dclib"

autoreconf --verbose --install

%build
%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
export CFLAGS="%{optflags} -fno-strict-aliasing"
export CXXFLAGS="$CFLAGS"
export QTDIR="%{qtdir}"
%configure --enable-shared \
			  --enable-static \
%if !%{without_socks}
			  --enable-socks \
%else
			  --disable-socks \
%endif
			  --with-ssl-library=openssl

%__make %{?jobs:-j%{jobs}}

%install
%makeinstall

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

%clean
%__rm -rf "%{buildroot}"

%files
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING COPYING.OpenSSL
%doc README NEWS TODO
%{_libdir}/libdc.so.%{soname}
%{_libdir}/libdc.so.%{soname}.*.*

%files -n libdc-devel
%defattr(-,root,root)
%{_includedir}/dclib-0.3
%{_libdir}/libdc.so
%{_libdir}/libdc.la
%{_libdir}/libdc.a
%{_libdir}/pkgconfig/dclib.pc

%changelog
* Mon Nov 24 2008 Michal Svec 0.3.23
- update

* Mon Nov 24 2008 Pascal Bleser <guru@unixtech.be> 0.3.22-0.pm.4
- fixed Requires for -devel package when built with socks support

* Sun Nov 23 2008 Pascal Bleser <guru@unixtech.be> 0.3.22-0.pm.1
- added SOCKS support
- SONAME bump from .so.3 to .so.4, branched off dclib3 package for
  backwards ABI compatibility based on old SONAME
- update to 0.3.22

* Sat Sep 13 2008 Pascal Bleser <guru@unixtech.be> 0.3.21-0.pm.1
- update to 0.3.21

* Fri Sep  5 2008 Pascal Bleser <guru@unixtech.be> 0.3.20-0.pm.1
- update to 0.3.20

* Fri Aug  8 2008 Pascal Bleser <guru@unixtech.be> 0.3.19-0.pm.1
- added ldconfig
- new upstream version

* Thu Jul 10 2008 Pascal Bleser <guru@unixtech.be> 0.3.18-0.pm.2
- added Obsoletes to upgrade smoothly from dclib to libdc

* Thu Jul 10 2008 Pascal Bleser <guru@unixtech.be> 0.3.18-0.pm.1
- plugin directory moved from %_libdir/dclib/plugin to %_libdir/dclib-0.3/plugin
- added -fno-strict-aliasing to compile flags
- renamed dclib to libdc0 for openSUSE Shared Library Policy compliance,
  and to prepare parallel installation of dclib for Qt3 and dclib for Qt4
- new upstream version

* Sun Jun 22 2008 Pascal Bleser <guru@unixtech.be> 0.3.17-0.pm.1
- new upstream version

* Wed Jun 18 2008 Pascal Bleser <guru@unixtech.be> 0.3.16-0.pm.1
- new upstream version

* Sun Mar 16 2008 Pascal Bleser <guru@unixtech.be> 0.3.13-0.pm.1
- new upstream version

* Sat Jan  5 2008 Pascal Bleser <guru@unixtech.be> 0.3.12-0.pm.2
- fixed typo in Requires in -devel subpackage, thanks to Toni for reporting

* Sat Dec  8 2007 Pascal Bleser <guru@unixtech.be> 0.3.12-0.pm.1
- added shared library policy compliant Provides
- new upstream version

* Mon Oct 15 2007 Pascal Bleser <guru@unixtech.be> 0.3.11-0.pm.1
- new upstream version

* Tue Sep 25 2007 Pascal Bleser <guru@unixtech.be> 0.3.10-0.pm.1
- moved to Packman
- new upstream version

* Wed May 30 2007 Pascal Bleser <guru@unixtech.be> 0.3.9-1
- new upstream version

* Thu Dec 21 2006 Pascal Bleser <guru@unixtech.be> 0.3.8-1
- new upstream version

* Thu Mar  9 2006 Pascal Bleser <guru@unixtech.be> 0.3.7-2
- lib64 fix for .pc file
- added debuginfo support
- rewrote spec file

* Tue Mar 15 2005 Pascal Bleser <guru@unixtech.be> 0.3.7-1
- version 0.3.7

* Sat Feb 12 2005 Pascal Bleser <guru@unixtech.be> 0.3.6-1
- version 0.3.6

* Wed Jan  5 2005 Pascal Bleser <guru@unixtech.be> 0.3.5-1
- revamped package

# Local Variables:
# mode: rpm-spec
# tab-width: 3
# End:
openSUSE Build Service is sponsored by