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