# This spec file was generated using Kpp
# If you find any problems with this spec file please report
# the error to ian geiser <geiseri@msoe.edu>
Name:      @PACKAGE@
Version:   @VERSION@
Release:   @RELEASE@
Copyright: GPL
Vendor:    Mathias K�ster <mathen@users.berlios.de>
Url:       http://dcgui.berlios.de
Packager:  Mathias K�ster <mathen@users.berlios.de>
Summary:   Direct Connect file sharing library
Group:     System/Libraries
Source:    %{name}-%{version}.tar.gz
BuildRoot: /var/tmp/%{name}-%{version}-buildroot

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

%package devel
Summary: Development Direct Connect shared library
Group:  Development/C++

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

%prep
%setup
CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" ./configure \
                 --build=i386-linux --host=i386-linux \
                $LOCALFLAGS
%build
# Setup for parallel builds
numprocs=`egrep -c ^cpu[0-9]+ /proc/stat || :`
if [ "$numprocs" = "0" ]; then
  numprocs=1
fi

make -j$numprocs

%install
make install-strip DESTDIR=$RPM_BUILD_ROOT

cd $RPM_BUILD_ROOT
find . -type d -not -path '*include*' | sed '1,2d;s,^\.,\%attr(-\,root\,root) \%dir ,' > $RPM_BUILD_DIR/file.list.dclib
find . -type f -not -path '*include*' -not -name '*.la' -not -name '*.a' | sed 's,^\.,\%attr(-\,root\,root) ,' >> $RPM_BUILD_DIR/file.list.dclib
find . -type l | sed 's,^\.,\%attr(-\,root\,root) ,' >> $RPM_BUILD_DIR/file.list.dclib
find . -type d | sed '1,2d;s,^\.,\%attr(-\,root\,root) \%dir ,' > $RPM_BUILD_DIR/file.list.dclib.devel
find . -type f | sed 's,^\.,\%attr(-\,root\,root) ,' >> $RPM_BUILD_DIR/file.list.dclib.devel
find . -type l | sed 's,^\.,\%attr(-\,root\,root) ,' >> $RPM_BUILD_DIR/file.list.dclib.devel

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%clean
rm -rf $RPM_BUILD_ROOT/*
rm -rf $RPM_BUILD_DIR/dclib
rm -rf ../file.list.dclib
rm -rf ../file.list.dclib.devel

%files -f ../file.list.dclib

%files devel -f ../file.list.dclib.devel
