Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 7c82cde17cf43ca04c42f4e524dc440a > files > 5

newscache-1.2-0.11.rc6.fc12.src.rpm

%define srcnamever	NewsCache-1.2rc6
%define socketver	1.12.12

Name: 		newscache
Summary: 	Free cache server for USENET News
Version: 	1.2
Release: 	0.11.rc6%{?dist}
Group: 		System Environment/Daemons
License:	GPLv2+
URL:		http://www.linuxhacker.at/newscache/
Source0: 	http://src.linuxhacker.at/NewsCache/%{srcnamever}.tar.gz
Source1:	http://src.linuxhacker.at/socket++/socket++-%{socketver}.tar.gz
Source2:	%{name}.init
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Patch1:		newscache-1.2rc6-config.patch
Patch2:		newscache-1.2rc6-gcc43.patch
Patch3:		socket++-1.12.12-autotools.patch
BuildRequires:	libtool, texinfo, pam-devel

Requires(pre): shadow-utils
Requires(post):	/sbin/chkconfig
Requires(preun): /sbin/chkconfig, /sbin/service
Requires(postun): /sbin/service



%description
NewsCache is a free cache server for USENET News. NewsCache acts to
news reading clients like a news server, except that it stores only
those articles that have been requested by at least one client.
NewsCache targets problems of the current News System like network
bandwidth consumption or the IO load caused by news clients.


%prep
%setup -q -n %{srcnamever} -a 1

cp etc/newscache.conf-dist newscache.conf
%patch1 -p0
%patch2 -p1

pushd socket++-%{socketver}
%patch3 -p1
popd


%build

# socket++ is a library from the same site as NewScache.
# While it is used by newscache only, there is no reason
# to ship it separately.

pushd socket++-%{socketver}
libtoolize --force
aclocal
autoheader
automake --add-missing
autoconf

%configure --enable-static --disable-shared
make
popd


SOCKDIR=$PWD/socket++-%{socketver}
export CPPFLAGS=-I$SOCKDIR
export LDFLAGS=-L$SOCKDIR/socket++/.libs 

./autogen
%configure --with-pam
make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT

make install DESTDIR=$RPM_BUILD_ROOT

rm -f $RPM_BUILD_ROOT%{_sysconfdir}/newscache.conf-dist
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/newscache.auth-dist

# info stuff is too obsolete
rm -f $RPM_BUILD_ROOT%{_infodir}/*

install -d $RPM_BUILD_ROOT%{_localstatedir}/cache/newscache

install -d $RPM_BUILD_ROOT%{_sysconfdir}
install -m644 -p newscache.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.conf

install -d $RPM_BUILD_ROOT%{_initrddir}
install -m755 -p %SOURCE2 $RPM_BUILD_ROOT%{_initrddir}/%{name}

install -d $RPM_BUILD_ROOT%{_sysconfdir}/pam.d
pushd $RPM_BUILD_ROOT%{_sysconfdir}/pam.d
cat <<EOF >%{name}
#%PAM-1.0
auth    include		password-auth
account include		password-auth

EOF
popd

install -d $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily
pushd $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily
cat <<EOF >%{name}
#!/bin/bash
/usr/sbin/newscacheclean

EOF
chmod 755 %{name}
popd


%pre

getent group news >/dev/null || groupadd -r news
getent passwd news >/dev/null || \
    useradd -r -g news -d /etc/news -s /sbin/nologin -c 'News user' news
exit 0


%post

/sbin/chkconfig --add %{name}


%preun
if [ $1 = 0 ]; then
   /sbin/service %{name} stop >/dev/null 2>&1
   /sbin/chkconfig --del %{name}
fi


%postun
if [ $1 != 0 ]; then
   /sbin/service %{name} condrestart >/dev/null 2>&1
fi


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root)
%attr(755,news,news) %dir %{_localstatedir}/cache/newscache
%config(noreplace) %{_sysconfdir}/%{name}.conf
%config(noreplace) %{_initrddir}/*
%config(noreplace) %{_sysconfdir}/pam.d/*
%config(noreplace) %{_sysconfdir}/cron.daily/*
%{_bindir}/*
%{_sbindir}/*
%doc AUTHORS COPYING NEWS README THANKS TODO
%doc doc/newscache*.txt etc/*-dist
%{_mandir}/*/*


%changelog
* Wed Sep 16 2009 Tomas Mraz <tmraz@redhat.com> - 1.2-0.11.rc6
- Use password-auth common PAM configuration instead of system-auth

* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2-0.10.rc6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2-0.9.rc6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Tue Jan  6 2009 Dmitry Butskoy <Dmitry@Butskoy.name> - 1.2-0.8.rc6
- Fix autotools stuff in socket++ for libtool >= 2

* Mon Jan  5 2009 Dmitry Butskoy <Dmitry@Butskoy.name> - 1.2-0.7.rc6
- Add news user and group (#478785) since Fedora 10

* Fri Feb 15 2008 Dmitry Butskoy <Dmitry@Butskoy.name> - 1.2-0.6.rc6
- change initscript to comply with the LSB standards

* Thu Feb 14 2008 Dmitry Butskoy <Dmitry@Butskoy.name> - 1.2-0.5.rc6
- add patch for gcc43

* Tue Aug 28 2007 Dmitry Butskoy <Dmitry@Butskoy.name>
- Correct Source0 and Source1 urls

* Fri Aug 17 2007 Dmitry Butskoy <Dmitry@Butskoy.name>
- Change License tag to GPLv2+

* Tue Nov  7 2006 Dmitry Butskoy <Dmitry@Butskoy.name> - 1.2-0.4.rc6
- spec file cleanups
- use "include" instead of pam_stack in pam file generated

* Wed Feb 15 2006 Dmitry Butskoy <Dmitry@Butskoy.name> - 1.2-0.3.rc6
- rebuild for FC5

* Wed Nov  2 2005 Dmitry Butskoy <Dmitry@Butskoy.name> - 1.2-0.2.rc6
- spec file cleanups
- accepted for Fedora Extra
  (review by John Mahowald <jpmahowald@gmail.com>)

* Mon Sep 19 2005 Dmitry Butskoy <Dmitry@Butskoy.name> - 1.2-0.1.rc6
- cleanups for Fedora Extra
- add correct init script and initial config file
- create pam and cron files just at install stage
- don't include .info file -- it is too old

* Thu Mar  3 2005 Dmitry Butskoy <Dmitry@Butskoy.name>
- include libsocket++ into source package and build with them,
  do not want an extra package used by newscache only (for a while...)
- some fixes for Fedora Core 3

* Sun Sep 26 2004 Herbert Straub <herbert@linuxhacker.at>
- Changing permission from 4775 to 0775 (updatenews)
- New upstream version: 1.2rc6

* Thu Sep 23 2004 Herbert Straub <herbert@linuxhacker.at>
- Conditional rpmbuild for SuSE
- restart on upgrade
- update the runlevel information
- New upstream version 1.2rc5

* Tue Jul 22 2004 Herbert Straub <herbert@linuxhacker.at>
- Updated to version 1.2rc4

* Tue Mar 18 2003 Carles Arjona <nospammer@bigfoot.com>
- version 0.99.22p1-1 RPM

* Sat Oct 26 2002 Carles Arjona <nospammer@bigfoot.com>
- fixed up spec file
- version 0.99.22-1 RPM

* Mon Jul 29 2002 Carles Arjona <nospammer@bigfoot.com>
- version 0.99.19-1 RPM
- added chkconfig support to init script
- added /etc/cron.daily/newscache
- fixed up both setguid.cc , version number and man pages
- built SPEC from scratch