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