1 # TODO: - review i and tests (especially .inet).
2 # - review permissions for newscache.auth
7 Summary(pl): nisza dla newsów
10 Release: 0.%{_rc}.%{_rel}
13 Group: Applications/News
14 Source0: http://www.linuxhacker.at/linux/downloads/src/%{name}-%{version}%{_rc}.tar.gz
15 # Source0-md5: a7b33314cd7701564b4947ab8615dcc2
18 # http://www.linuxhacker.at/linux/downloads/src/NewsCache-1.2rc6-patch1.gz
19 Patch0: %{name}-1.2rc6_maintainer.patch
20 Patch1: %{name}-config.patch
21 URL: http://www.linuxhacker.at/newscache/
22 BuildRequires: autoconf
23 BuildRequires: automake
24 BuildRequires: socket++-devel
25 BuildRequires: libwrap-devel
26 Requires(post,preun): /sbin/chkconfig
27 Requires: rpmbuild(macros) >= 1.208
28 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30 %define _sysconfdir /etc/%{name}
33 NewsCache is a free cache server for USENET News. NewsCache acts to
34 news reading clients like a news server, except that it stores only
35 those articles that have been requested by at least one client.
36 NewsCache targets problems of the current News System like network
37 bandwidth consumption or the IO load caused by news clients.
40 NewsCache to wolnodostêpny serwer keszuj±cy dla sieci USENET.
41 NewsCache jest widziany jako serwer nntp, ale przechowuje tylko te
42 artyku³y, o które pyta³ choæ jeden klient. NewsCache rozwi±zuje
43 problemy takie jak zajmowanie pasma czy obci±¿enie systemu We/Wy
44 spowodowane obs³ug± klientów news.
47 Summary: NewsCache standalone mode
48 Summary(pl): NewsCache w trybie samodzielnym
49 Group: Applications/News
51 Requires: %{name} = %{version}-%{release}
52 Obsoletes: %{name}-inetd
54 %description standalone
55 Run NewsCache in the standalone mode.
57 %description standalone -l pl
58 Uruchamia NewsCache w trybie samodzielnym.
61 Summary: NewsCache inetd mode
62 Summary(pl): NewsCache w trybie inetd
63 Group: Applications/News
64 Requires: %{name} = %{version}-%{release}
66 Obsoletes: %{name}-standalone
69 Run NewsCache from the inetd.
71 %description inetd -l pl
72 Uruchamia NewsCache pod konrol± inetd.
75 %setup -q -n %{name}-%{version}%{_rc}
88 rm -rf $RPM_BUILD_ROOT
90 install -d $RPM_BUILD_ROOT/var/cache/newscache
92 DESTDIR=$RPM_BUILD_ROOT
94 install -D %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/newscache
95 install -D %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/newscache
96 mv -f $RPM_BUILD_ROOT%{_sysconfdir}/newscache.auth{-dist,}
97 mv -f $RPM_BUILD_ROOT%{_sysconfdir}/newscache.conf{-dist,}
100 rm -rf $RPM_BUILD_ROOT
103 %groupadd -g 152 newscache
104 %useradd -u 152 -d /var/cache/newscache -s /bin/false -c "NewsCache User" -g newscache newscache
107 if [ "$1" = "0" ]; then
108 %userremove newscache
109 %groupremove newscache
112 %triggerun -- %{name} < 1.2
113 if [ "$1" = "2" -a "$2" = "1" ] ; then
114 # Don't use #%%banner file -a - messages are displayed twice or more
115 echo '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
116 %{name} works now with newscache user and group - making:
117 1. appropriate changes in your %{_sysconfdir}/newscache.conf ...'
119 %{__sed} -i -e 's@\(Username\)\s\+news@\1 newscache@' %{_sysconfdir}/newscache.conf
120 %{__sed} -i -e 's@\(Groupname\)\s\+news@\1 newscache@' %{_sysconfdir}/newscache.conf
122 echo '2. setting new, correct owner and group for /var/cache/newscache ...'
124 %{__chown} -R newscache:newscache /var/cache/newscache
127 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
131 /sbin/chkconfig --add newscache
132 if [ -f /var/lock/subsys/newscache ]; then
133 /etc/rc.d/init.d/newscache restart 1>&2
135 echo "Run \"/etc/rc.d/init.d/newscache start\" to start NewsCache daemon."
139 if [ "$1" = "0" ]; then
140 if [ -f /var/lock/subsys/newscache ]; then
141 /etc/rc.d/init.d/newscache stop 1>&2
143 /sbin/chkconfig --del newscache
147 if [ -f /var/lock/subsys/rc-inetd ]; then
148 /etc/rc.d/init.d/rc-inetd restart 1>&2
150 echo "Type \"/etc/rc.d/init.d/rc-inetd start\" to start NewsCache from inet server" 1>&2
154 if [ "$1" = "0" -a -f /var/lock/subsys/rc-inetd ]; then
155 /etc/rc.d/init.d/rc-inetd reload 1>&2
159 %defattr(644,root,root,755)
160 %doc AUTHORS ChangeLog NEWS README THANKS TODO
162 %attr(755,root,root) %{_bindir}/*
163 %attr(755,root,root) %{_sbindir}/*
165 %dir %attr(755,newscache,newscache) /var/cache/newscache
167 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*
168 # ... or review permissions (newscache.auth contain passwords) & effects:
169 #%%attr(640,root,news) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/newscache.auth
170 #%%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/newscache.conf
173 %defattr(644,root,root,755)
174 %attr(640,root,root) /etc/sysconfig/rc-inetd/newscache
177 %defattr(644,root,root,755)
178 %attr(754,root,root) /etc/rc.d/init.d/newscache