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