Пакет ve-build-scripts: Specfile

%define veuser _vebuilder
%define vegroup _vebuilder

Name: ve-build-scripts
Version: 0.0.2
Release: alt1.M40.2

Summary: scripts to build VEs
Group: Development/Other
License: GPL

Source: %name-%version.tar

BuildArch: noarch

Prereq: hasher-priv

Requires: spt >= 0.6.0-alt10.2.1
Requires: vzctl spt-profiles-ovz

Packager: L.A. Kostis <lakostis@altlinux.org>

%description
This package contains scripts used to build containers.
Currently only OpenVZ VEs are supported.

%prep
%setup

%install
#build directories
mkdir -p %buildroot%_localstatedir/vz/template/{logs,tmp}

#utils
mkdir -p %buildroot%_sbindir
for i in scripts/*; do
	cp -af $i %buildroot%_sbindir/
done

#config samples
mkdir -p %buildroot%_sysconfdir/vz/conf
cp -ar conf/*-sample %buildroot%_sysconfdir/vz/conf/


%pre
%_sbindir/groupadd -r -f %vegroup
%_sbindir/useradd -r -g %vegroup -G _vzctl -d %_localstatedir/vz/template \
	-s /dev/null -n %veuser > /dev/null 2>&1
if ! getent group hashman |cut -d: -f4 |tr , '\n' |fgrep -qsx %veuser; then
	hasher-useradd %veuser
fi

%files
%dir %attr(0750,%veuser,%vegroup) %_localstatedir/vz/template/logs
%dir %attr(0750,%veuser,%vegroup) %_localstatedir/vz/template/tmp

%_sbindir/*
%_sysconfdir/vz/conf/*-sample

%changelog
* Tue Sep 09 2008 Eugene Prokopiev <enp@altlinux.ru> 0.0.2-alt1.M40.2
- backport to M40

* Fri Mar 07 2008 Stanislav Ievlev <inger@altlinux.org> 0.0.2-alt2
- build for Sisyphus

* Tue Jan 29 2008 Michael Shigorin <mike@altlinux.org> 0.0.2-alt1.2
- tightened spt version requirement

* Tue Jan 29 2008 Michael Shigorin <mike@altlinux.org> 0.0.2-alt1.1
- implemented compression level support (requires spt >= 0.6.0-alt10.2.1),
  image type choice (requires spt >= 0.6.0-alt10); fixes #11343
- default gzip compression level set to 6 (gzip default overridden in spt)

* Fri Apr 13 2007 Konstantin A. Lepikhov <lakostis@altlinux.org> 0.0.2-alt1
- 0.0.2.
- added scripts: copy apt config from HN to VE (tnx legion@ for script example).

* Fri Mar 23 2007 L.A. Kostis <lakostis@altlinux.ru> 0.0.1-alt2.1
- fix TMPDIR (2th try).

* Tue Mar 20 2007 Konstantin A. Lepikhov <lakostis@altlinux.org> 0.0.1-alt2
- fix missing options.
- TMPDIR handling.

* Fri Mar 09 2007 Konstantin A. Lepikhov <lakostis@altlinux.org> 0.0.1-alt1
- remove hacks with hasher-priv.

* Tue Feb 27 2007 Stanislav Ievlev <inger@altlinux.org> 0.0.1-alt0.8
- go to sisyphus

* Thu Feb 22 2007 L.A. Kostis <lakostis@altlinux.ru> 0.0.1-alt0.7
- remove profiles (relocated to spt-profiles-ovz).
- remove /proc hacks.

* Wed Feb 21 2007 L.A. Kostis <lakostis@altlinux.ru> 0.0.1-alt0.6
- add OSTEMPLATE to profiles.
- remove password disable for root.

* Wed Feb 21 2007 L.A. Kostis <lakostis@altlinux.ru> 0.0.1-alt0.5
- add /proc to allowed_mountpoints.

* Wed Feb 21 2007 Stanislav Ievlev <inger@altlinux.org> 0.0.1-alt0.4
- add user _vebuilder into a _vzctl group

* Wed Feb 21 2007 L.A. Kostis <lakostis@altlinux.ru> 0.0.1-alt0.3
- relocate profiles to /etc/vz.
- fix unparseable macros.

* Fri Feb 16 2007 Stanislav Ievlev <inger@altlinux.org> 0.0.1-alt0.2
- ntp profile: use single virtual package

* Thu Feb 15 2007 Konstantin A. Lepikhov <lakostis@altlinux.org> 0.0.1-alt0.1
- Initial build.