]>
Commit | Line | Data |
---|---|---|
9bdf81e9 TP |
1 | Summary: OpenVZ containers control utility |
2 | Summary(pl.UTF-8): Narzędzie do zarządzania środowiskiem wirtualnym OpenVZ | |
5bce3792 | 3 | Name: vzctl |
09b5a9c8 ŁC |
4 | Version: 4.1 |
5 | Release: 1 | |
4735c335 JB |
6 | License: GPL v2+ |
7 | Group: Applications/System | |
5bce3792 | 8 | Source0: http://download.openvz.org/utils/vzctl/%{version}/src/%{name}-%{version}.tar.bz2 |
09b5a9c8 | 9 | # Source0-md5: 6cb0072890fa30864586b6033b640441 |
88d20d00 TP |
10 | Source1: pld.conf |
11 | Source2: pld-add_ip.sh | |
12 | Source3: pld-del_ip.sh | |
13 | Source4: pld-set_hostname.sh | |
14 | Source5: vz-pld.in | |
15 | Source6: vzeventd-pld.in | |
16 | Patch0: %{name}-pld.patch | |
5bce3792 | 17 | URL: http://openvz.org/ |
4735c335 JB |
18 | BuildRequires: autoconf >= 2.59 |
19 | BuildRequires: automake >= 1:1.9 | |
c2466830 | 20 | BuildRequires: libcgroup-devel >= 0.37 |
7975b809 | 21 | BuildRequires: libtool |
4735c335 | 22 | BuildRequires: libxml2-devel >= 1:2.6.16 |
c2466830 | 23 | BuildRequires: pkgconfig |
1062ae9c ŁC |
24 | BuildRequires: ploop-devel > 1.4 |
25 | Requires: ploop-libs > 1.4 | |
ee16b02c | 26 | Requires: %{name}-lib = %{version}-%{release} |
82e58e2a TP |
27 | Requires(post,preun): /sbin/chkconfig |
28 | Requires: rc-scripts | |
5bce3792 | 29 | # these reqs are for vz helper scripts |
5bce3792 SP |
30 | Requires: bash |
31 | Requires: ed | |
32 | Requires: fileutils | |
33 | Requires: gawk | |
34 | Requires: grep | |
35 | Requires: sed | |
36 | Requires: tar | |
5bce3792 | 37 | Requires: vzquota >= 2.7.0-4 |
5bce3792 | 38 | # requires for vzmigrate purposes |
cbf91aa9 TP |
39 | Suggests: gawk |
40 | Suggests: openssh | |
41 | Suggests: rsync | |
ee16b02c | 42 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
5bce3792 | 43 | |
82e58e2a TP |
44 | %define _configdir %{_sysconfdir}/vz |
45 | %define _distconfdir %{_configdir}/dists | |
46 | %define _distscriptdir %{_distconfdir}/scripts | |
47 | ||
5bce3792 | 48 | %description |
9bdf81e9 TP |
49 | This utility allows system administator to control OpenVZ containers, |
50 | i.e. create, start, shutdown, set various options and limits etc. | |
51 | ||
52 | %description -l pl.UTF-8 | |
4735c335 JB |
53 | Narzędzia vztcl pozwalają administratorowi zarządzać środowiskami |
54 | wirtualnymi (kontenerami) OpenVZ, tzn. tworzyć je, uruchamiać, | |
55 | zatrzymywać, ustawiać różne opcje i limity itp. | |
5bce3792 | 56 | |
ee16b02c | 57 | %package lib |
9bdf81e9 | 58 | Summary: OpenVZ containers control API library |
4735c335 | 59 | Summary(pl.UTF-8): Biblioteka do zarządzania kontenerami OpenVZ |
82e58e2a | 60 | Group: Libraries |
c2466830 | 61 | Requires: libcgroup >= 0.37 |
708d30f7 | 62 | Requires: libxml2 >= 1:2.6.1.6 |
ee16b02c ER |
63 | |
64 | %description lib | |
9bdf81e9 | 65 | OpenVZ containers control API library. |
ee16b02c | 66 | |
4735c335 JB |
67 | %description lib -l pl.UTF-8 |
68 | Biblioteka do zarządzania kontenerami OpenVZ | |
69 | ||
70fd0c05 ER |
70 | %package -n bash-completion-%{name} |
71 | Summary: bash-completion for vzctl | |
4735c335 | 72 | Summary(pl.UTF-8): bashowe uzupełnianie linii poleceń dla vzctl |
70fd0c05 ER |
73 | Group: Applications/Shells |
74 | Requires: bash-completion | |
75 | ||
76 | %description -n bash-completion-%{name} | |
77 | This package provides bash-completion for vzctl. | |
78 | ||
79 | %description -n bash-completion-%{name} -l pl.UTF-8 | |
4735c335 | 80 | Pakiet ten dostarcza bashowe uzupełnianie linii poleceń dla vzctl. |
70fd0c05 | 81 | |
5bce3792 SP |
82 | %prep |
83 | %setup -q | |
88d20d00 | 84 | %patch0 -p1 |
f701420a ER |
85 | cp -p %{SOURCE1} etc/dists |
86 | install -p %{SOURCE2} %{SOURCE3} %{SOURCE4} etc/dists/scripts | |
87 | install -p %{SOURCE5} %{SOURCE6} etc/init.d | |
5bce3792 SP |
88 | |
89 | %build | |
7975b809 | 90 | %{__libtoolize} |
88d20d00 | 91 | %{__aclocal} |
45139e8b | 92 | %{__autoconf} |
88d20d00 | 93 | %{__automake} |
ee16b02c | 94 | %configure \ |
4735c335 | 95 | --disable-silent-rules \ |
5bce3792 | 96 | --enable-bashcomp \ |
4735c335 | 97 | --enable-logrotate |
ee16b02c | 98 | |
7975b809 | 99 | %{__make} |
5bce3792 SP |
100 | |
101 | %install | |
102 | rm -rf $RPM_BUILD_ROOT | |
88d20d00 | 103 | install -d $RPM_BUILD_ROOT/etc/{cron.d,rc.d/init.d,sysconfig/interfaces} |
82e58e2a | 104 | |
88d20d00 TP |
105 | %{__make} install install-pld \ |
106 | vpsconfdir=/etc/sysconfig/vz-scripts \ | |
ee16b02c ER |
107 | DESTDIR=$RPM_BUILD_ROOT |
108 | ||
88d20d00 TP |
109 | %{__mv} $RPM_BUILD_ROOT/etc/init.d/vz* $RPM_BUILD_ROOT/etc/rc.d/init.d |
110 | %{__mv} $RPM_BUILD_ROOT/etc/sysconfig/{network-scripts,interfaces}/ifcfg-venet0 | |
111 | ||
5bce3792 SP |
112 | ln -s ../sysconfig/vz-scripts $RPM_BUILD_ROOT%{_configdir}/conf |
113 | ln -s ../vz/vz.conf $RPM_BUILD_ROOT/etc/sysconfig/vz | |
dfc54135 | 114 | |
82e58e2a | 115 | :> $RPM_BUILD_ROOT/etc/cron.d/vz |
5bce3792 | 116 | |
f701420a ER |
117 | # this could go to vzctl-lib-devel, but since we don't have it... |
118 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libvzctl.{la,so} | |
cbf91aa9 | 119 | |
5bce3792 SP |
120 | %clean |
121 | rm -rf $RPM_BUILD_ROOT | |
122 | ||
3bb7aa75 SP |
123 | %post |
124 | /bin/rm -rf /dev/vzctl | |
125 | /bin/mknod -m 600 /dev/vzctl c 126 0 | |
126 | if [ -f %{_configdir}/vz.conf ]; then | |
6efca13b | 127 | if ! grep -q "IPTABLES=" %{_configdir}/vz.conf 2>/dev/null; then |
3bb7aa75 SP |
128 | echo 'IPTABLES="ipt_REJECT ipt_tos ipt_limit ipt_multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_length"' >> %{_configdir}/vz.conf |
129 | fi | |
130 | fi | |
ee16b02c | 131 | /sbin/chkconfig --add vz |
82e58e2a TP |
132 | /sbin/chkconfig --add vzeventd |
133 | %service vzeventd restart "vzeventd service" | |
3bb7aa75 SP |
134 | |
135 | %preun | |
70fd0c05 | 136 | if [ "$1" = 0 ]; then |
ee16b02c | 137 | /sbin/chkconfig --del vz |
82e58e2a | 138 | /sbin/chkconfig --del vzeventd |
3bb7aa75 SP |
139 | fi |
140 | ||
dfc54135 TP |
141 | %post lib -p /sbin/ldconfig |
142 | ||
5bce3792 SP |
143 | %files |
144 | %defattr(644,root,root,755) | |
cbf91aa9 | 145 | %doc ChangeLog |
82e58e2a | 146 | %attr(640,root,root) %ghost /etc/cron.d/vz |
4735c335 JB |
147 | %attr(754,root,root) /etc/rc.d/init.d/vz |
148 | %attr(754,root,root) /etc/rc.d/init.d/vzeventd | |
82e58e2a | 149 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name} |
244ec0f2 | 150 | %dir /etc/sysconfig/network-scripts |
82e58e2a | 151 | %attr(755,root,root) /etc/sysconfig/network-scripts/if*-venet |
82e58e2a TP |
152 | %attr(640,root,root) %config(noreplace,missingok) %verify(not md5 mtime size) /etc/sysconfig/interfaces/ifcfg-venet0 |
153 | %dir /etc/sysconfig/vz-scripts | |
154 | %config(missingok) /etc/sysconfig/vz-scripts/ve-*.conf-sample | |
155 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/vz-scripts/0.conf | |
156 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/vz | |
157 | %config(noreplace) /etc/udev/rules.d/*-%{name}.rules | |
5bce3792 | 158 | %dir %{_configdir} |
5bce3792 | 159 | %dir %{_distconfdir} |
82e58e2a TP |
160 | %config(noreplace) %verify(not md5 mtime size) %{_distconfdir}/default |
161 | %config(noreplace) %{_distconfdir}/distribution.conf-template | |
88d20d00 | 162 | %config(noreplace) %{_distconfdir}/*.conf |
5bce3792 | 163 | %dir %{_distscriptdir} |
82e58e2a TP |
164 | %attr(755,root,root) %config(noreplace) %{_distscriptdir}/*.sh |
165 | %config(noreplace) %{_distscriptdir}/functions | |
166 | %{_configdir}/names | |
88d20d00 TP |
167 | %config(noreplace) %verify(not md5 mtime size) %{_configdir}/*conf |
168 | %attr(755,root,root) /sbin/ifup-local | |
4735c335 JB |
169 | %attr(755,root,root) %{_sbindir}/arpsend |
170 | %attr(755,root,root) %{_sbindir}/ndsend | |
9bdf81e9 | 171 | %attr(755,root,root) %{_sbindir}/vz* |
82e58e2a | 172 | %dir /vz |
4735c335 JB |
173 | /vz/dump |
174 | /vz/lock | |
175 | /vz/template | |
176 | %attr(700,root,root) %dir /vz/private | |
177 | %attr(700,root,root) %dir /vz/root | |
6efca13b | 178 | /var/lib/vzctl |
4735c335 JB |
179 | %{_mandir}/man5/ctid.conf.5* |
180 | %{_mandir}/man5/vz.conf.5* | |
181 | %{_mandir}/man8/arpsend.8* | |
182 | %{_mandir}/man8/ndsend.8* | |
183 | %{_mandir}/man8/vz*.8* | |
5bce3792 | 184 | |
5bce3792 SP |
185 | %files lib |
186 | %defattr(644,root,root,755) | |
187 | %attr(755,root,root) %{_libdir}/libvzctl-*.so | |
dfc54135 | 188 | %attr(755,root,root) %{_libdir}/vzctl |
70fd0c05 ER |
189 | |
190 | %files -n bash-completion-%{name} | |
191 | %defattr(644,root,root,755) | |
192 | /etc/bash_completion.d/%{name}.sh |