added chain-echo
[util-vserver.git] / util-vserver / util-vserver.spec.in
1 # $Id$
2
3 %define confdir         %_sysconfdir/vservers
4 %define confdefaultdir  %confdir/.defaults
5 %define pkglibdir       %_libdir/%name
6 %define __chattr        /usr/bin/chattr
7 %define chkconfig       /sbin/chkconfig
8
9 Summary:        Linux virtual server utilities
10 Name:           @PACKAGE@
11 Version:        @VERSION@
12 Release:        0
13 Epoch:          0
14 License:        GPL
15 Group:          System Environment/Base
16 URL:            http://savannah.nongnu.org/projects/util-vserver/
17 Source0:        http://savannah.nongnu.org/download/util-vserver/stable.pkg/%version/%name-%version.tar.bz2
18 BuildRoot:      %_tmppath/%name-%version-%release-root
19 Requires:       init(@PACKAGE@)
20 Requires:       %name-core = %epoch:%version-%release
21 Requires:       %name-lib  = %epoch:%version-%release
22 Requires:       diffutils mktemp sed
23 Provides:       vserver = %epoch:%version-%release
24 Obsoletes:      vserver < %epoch:%version
25 BuildRequires:  mount vconfig gawk iproute
26 BuildRequires:  gcc-c++ wget
27 BuildRequires:  e2fsprogs-devel
28 BuildRequires:  doxygen tetex-latex libxslt
29 Requires(post):         %__chattr
30 Requires(pre):          %pkglibdir
31 Requires(postun):       %pkglibdir
32 %{!?_without_dietlibc:BuildRequires:    dietlibc >= 0:0.24}
33
34 %package lib
35 Summary:                Dynamic libraries for util-vserver
36 Group:                  System Environment/Libraries
37
38 %package core
39 Summary:                The core-utilities for util-vserver
40 Group:                  Applications/System
41 Requires:               util-linux
42
43 %package build
44 Summary:                Tools which can be used to build vservers
45 Group:                  Applications/System
46 Requires:               rpm apt wget binutils tar e2fsprogs
47 Requires:               %name = %epoch:%version-%release
48 Requires(pre):          %confdir
49 Requires(postun):       %confdir
50
51 %package sysv
52 Summary:                SysV-initscripts for vserver
53 Group:                  System Environment/Base
54 Provides:               init(@PACKAGE@)
55 Requires:               make diffutils
56 Requires:               initscripts
57 Requires:               %name = %epoch:%version-%release
58 Requires(post):         %chkconfig
59 Requires(preun):        %chkconfig
60 Requires(pre):          %_initrddir %pkglibdir
61 requires(postun):       %_initrddir %pkglibdir
62
63 %package legacy
64 Summary:                Legacy utilities for util-vserver
65 Group:                  Applications/System
66 Requires:               %name = %epoch:%version-%release
67 Requires(post):         %chkconfig
68 Requires(preun):        %chkconfig
69 Requires(pre):          %_initrddir %pkglibdir
70 requires(postun):       %_initrddir %pkglibdir
71
72 %package devel
73 Summary:                Header-files and libraries which are needed to develop vserver based applications
74 Group:                  Development/Libraries
75 Requires:               pkgconfig
76
77
78 %description
79 This package provides the components and a framework to setup virtual
80 servers.  A virtual server runs inside a linux server. It is nevertheless
81 highly independent. As such, you can run various services with normal
82 configuration. The various vservers can't interact with each other and
83 can't interact with services in the main server.
84
85 This requires a special kernel supporting the new new_s_context and
86 set_ipv4root system call.
87
88 %description lib
89 %description core
90 %description build
91 %description sysv
92 %description legacy
93 %description devel
94
95
96 %prep
97 %setup -q
98
99
100 %build
101 %configure --with-initrddir=%_initrddir --enable-release \
102            %{?_without_dietlibc:--disable-dietlibc}
103
104 %__make %{?_smp_mflags} all
105 %__make %{?_smp_mflags} doc
106
107
108 %install
109 rm -rf $RPM_BUILD_ROOT
110 %__make DESTDIR="$RPM_BUILD_ROOT" install install-distribution
111
112 rm -f $RPM_BUILD_ROOT/%_libdir/*.la
113
114 contrib/make-manifest %name $RPM_BUILD_ROOT contrib/manifest.dat
115
116
117 %check || :
118 %__make check
119
120
121 %clean
122 rm -rf $RPM_BUILD_ROOT
123
124
125 %post
126 f="%confdefaultdir/vdirbase"; test -L "$f" -o -e "$f" || ln -s /vservers             "$f"
127 f="%confdefaultdir/run.rev";  test -L "$f" -o -e "$f" || ln -s /var/run/vservers.rev "$f"
128
129 %__chattr +t /vservers || :
130
131
132 %define v_services      httpd named portmap sendmail smb sshd xinetd gated
133 %post sysv
134 %chkconfig --add vservers-default
135 %chkconfig --add vprocunhide
136
137 for i in %v_services; do
138         %chkconfig --add v_$i
139 done
140
141
142 %preun sysv
143 test "$1" != 0 || for i in %v_services; do
144         %chkconfig --del v_$i
145 done
146
147 test "$1" != 0 || %_initrddir/vprocunhide stop &>/dev/null || :
148
149 test "$1" != 0 || %chkconfig --del vprocunhide
150 test "$1" != 0 || %chkconfig --del vservers-default
151
152
153 %postun sysv
154 test "$1" = 0  || %_initrddir/vprocunhide condrestart >/dev/null || :
155
156
157 %post   lib -p /sbin/ldconfig
158 %postun lib -p /sbin/ldconfig
159
160
161 %post legacy
162 %chkconfig --add rebootmgr
163 %chkconfig --add vservers-legacy
164
165 %preun legacy
166 test "$1" != 0 || %_initrddir/rebootmgr   stop &>/dev/null || :
167
168 test "$1" != 0 || %chkconfig --del rebootmgr
169 test "$1" != 0 || %chkconfig --del vservers-legacy
170
171 %postun legacy
172 test "$1" = 0  || %_initrddir/rebootmgr   condrestart >/dev/null || :
173
174
175 %files -f %name-base.list
176 %defattr(-,root,root,-)
177 %doc AUTHORS COPYING ChangeLog NEWS README THANKS
178 %doc doc/FAQ.txt
179 %doc doc/*.html doc/*.css
180 /sbin/vshelper
181 %dir %confdir
182 %dir %confdefaultdir
183 %dir %confdefaultdir/apps
184 %dir %confdefaultdir/files
185 %dir %pkglibdir/defaults
186 %ghost %confdefaultdir/vdirbase
187 %ghost %confdefaultdir/run.rev
188
189 %attr(000,root,root) %dir /vservers/.pkg
190 %attr(000,root,root) %dir /vservers
191
192 %dir /var/run/vservers
193 %dir /var/run/vservers.rev
194 %dir /var/run/vshelper
195
196
197 %files lib -f %name-lib.list
198 %files sysv -f %name-sysv.list
199
200
201 %files core -f %name-core.list
202 %defattr(-,root,root,-)
203 %dir %pkglibdir
204
205
206 %files build -f %name-build.list
207 %defattr(-,root,root,-)
208 %dir %confdir/.distributions
209 %dir %confdir/.distributions/*
210 %dir %confdir/.distributions/*/apt
211 %config(noreplace) %confdir/.distributions/*/apt/sources.list
212
213
214 %files legacy -f %name-legacy.list
215 %defattr(-,root,root,-)
216 %dir %pkglibdir/legacy
217 %config(noreplace) %_sysconfdir/vservers.conf
218
219
220 %files devel -f %name-devel.list
221 %defattr(-,root,root,-)
222 %doc lib/apidoc/latex/refman.pdf
223 %doc lib/apidoc/html
224
225
226 %changelog
227 * Mon Mar 15 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.202-0
228 - use file-list for sysv scripts also
229
230 * Sat Mar  6 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.198-0
231 - added vprocunhide-service support
232 - added doxygen support
233 - updated Requires:
234
235 * Wed Oct  1 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.23.5-0
236 - Initial build.