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