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