]> git.pld-linux.org Git - packages/NewsCache.git/blob - NewsCache.spec
- package only info files from %{_infodir} (do not package %{_infodir}/dir)
[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.UTF-8):      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 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)
30
31 %define         _sysconfdir     /etc/%{name}
32
33 %description
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.
39
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.
46
47 %package standalone
48 Summary:        NewsCache standalone mode
49 Summary(pl.UTF-8):      NewsCache w trybie samodzielnym
50 Group:          Applications/News
51 Requires:       %{name} = %{version}-%{release}
52 Requires:       rc-scripts
53 Obsoletes:      NewsCache-inetd
54
55 %description standalone
56 Run NewsCache in the standalone mode.
57
58 %description standalone -l pl.UTF-8
59 Uruchamia NewsCache w trybie samodzielnym.
60
61 %package inetd
62 Summary:        NewsCache inetd mode
63 Summary(pl.UTF-8):      NewsCache w trybie inetd
64 Group:          Applications/News
65 Requires:       %{name} = %{version}-%{release}
66 Requires:       rc-inetd
67 Obsoletes:      NewsCache-standalone
68
69 %description inetd
70 Run NewsCache from the inetd.
71
72 %description inetd -l pl.UTF-8
73 Uruchamia NewsCache pod konrolą inetd.
74
75 %prep
76 %setup -q -n %{name}-%{version}%{_rc}
77 %patch0 -p0
78 %patch1 -p1
79 %patch2 -p1
80
81 %build
82 %{__aclocal}
83 %{__autoconf}
84 %{__autoheader}
85 %{__automake}
86 %configure
87 %{__make}
88
89 %install
90 rm -rf $RPM_BUILD_ROOT
91
92 install -d $RPM_BUILD_ROOT/var/cache/newscache
93 %{__make} install \
94         DESTDIR=$RPM_BUILD_ROOT
95
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,}
100
101 %clean
102 rm -rf $RPM_BUILD_ROOT
103
104 %pre
105 %groupadd -g 152 newscache
106 %useradd -u 152 -d /var/cache/newscache -s /bin/false -c "NewsCache User" -g newscache newscache
107
108 %postun
109 if [ "$1" = "0" ]; then
110         %userremove newscache
111         %groupremove newscache
112 fi
113
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 ...'
119
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
122
123 echo '2. setting new, correct owner and group for /var/cache/newscache ...'
124
125 %{__chown} -R newscache:newscache /var/cache/newscache
126
127 echo 'Done.
128 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
129 fi
130
131 %post standalone
132 /sbin/chkconfig --add newscache
133 %service newscache restart "NewsCache daemon"
134
135 %preun standalone
136 if [ "$1" = "0" ]; then
137         %service newscache stop
138         /sbin/chkconfig --del newscache
139 fi
140
141 %post inetd
142 %service -q rc-inetd reload
143
144 %postun inetd
145 if [ "$1" = "0" ]; then
146         %service -q rc-inetd reload
147 fi
148
149 %files
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}/*
155 %{_mandir}/man?/*
156 %dir %attr(755,newscache,newscache) /var/cache/newscache
157 %dir %{_sysconfdir}
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
162
163 %files inetd
164 %defattr(644,root,root,755)
165 %attr(640,root,root) /etc/sysconfig/rc-inetd/newscache
166
167 %files standalone
168 %defattr(644,root,root,755)
169 %attr(754,root,root) /etc/rc.d/init.d/newscache
This page took 0.070681 seconds and 3 git commands to generate.