Setting tag sliceimage-5.1-1
[sliceimage.git] / lxc-sliceimage.spec
1 %define name lxc-sliceimage
2 %define version 5.1
3 %define taglevel 1
4
5 %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
6
7 Vendor: PlanetLab
8 Packager: PlanetLab Central <support@planet-lab.org>
9 Distribution: PlanetLab %{plrelease}
10 URL: %{SCMURL}
11
12 Summary: lxc-specific node code for slice families
13 Name: %{name}
14 Version: %{version}
15 Release: %{release}
16 Source0: %{name}-%{version}.tar.bz2
17 License: GPL
18 Group: Applications/System
19 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
20 Requires: btrfs-progs
21 BuildArch: noarch
22
23 %description
24 A simple package to deploy reference images for lxc
25
26 %prep
27 %setup -q
28
29 %build
30
31 %install
32 rm -rf $RPM_BUILD_ROOT
33 install -D -m 755 initscripts/lxc-sliceimage ${RPM_BUILD_ROOT}/%{_initrddir}/lxc-sliceimage
34 install -D -m 644 cron.d/lxc-sliceimage $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/lxc-sliceimage
35 install -D -m 644 logrotate/lxc-sliceimage $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/lxc-sliceimage
36 install -D -m 644 lxc_template.xml $RPM_BUILD_ROOT/vservers/.lvref/lxc_template.xml
37
38 %clean
39 rm -rf $RPM_BUILD_ROOT
40
41 %files
42 %{_initrddir}/lxc-sliceimage
43 %{_sysconfdir}/cron.d/lxc-sliceimage
44 %{_sysconfdir}/logrotate.d/lxc-sliceimage
45 /vservers/.lvref
46
47 %post
48 chkconfig --add lxc-sliceimage
49 chkconfig lxc-sliceimage on
50 # Randomize daily run time
51 M=$((60 * $RANDOM / 32768))
52 H=$((24 * $RANDOM / 32768))
53 sed -i -e "s/@M@/$M/" -e "s/@H@/$H/" %{_sysconfdir}/cron.d/lxc-sliceimage