f1171bacd25b8ef314c39758fbeb912aed3d2681
[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
8 Summary:        Linux virtual server utilities
9 Name:           @PACKAGE@
10 Version:        @VERSION@
11 Release:        0
12 Epoch:          0
13 License:        GPL
14 Group:          System Environment/Base
15 URL:            http://savannah.nongnu.org/projects/util-vserver/
16 Source0:        http://savannah.nongnu.org/download/util-vserver/stable.pkg/%version/%name-%version.tar.bz2
17 BuildRoot:      %_tmppath/%name-%version-%release-root
18 Requires:       init(@PACKAGE@)
19 Requires:       %name-core = %epoch:%version-%release
20 Provides:       vserver = %epoch:%version-%release
21 Obsoletes:      vserver < %epoch:%version
22 BuildRequires:  mount vconfig gawk iproute
23 BuildRequires:  gcc-c++ wget
24 BuildRequires:  e2fsprogs-devel
25 Requires(post): %__chattr
26 %{!?_without_dietlibc:BuildRequires:    dietlibc >= 0:0.22}
27
28 %package core
29 Summary:        The core-utilities for util-vserver
30 Group:          Applications/System
31
32 %package build
33 Summary:        Tools which can be used to build vservers
34 Group:          Applications/System
35 Requires:       %name = %epoch:%version-%release
36 Requires:       rpm apt wget binutils tar
37
38 %package sysv
39 Summary:        SysV-initscripts for vserver
40 Group:          System Environment/Base
41 Provides:       init(@PACKAGE@)
42 Requires:       %name = %epoch:%version-%release
43 Requires:       initscripts
44
45 %package legacy
46 Summary:        Legacy utilities for util-vserver
47 Group:          Applications/System
48 Requires:       %name = %epoch:%version-%release
49
50 %package devel
51 Summary:        Header-files and libraries which are needed to develop vserver based applications
52 Group:          Development/Libraries
53 Requires:       pkgconfig
54
55
56 %description
57 This package provides the components and a framework to setup virtual
58 servers.  A virtual server runs inside a linux server. It is nevertheless
59 highly independent. As such, you can run various services with normal
60 configuration. The various vservers can't interact with each other and
61 can't interact with services in the main server.
62
63 This requires a special kernel supporting the new new_s_context and
64 set_ipv4root system call.
65
66 %description core
67 %description build
68 %description sysv
69 %description legacy
70 %description devel
71
72
73 %prep
74 %setup -q
75
76
77 %build
78 %configure --with-initrddir=%_initrddir --enable-release \
79            %{?_without_dietlibc:--disable-dietlibc}
80 %__make %{?_smp_mflags}
81
82
83 %install
84 rm -rf $RPM_BUILD_ROOT
85 %__make DESTDIR="$RPM_BUILD_ROOT" install install-vserverdir
86
87 rm -f $RPM_BUILD_ROOT/%_libdir/*.la
88
89 contrib/make-manifest %name $RPM_BUILD_ROOT contrib/manifest.dat
90
91
92 %clean
93 rm -rf $RPM_BUILD_ROOT
94
95
96 %post
97 f="%confdefaultdir/vdirbase"; test -L "$f" -o -e "$f" || ln -s /vservers             "$f"
98 f="%confdefaultdir/run.rev";  test -L "$f" -o -e "$f" || ln -s /var/run/vservers.rev "$f"
99
100
101 %define v_services      httpd named portmap sendmail smb sshd xinetd
102 %post sysv
103 /sbin/chkconfig --add vservers
104 /sbin/chkconfig --add rebootmgr
105
106 for i in %v_services; do
107         /sbin/chkconfig --add v_$i
108 done
109
110 %__chattr +t /vservers || :
111
112
113 %preun sysv
114 test "$1" != 0 || for i in %v_services; do
115         /sbin/chkconfig --del v_$i
116 done
117
118 test "$1" != 0 || %{_initrddir}/rebootmgr stop &>/dev/null || :
119 test "$1" != 0 || /sbin/chkconfig --del rebootmgr
120 test "$1" != 0 || /sbin/chkconfig --del vservers
121
122
123 %postun sysv
124 test "$1" = 0  || %{_initrddir}/rebootmgr condrestart >/dev/null || :
125
126
127 %post   core -p /sbin/ldconfig
128 %postun core -p /sbin/ldconfig
129
130
131 %files -f %name-base.list
132 %defattr(-,root,root,-)
133 %doc AUTHORS COPYING ChangeLog NEWS README THANKS
134 %doc doc/FAQ.txt
135 %dir %pkglibdir
136 %dir %confdefaultdir
137 %dir %confdefaultdir/init
138 %dir %confdefaultdir/apps
139 %dir %confdefaultdir/apps/pkgmgmt
140 %dir %confdefaultdir/files
141 %ghost %confdefaultdir/vdirbase
142 %ghost %confdefaultdir/run.rev
143
144 %attr(000,root,root) %dir /vservers/.pkg
145 %attr(000,root,root) %dir /vservers
146
147 %dir /var/run/vservers
148 %dir /var/run/vservers.rev
149
150
151 %files core -f %name-core.list
152 %defattr(-,root,root,-)
153 %dir %pkglibdir
154
155
156 %files build -f %name-build.list
157 %defattr(-,root,root,-)
158 %dir %pkglibdir
159 %dir %confdir/.distributions
160 %dir %confdir/.distributions/*
161 %dir %confdir/.distributions/*/apt
162 %config(noreplace) %confdir/.distributions/*/apt/sources.list
163
164 %exclude %_mandir/*/vrpm*
165
166
167 %files legacy -f %name-legacy.list
168 %defattr(-,root,root,-)
169 %dir %pkglibdir/legacy
170
171
172 %files sysv
173 %defattr(-,root,root,-)
174 %config %_initrddir/*
175 %config(noreplace) %_sysconfdir/vservers.conf
176
177
178 %files devel -f %name-devel.list
179 %defattr(-,root,root,-)
180
181
182 %changelog
183 * Wed Oct  1 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.23.5-0
184 - Initial build.
185