generate %ghost symlinks in %post
[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
80 %clean
81 rm -rf $RPM_BUILD_ROOT
82
83
84 %post
85 f="%confdefaultdir/vdirbase"; test -L "$f" -o -e "$f" || ln -s /vservers             "$f"
86 f="%confdefaultdir/run.rev";  test -L "$f" -o -e "$f" || ln -s /var/run/vservers.rev "$f"
87
88
89 %define v_services      httpd named portmap sendmail smb sshd xinetd
90 %post sysv
91 /sbin/chkconfig --add vservers
92 /sbin/chkconfig --add rebootmgr
93
94 for i in %v_services; do
95         /sbin/chkconfig --add v_$i
96 done
97
98
99 %preun sysv
100 test "$1" != 0 || for i in %v_services; do
101         /sbin/chkconfig --del v_$i
102 done
103
104 test "$1" != 0 || %{_initrddir}/rebootmgr stop &>/dev/null || :
105 test "$1" != 0 || /sbin/chkconfig --del rebootmgr
106 test "$1" != 0 || /sbin/chkconfig --del vservers
107
108
109 %postun sysv
110 test "$1" = 0  || %{_initrddir}/rebootmgr condrestart >/dev/null || :
111
112
113 %files
114 %defattr(-,root,root,-)
115 %doc AUTHORS COPYING ChangeLog NEWS README THANKS
116 %doc doc/FAQ.txt
117 %pkglibdir
118 %exclude %pkglibdir/distributions
119 %exclude %pkglibdir/distrib-info
120 %exclude %pkglibdir/rpm-fake.so
121 %exclude %pkglibdir/util-vserver-vars
122 %exclude %pkglibdir/vapt-get*
123 %exclude %pkglibdir/vrpm*
124 %exclude %pkglibdir/vserver-build*
125 %exclude %pkglibdir/vserver-setup*
126 %exclude %pkglibdir/vunify
127 %_sbindir/rebootmgr
128 %_sbindir/vdu
129 %_sbindir/vfiles
130 %_sbindir/vlimit
131 %_sbindir/vps
132 %_sbindir/vpstree
133 %_sbindir/vserver
134 %_sbindir/vserver-stat
135 %_sbindir/vtop
136 %_mandir/*/*
137 %exclude %_mandir/*/chbind*
138 %exclude %_mandir/*/chcontext*
139 %exclude %_mandir/*/reducecap*
140 %exclude %_mandir/*/distrib-info*
141 %exclude %_mandir/*/vserver-copy*
142 %exclude %_mandir/*/vrpm*
143
144 %dir %confdefaultdir
145 %dir %confdefaultdir/init
146 %dir %confdefaultdir/apps
147 %dir %confdefaultdir/apps/pkgmgmt
148 %dir %confdefaultdir/files
149 %ghost %confdefaultdir/vdirbase
150 %ghost %confdefaultdir/run.rev
151
152
153 %attr(000,root,root) %dir /vservers/.pkg
154 %attr(000,root,root) %dir /vservers
155
156 %dir /var/run/vservers
157 %dir /var/run/vservers.rev
158
159
160 %files core
161 %defattr(-,root,root,-)
162 %_sbindir/chbind
163 %_sbindir/chcontext
164 %_sbindir/ctx-kill
165 %_sbindir/new-namespace
166 %_sbindir/reducecap
167 %_sbindir/util-vserver-vars
168 %pkglibdir/util-vserver-vars
169 %_mandir/*/chbind*
170 %_mandir/*/chcontext*
171 %_mandir/*/reducecap*
172 %dir %pkglibdir
173
174
175 %files build
176 %defattr(-,root,root,-)
177 %_sbindir/vapt-get
178 %_sbindir/vrpm
179 %_sbindir/vserver-copy
180 %dir %pkglibdir
181 %pkglibdir/distributions
182 %pkglibdir/rpm-fake.so
183 %pkglibdir/vapt-get*
184 %pkglibdir/vrpm*
185 %pkglibdir/vserver-build*
186 %pkglibdir/vserver-setup*
187 %pkglibdir/vunify
188 %_mandir/*/distrib-info*
189 %_mandir/*/vserver-copy*
190 %exclude %_mandir/*/vrpm*
191
192 %dir %confdir/.distributions
193 %dir %confdir/.distributions/*
194 %dir %confdir/.distributions/*/apt
195 %config(noreplace) %confdir/.distributions/*/apt/sources.list
196
197
198
199 %files sysv
200 %defattr(-,root,root,-)
201 %_initrddir/*
202 %config(noreplace) %_sysconfdir/vservers.conf
203
204
205 %files devel
206 %defattr(-,root,root,-)
207 %_includedir/*.h
208 %_libdir/*.a
209 %_libdir/pkgconfig/*
210
211
212 %changelog
213 * Wed Oct  1 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.23.5-0
214 - Initial build.
215