1 # TODO: - review i and tests (especially .inet).
2 # - review permissions for newscache.auth
7 Summary(pl.UTF-8): 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 Patch2: %{name}-info.patch
22 URL: http://www.linuxhacker.at/newscache/
23 BuildRequires: autoconf
24 BuildRequires: automake
25 BuildRequires: libwrap-devel
26 BuildRequires: rpmbuild(macros) >= 1.268
27 BuildRequires: socket++-devel
28 Requires(post,preun): /sbin/chkconfig
29 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31 %define _sysconfdir /etc/%{name}
34 NewsCache is a free cache server for USENET News. NewsCache acts to
35 news reading clients like a news server, except that it stores only
36 those articles that have been requested by at least one client.
37 NewsCache targets problems of the current News System like network
38 bandwidth consumption or the IO load caused by news clients.
40 %description -l pl.UTF-8
41 NewsCache to wolnodostępny serwer keszujący dla sieci USENET.
42 NewsCache jest widziany jako serwer nntp, ale przechowuje tylko te
43 artykuły, o które pytał choć jeden klient. NewsCache rozwiązuje
44 problemy takie jak zajmowanie pasma czy obciążenie systemu We/Wy
45 spowodowane obsługą klientów news.
48 Summary: NewsCache standalone mode
49 Summary(pl.UTF-8): NewsCache w trybie samodzielnym
50 Group: Applications/News
51 Requires: %{name} = %{version}-%{release}
53 Obsoletes: NewsCache-inetd
55 %description standalone
56 Run NewsCache in the standalone mode.
58 %description standalone -l pl.UTF-8
59 Uruchamia NewsCache w trybie samodzielnym.
62 Summary: NewsCache inetd mode
63 Summary(pl.UTF-8): NewsCache w trybie inetd
64 Group: Applications/News
65 Requires: %{name} = %{version}-%{release}
67 Obsoletes: NewsCache-standalone
70 Run NewsCache from the inetd.
72 %description inetd -l pl.UTF-8
73 Uruchamia NewsCache pod konrolą inetd.
76 %setup -q -n %{name}-%{version}%{_rc}
90 rm -rf $RPM_BUILD_ROOT
92 install -d $RPM_BUILD_ROOT/var/cache/newscache
94 DESTDIR=$RPM_BUILD_ROOT
96 install -D %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/newscache
97 install -D %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/newscache
98 mv -f $RPM_BUILD_ROOT%{_sysconfdir}/newscache.auth{-dist,}
99 mv -f $RPM_BUILD_ROOT%{_sysconfdir}/newscache.conf{-dist,}
102 rm -rf $RPM_BUILD_ROOT
105 %groupadd -g 152 newscache
106 %useradd -u 152 -d /var/cache/newscache -s /bin/false -c "NewsCache User" -g newscache newscache
109 if [ "$1" = "0" ]; then
110 %userremove newscache
111 %groupremove newscache
114 %triggerun -- %{name} < 1.2
115 if [ "$1" -ge "2" -a "$2" = "1" ] ; then
116 echo '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
117 %{name} works now with newscache user and group - making:
118 1. appropriate changes in your %{_sysconfdir}/newscache.conf ...'
120 %{__sed} -i -e 's@\(Username\)\s\+news@\1 newscache@' %{_sysconfdir}/newscache.conf
121 %{__sed} -i -e 's@\(Groupname\)\s\+news@\1 newscache@' %{_sysconfdir}/newscache.conf
123 echo '2. setting new, correct owner and group for /var/cache/newscache ...'
125 %{__chown} -R newscache:newscache /var/cache/newscache
128 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
132 /sbin/chkconfig --add newscache
133 %service newscache restart "NewsCache daemon"
136 if [ "$1" = "0" ]; then
137 %service newscache stop
138 /sbin/chkconfig --del newscache
142 %service -q rc-inetd reload
145 if [ "$1" = "0" ]; then
146 %service -q rc-inetd reload
150 %defattr(644,root,root,755)
151 %doc AUTHORS ChangeLog NEWS README THANKS TODO
152 %doc %{_infodir}/*.info*
153 %attr(755,root,root) %{_bindir}/*
154 %attr(755,root,root) %{_sbindir}/*
156 %dir %attr(755,newscache,newscache) /var/cache/newscache
158 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*
159 # ... or review permissions (newscache.auth contain passwords) & effects:
160 #%%attr(640,root,news) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/newscache.auth
161 #%%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/newscache.conf
164 %defattr(644,root,root,755)
165 %attr(640,root,root) /etc/sysconfig/rc-inetd/newscache
168 %defattr(644,root,root,755)
169 %attr(754,root,root) /etc/rc.d/init.d/newscache