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