- since dynamic libraries will be installed now, call /sbin/ldconfig
[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/vtop
143 %_mandir/*/*
144 %exclude %_mandir/*/chbind*
145 %exclude %_mandir/*/chcontext*
146 %exclude %_mandir/*/reducecap*
147 %exclude %_mandir/*/distrib-info*
148 %exclude %_mandir/*/vserver-copy*
149 %exclude %_mandir/*/vrpm*
150
151 %dir %confdefaultdir
152 %dir %confdefaultdir/init
153 %dir %confdefaultdir/apps
154 %dir %confdefaultdir/apps/pkgmgmt
155 %dir %confdefaultdir/files
156 %ghost %confdefaultdir/vdirbase
157 %ghost %confdefaultdir/run.rev
158
159
160 %attr(000,root,root) %dir /vservers/.pkg
161 %attr(000,root,root) %dir /vservers
162
163 %dir /var/run/vservers
164 %dir /var/run/vservers.rev
165
166
167 %files core
168 %defattr(-,root,root,-)
169 %_libdir/*.so.*
170 %_sbindir/chbind
171 %_sbindir/chcontext
172 %_sbindir/new-namespace
173 %_sbindir/reducecap
174 %_sbindir/vkill
175 %_sbindir/util-vserver-vars
176 %pkglibdir/util-vserver-vars
177 %_mandir/*/chbind*
178 %_mandir/*/chcontext*
179 %_mandir/*/reducecap*
180 %dir %pkglibdir
181
182
183 %files build
184 %defattr(-,root,root,-)
185 %_sbindir/vapt-get
186 %_sbindir/vrpm
187 %_sbindir/vserver-copy
188 %dir %pkglibdir
189 %pkglibdir/distributions
190 %pkglibdir/rpm-fake.so
191 %pkglibdir/vapt-get*
192 %pkglibdir/vrpm*
193 %pkglibdir/vserver-build*
194 %pkglibdir/vserver-setup*
195 %pkglibdir/vunify
196 %_mandir/*/distrib-info*
197 %_mandir/*/vserver-copy*
198 %exclude %_mandir/*/vrpm*
199
200 %dir %confdir/.distributions
201 %dir %confdir/.distributions/*
202 %dir %confdir/.distributions/*/apt
203 %config(noreplace) %confdir/.distributions/*/apt/sources.list
204
205
206
207 %files sysv
208 %defattr(-,root,root,-)
209 %_initrddir/*
210 %config(noreplace) %_sysconfdir/vservers.conf
211
212
213 %files devel
214 %defattr(-,root,root,-)
215 %_includedir/*.h
216 %_libdir/*.a
217 %_libdir/*.so
218 %_libdir/pkgconfig/*
219
220
221 %changelog
222 * Wed Oct  1 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.23.5-0
223 - Initial build.
224