1 #-----------------------------------------------------------
2 #Fichier des definition des SPEC d'installation
3 #-----------------------------------------------------------
4 #to define the revision numer
5 %define revision %(R="$Revision: 0.84.0.0 $"; RR="${R##: }"; echo ${RR%% ?})
6 %define rversion %(echo %{revision} | cut -d'.' -f1-2)
7 %define rrelease %(echo %{revision}| cut -d'.' -f4)
8 %define revdate %(R="$Date: 2010/03/06 16:39:08 $"; RR="${R##: }"; echo ${RR%% ?})
9 %define sversion %(echo %{revdate} | cut -d' ' -f1 | tr -d '/')
10 %define ddist %(echo %{?dist}| tr -d '.')
11 #-----------------------------------------------------------
12 %{?!mark:%define mark fedora}
14 %if "%mark" == "fedora"
15 %define locmark %{?dist}
19 %define locmark .%{?dist}.%{mark}
21 #-----------------------------------------------------------
23 Summary: An application to drive linux container
24 Group: System Environment/Daemons
25 Version: %{rversion}.%{rrelease}
26 Release: %{?sversion}%{?locmark}
28 Source: ftp://ftp.safe.ca/pub/srctgz/%{name}-%{version}.tgz
29 URL: http://www.%{name}.safe.ca/index.html
31 Requires: kernel >= 2.6.24
32 Requires: util-linux-ng
33 Requires: bridge-utils
34 Requires: /usr/sbin/brctl,/sbin/ip,/bin/ps,/usr/bin/wc
35 Requires: /sbin/chkconfig
36 Requires: /bin/chmod,/bin/sed,/bin/sh,/bin/ln
37 #---------------------------------------------------------------
38 buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
42 vzgot is a set of tool to manage linux container
43 it allow to run a wide range of distribution
44 (from RH-7.3 to FC12, Centos-4.6 to Centos-5.3)
45 while using a plain linux kernel (above 2.6.24).
49 #%defattr(0640,root,root,0755)
50 %doc %{name}-%{version}*.build_date
51 %doc README Changes QUICK-START
53 %{_var}/lib/%{name}/RPM
54 %{_var}/lib/%{name}/vzdir
55 %{_var}/lib/%{name}/etc/ssh
56 %{_var}/lib/%{name}/home
57 %{_var}/lib/%{name}/cgroup.d
58 %{_var}/lib/%{name}/vztemplate
61 %{_usr}/sbin/%{name}.mksrvz
62 %{_usr}/sbin/%{name}.redoall
63 %{_var}/lib/%{name}/shell/%{name}.net
64 %{_var}/lib/%{name}/shell/%{name}.fboot
65 %{_var}/lib/%{name}/shell/%{name}.fboot.redhat
66 %{_var}/lib/%{name}/shell/%{name}.fboot.debian
67 %{_var}/lib/%{name}/shell/%{name}.open
68 %{_var}/lib/%{name}/shell/%{name}.close
69 %{_var}/lib/%{name}/shell/%{name}.start
70 %{_var}/lib/%{name}/shell/%{name}.create
71 %{_var}/lib/%{name}/shell/%{name}.destroy
73 %config(noreplace) %{_sysconfdir}/%{name}/vzgot_config
74 %config(noreplace) %{_sysconfdir}/%{name}/vzgot_list
75 %config(noreplace) %{_var}/lib/%{name}/etc/shadow
76 %config(noreplace) %{_var}/lib/%{name}/etc/resolv.conf
77 %config(noreplace) %{_var}/lib/%{name}/etc/groups
78 %config(noreplace) %{_var}/lib/%{name}/etc/users
79 %config(noreplace) %{_var}/lib/%{name}/etc/sudoers
80 %config(noreplace) %{_var}/lib/%{name}/etc/sysconfig/iptables
81 %config(noreplace) %{_var}/lib/%{name}/etc/snmp/snmpd.conf
83 #-----------------------------------------------------------
84 #This is the RPM install/upgrade/remove directive
85 #-----------------------------------------------------------
86 #before install or upgrade
89 #after install or upgrade
92 /sbin/chkconfig %{name} on 2>/dev/null || :
93 #extracting HOST root password to be used as container common password
94 /bin/chmod 600 %{_var}/lib/%{name}/etc/shadow
95 /bin/sed 's/#.*//g' /etc/shadow | \
96 grep -v '^[[:space:]]*$' | \
97 grep root >> %{_var}/lib/%{name}/etc/shadow
98 #extracting HOST nameserver to be used by container
99 /bin/sed 's/#.*//g' /etc/resolv.conf \
100 >> %{_var}/lib/%{name}/etc/resolv.conf
103 #before upgrade or remove
106 #after upgrade or remove
108 if [ "$1" = 0 ]; then
109 %{_initrddir}/%{name} stop 2>/dev/null || :
110 /sbin/chkconfig --del %{name} 2>/dev/null || :
113 #-----------------------------------------------------------
115 #-----------------------------------------------------------
121 %{__rm} -rf %{buildroot}
122 %{?_smp_mflags:%define _smp_mflags -j `/usr/bin/getconf _NPROCESSORS_ONLN`}
123 %{__make} -s %{?_smp_mflags} DIST=%{?ddist} prod
126 %{__rm} -rf %{buildroot}
130 %{__rm} -fr %{buildroot}
131 mkdir -p -m0755 %{buildroot}
132 %{__make} -s install DESTDIR=%{buildroot}
135 * Mon Jan 4 2010 Jean-Marc Pigeon <jmp@safe.ca> 0.71.6-20100104
137 * In none debug flag, vzgot was not returning echo
139 * Defining a 'FLINUX' env variable within shell script
140 vzgot.mksrvz to be pass to 'vzgot create' and used by
141 vzgot.fboot to prepare container with the right
142 linux family (RedHat,SUSE,...) structure
144 * Sun Jan 3 2010 Jean-Marc Pigeon <jmp@safe.ca> 0.71.3-20100104