]> git.pld-linux.org Git - packages/NewsCache.git/blob - NewsCache.spec
- fixes for info page taken from
[packages/NewsCache.git] / NewsCache.spec
1 # TODO: - review i and tests (especially .inet).
2 #       - review permissions for newscache.auth
3 #
4 %define         _rc     rc6
5 %define         _rel    0.1
6 Summary:        News Cache
7 Summary(pl):    nisza dla newsów
8 Name:           NewsCache
9 Version:        1.2
10 Release:        0.%{_rc}.%{_rel}
11 Epoch:          0
12 License:        GPL
13 Group:          Applications/News
14 Source0:        http://www.linuxhacker.at/linux/downloads/src/%{name}-%{version}%{_rc}.tar.gz
15 # Source0-md5:  a7b33314cd7701564b4947ab8615dcc2
16 Source1:        %{name}.init
17 Source2:        %{name}.inet
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)
29
30 %define         _sysconfdir     /etc/%{name}
31
32 %description
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.
38
39 %description -l pl
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.
45
46 %package standalone
47 Summary:        NewsCache standalone mode
48 Summary(pl):    NewsCache w trybie samodzielnym
49 Group:          Applications/News
50 PreReq:         rc-scripts
51 Requires:       %{name} = %{version}-%{release}
52 Obsoletes:      %{name}-inetd
53
54 %description standalone
55 Run NewsCache in the standalone mode.
56
57 %description standalone -l pl
58 Uruchamia NewsCache w trybie samodzielnym.
59
60 %package inetd
61 Summary:        NewsCache inetd mode
62 Summary(pl):    NewsCache w trybie inetd
63 Group:          Applications/News
64 Requires:       %{name} = %{version}-%{release}
65 Requires:       rc-inetd
66 Obsoletes:      %{name}-standalone
67
68 %description inetd
69 Run NewsCache from the inetd.
70
71 %description inetd -l pl
72 Uruchamia NewsCache pod konrol± inetd.
73
74 %prep
75 %setup -q -n %{name}-%{version}%{_rc}
76 %patch0 -p0
77 %patch1 -p1
78
79 %build
80 %{__aclocal}
81 %{__autoconf}
82 %{__autoheader}
83 %{__automake}
84 %configure
85 %{__make}
86
87 %install
88 rm -rf $RPM_BUILD_ROOT
89
90 install -d $RPM_BUILD_ROOT/var/cache/newscache
91 %{__make} install \
92         DESTDIR=$RPM_BUILD_ROOT
93
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,}
98
99 %clean
100 rm -rf $RPM_BUILD_ROOT
101
102 %pre
103 %groupadd -g 152 newscache
104 %useradd -u 152 -d /var/cache/newscache -s /bin/false -c "NewsCache User" -g newscache newscache
105
106 %postun
107 if [ "$1" = "0" ]; then
108         %userremove newscache
109         %groupremove newscache
110 fi
111
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 ...'
118
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
121
122 echo '2. setting new, correct owner and group for /var/cache/newscache ...'
123
124 %{__chown} -R newscache:newscache /var/cache/newscache
125
126 echo 'Done.
127 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
128 fi
129
130 %post standalone
131 /sbin/chkconfig --add newscache
132 if [ -f /var/lock/subsys/newscache ]; then
133         /etc/rc.d/init.d/newscache restart 1>&2
134 else
135         echo "Run \"/etc/rc.d/init.d/newscache start\" to start NewsCache daemon."
136 fi
137
138 %preun standalone
139 if [ "$1" = "0" ]; then
140         if [ -f /var/lock/subsys/newscache ]; then
141                 /etc/rc.d/init.d/newscache stop 1>&2
142         fi
143         /sbin/chkconfig --del newscache
144 fi
145
146 %post inetd
147 if [ -f /var/lock/subsys/rc-inetd ]; then
148         /etc/rc.d/init.d/rc-inetd restart 1>&2
149 else
150         echo "Type \"/etc/rc.d/init.d/rc-inetd start\" to start NewsCache from inet server" 1>&2
151 fi
152
153 %postun inetd
154 if [ "$1" = "0" -a -f /var/lock/subsys/rc-inetd ]; then
155         /etc/rc.d/init.d/rc-inetd reload 1>&2
156 fi
157
158 %files
159 %defattr(644,root,root,755)
160 %doc AUTHORS ChangeLog NEWS README THANKS TODO
161 %doc %{_infodir}/*
162 %attr(755,root,root) %{_bindir}/*
163 %attr(755,root,root) %{_sbindir}/*
164 %{_mandir}/man?/*
165 %dir %attr(755,newscache,newscache) /var/cache/newscache
166 %dir %{_sysconfdir}
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
171
172 %files inetd
173 %defattr(644,root,root,755)
174 %attr(640,root,root) /etc/sysconfig/rc-inetd/newscache
175
176 %files standalone
177 %defattr(644,root,root,755)
178 %attr(754,root,root) /etc/rc.d/init.d/newscache
This page took 0.091835 seconds and 3 git commands to generate.