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