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