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