use chroot() instead of vc_chrootsafe()
[util-vserver.git] / util-vserver / util-vserver.spec.in
1 Summary:        Linux virtual server utilities
2 Name:           @PACKAGE@
3 Version:        @VERSION@
4 Release:        0
5 Epoch:          0
6 Copyright:      GPL
7 Group:          System Environment/Base
8 URL:            http://savannah.nongnu.org/projects/util-vserver/
9 Source0:        http://savannah.nongnu.org/download/util-vserver/stable.pkg/%version/%name-%version.tar.bz2
10 Provides:       %name-devel = %epoch:%version-%release
11 BuildRoot:      %_tmppath/%name-%version-%release-root
12 Provides:       vserver = %epoch:%version-%release
13 Conflicts:      vserver < %epoch:%version-%release
14 Conflicts:      vserver > %epoch:%version-%release
15 BuildRequires:  e2fsprogs-devel
16
17 %package linuxconf
18 Summary:        Linuxconf administration modules for vservers
19 Group:          Applications/System
20 Requires:       %name = %epoch:%version-%release
21 Provides:       vserver-admin = %epoch:%version-%release
22 Conflicts:      vserver-admin < %epoch:%version-%release
23 Conflicts:      vserver-admin > %epoch:%version-%release
24
25 %description
26 This package provides the components and a framework to setup virtual
27 servers.  A virtual server runs inside a linux server. It is nevertheless
28 highly independent. As such, you can run various services with normal
29 configuration. The various vservers can't interact with each other and
30 can't interact with services in the main server.
31
32 This requires a special kernel supporting the new new_s_context and
33 set_ipv4root system call.
34
35
36 %description linuxconf
37 This package provides the components to setup virtual servers with
38 linuxconf.
39
40
41 %prep
42 %setup -q
43
44
45 %build
46 %configure --enable-linuxconf
47 %__make %{?_smp_mflags}
48
49
50 %install
51 rm -rf $RPM_BUILD_ROOT
52 %__make DESTDIR=$RPM_BUILD_ROOT install
53
54 mkdir -p $RPM_BUILD_ROOT/vservers
55 test "%_initrddir" = %_sysconfdir/init.d || {
56         mkdir -p ${RPM_BUILD_ROOT}%_initrddir
57         mv ${RPM_BUILD_ROOT}%_sysconfdir/init.d/* ${RPM_BUILD_ROOT}%_initrddir/
58 }
59
60
61 %clean
62 rm -rf $RPM_BUILD_ROOT
63
64
65 %define v_services      httpd named portmap sendmail smb sshd xinetd
66 %post
67 /sbin/chkconfig --add vservers
68 /sbin/chkconfig --add rebootmgr
69
70 for i in %v_services; do
71         /sbin/chkconfig --add v_$i
72 done
73
74
75 %preun
76 test "$1" != 0 || for i in %v_services; do
77         /sbin/chkconfig --del v_$i
78 done
79
80 test "$1" != 0 || %{_initrddir}/rebootmgr stop &>/dev/null || :
81 test "$1" != 0 || /sbin/chkconfig --del rebootmgr
82 test "$1" != 0 || /sbin/chkconfig --del vservers
83
84
85 %postun
86 test "$1" = 0  || %{_initrddir}/rebootmgr condrestart >/dev/null || :
87
88
89 %files
90 %defattr(-,root,root)
91 %doc AUTHORS COPYING ChangeLog NEWS README THANKS
92 %doc doc/FAQ.txt
93 %_sbindir/*
94 %_libdir/%name
95 %_includedir/vserver.h
96 %_libdir/libvserver.a
97 %_mandir/man8/*
98 %config %_initrddir/*
99 %config(noreplace) /etc/vservers.conf
100 %attr(0,root,root) %dir /vservers
101
102 %exclude %_sbindir/newvserver
103 %exclude %_mandir/man8/newvserver*
104
105
106 %files linuxconf
107 %defattr(-,root,root)
108 %config(noreplace) /etc/vservers/newvserver.defaults
109 %_sbindir/newvserver
110 %_mandir/man8/newvserver*
111
112
113 %changelog
114
115 * Fri Sep 26 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.23.4-1
116 - initial build.