Release.
[safe/jmp/vzgot] / support / RCS / vzgot.spec,v
1 head    0.84;
2 access;
3 symbols;
4 locks
5         jmp:0.84.0.0; strict;
6 comment @-- @;
7
8
9 0.84
10 date    2010.03.06.16.39.08;    author jmp;     state Exp;
11 branches
12         0.84.0.0;
13 next    0.83;
14
15 0.83
16 date    2010.03.06.16.39.08;    author jmp;     state Exp;
17 branches
18         0.83.0.0;
19 next    ;
20
21 0.83.0.0
22 date    2010.03.06.16.39.08;    author jmp;     state Exp;
23 branches;
24 next    0.83.0.1;
25
26 0.83.0.1
27 date    2010.03.06.16.39.08;    author jmp;     state Exp;
28 branches;
29 next    ;
30
31 0.84.0.0
32 date    2010.03.06.16.39.08;    author jmp;     state Exp;
33 branches;
34 next    ;
35
36
37 desc
38 @#-----------------------------------------------------------
39 #Fichier des definition des SPEC d'installation
40 #-----------------------------------------------------------
41 #to define the revision numer
42 %define revision %(R="$Revision: 0.84.0.0 $"; RR="${R##: }"; echo ${RR%% ?})
43 %define rversion %(echo %{revision} | cut -d'.' -f1-2)
44 %define rrelease %(echo %{revision}| cut -d'.' -f4)
45 %define revdate %(R="$Date: 2010/03/06 16:38:31 $"; RR="${R##: }"; echo ${RR%% ?})
46 %define sversion %(echo %{revdate} | cut -d' ' -f1 | tr -d '/')
47 %define ddist %(echo %{?dist}| tr -d '.')
48 #-----------------------------------------------------------
49 %{?!mark:%define mark fedora}
50
51 %if "%mark" == "fedora"
52 %define locmark %{?dist}
53 %endif
54
55 %if "%mark" == "safe"
56 %define locmark .%{?dist}.%{mark}
57 %endif
58 #-----------------------------------------------------------
59 Name: vzgot
60 Summary: An application to drive linux container
61 Group: System Environment/Daemons
62 Version: %{rversion}.%{rrelease}
63 Release: %{?sversion}%{?locmark}
64 License: GPLv2
65 Source: ftp://ftp.safe.ca/pub/srctgz/%{name}-%{version}.tgz
66 URL: http://www.%{name}.safe.ca/index.html
67 Vendor: SAFE Inc.
68 Requires: kernel >= 2.6.24
69 Requires: util-linux-ng
70 Requires: bridge-utils
71 Requires: /usr/sbin/brctl,/sbin/ip,/bin/ps,/usr/bin/wc
72 Requires: /sbin/chkconfig
73 Requires: /bin/chmod,/bin/sed,/bin/sh,/bin/ln
74 #---------------------------------------------------------------
75 buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
76
77
78 %description
79 vzgot is a set of tool to manage linux container
80 it allow to run a wide range of distribution
81 (from RH-7.3 to FC12, Centos-4.6 to Centos-5.3)
82 while using a plain linux kernel (above 2.6.24).
83
84
85 %files
86 #%defattr(0640,root,root,0755)
87 %doc %{name}-%{version}*.build_date
88 %doc README Changes QUICK-START
89 %{_var}/lock/%{name}
90 %{_var}/lib/%{name}/RPM
91 %{_var}/lib/%{name}/vzdir
92 %{_var}/lib/%{name}/etc/ssh
93 %{_var}/lib/%{name}/home
94 %{_var}/lib/%{name}/cgroup.d
95 %{_var}/lib/%{name}/vztemplate
96 %{_initrddir}/%{name}
97 %{_usr}/sbin/%{name}
98 %{_usr}/sbin/%{name}.mksrvz
99 %{_usr}/sbin/%{name}.redoall
100 %{_var}/lib/%{name}/shell/%{name}.net
101 %{_var}/lib/%{name}/shell/%{name}.fboot
102 %{_var}/lib/%{name}/shell/%{name}.fboot.redhat
103 %{_var}/lib/%{name}/shell/%{name}.fboot.debian
104 %{_var}/lib/%{name}/shell/%{name}.open
105 %{_var}/lib/%{name}/shell/%{name}.close
106 %{_var}/lib/%{name}/shell/%{name}.start
107 %{_var}/lib/%{name}/shell/%{name}.create
108 %{_var}/lib/%{name}/shell/%{name}.destroy
109
110 %config(noreplace) %{_sysconfdir}/%{name}/vzgot_config
111 %config(noreplace) %{_sysconfdir}/%{name}/vzgot_list
112 %config(noreplace) %{_var}/lib/%{name}/etc/shadow
113 %config(noreplace) %{_var}/lib/%{name}/etc/resolv.conf
114 %config(noreplace) %{_var}/lib/%{name}/etc/groups
115 %config(noreplace) %{_var}/lib/%{name}/etc/users
116 %config(noreplace) %{_var}/lib/%{name}/etc/sudoers
117 %config(noreplace) %{_var}/lib/%{name}/etc/sysconfig/iptables
118 %config(noreplace) %{_var}/lib/%{name}/etc/snmp/snmpd.conf
119
120 #-----------------------------------------------------------
121 #This is the RPM install/upgrade/remove directive
122 #-----------------------------------------------------------
123 #before install or upgrade
124 %pre
125
126 #after install or upgrade
127 %post
128 if [ "$1" = 1 ]; then
129  /sbin/chkconfig %{name} on 2>/dev/null || :
130  #extracting HOST root password to be used as container common password
131  /bin/chmod 600 %{_var}/lib/%{name}/etc/shadow
132  /bin/sed 's/#.*//g' /etc/shadow        |  \
133         grep -v '^[[:space:]]*$'        |  \
134         grep root >>  %{_var}/lib/%{name}/etc/shadow
135  #extracting HOST nameserver to be used by container
136  /bin/sed 's/#.*//g' /etc/resolv.conf      \
137         >> %{_var}/lib/%{name}/etc/resolv.conf
138  fi
139
140 #before upgrade or remove
141 %postun
142
143 #after upgrade or remove
144 %preun
145 if [ "$1" = 0 ]; then
146   %{_initrddir}/%{name} stop 2>/dev/null || :
147   /sbin/chkconfig --del %{name} 2>/dev/null || :
148   fi
149
150 #-----------------------------------------------------------
151 #common part
152 #-----------------------------------------------------------
153 %prep
154
155 %setup -q
156
157 %build
158 %{__rm} -rf %{buildroot}
159 %{?_smp_mflags:%define _smp_mflags -j `/usr/bin/getconf _NPROCESSORS_ONLN`}
160 %{__make} -s %{?_smp_mflags} DIST=%{?ddist} prod
161
162 %clean
163 %{__rm} -rf %{buildroot}
164
165 %install
166 #main install
167 %{__rm} -fr %{buildroot}
168 mkdir -p -m0755 %{buildroot}
169 %{__make} -s install DESTDIR=%{buildroot}
170
171 %changelog
172 * Mon Jan 4 2010 Jean-Marc Pigeon <jmp@@safe.ca> 0.71.6-20100104
173 - Bug Fix
174    * In none debug flag, vzgot was not returning echo
175      from called shell
176    * Defining a 'FLINUX' env variable within shell script
177      vzgot.mksrvz to be pass to 'vzgot create' and used by
178      vzgot.fboot to prepare container with the right
179      linux family (RedHat,SUSE,...) structure
180
181 * Sun Jan 3 2010 Jean-Marc Pigeon <jmp@@safe.ca> 0.71.3-20100104
182   * First release
183 @
184
185
186 0.84
187 log
188 @upgrade version
189 @
190 text
191 @#-----------------------------------------------------------
192 #Fichier des definition des SPEC d'installation
193 #-----------------------------------------------------------
194 #to define the revision numer
195 %define revision %(R="$Revision: 0.83.0.1 $"; RR="${R##: }"; echo ${RR%% ?})
196 %define rversion %(echo %{revision} | cut -d'.' -f1-2)
197 %define rrelease %(echo %{revision}| cut -d'.' -f4)
198 %define revdate %(R="$Date: 2010/03/06 16:39:08 $"; RR="${R##: }"; echo ${RR%% ?})
199 %define sversion %(echo %{revdate} | cut -d' ' -f1 | tr -d '/')
200 %define ddist %(echo %{?dist}| tr -d '.')
201 #-----------------------------------------------------------
202 %{?!mark:%define mark fedora}
203
204 %if "%mark" == "fedora"
205 %define locmark %{?dist}
206 %endif
207
208 %if "%mark" == "safe"
209 %define locmark .%{?dist}.%{mark}
210 %endif
211 #-----------------------------------------------------------
212 Name: vzgot
213 Summary: An application to drive linux container
214 Group: System Environment/Daemons
215 Version: %{rversion}.%{rrelease}
216 Release: %{?sversion}%{?locmark}
217 License: GPLv2
218 Source: ftp://ftp.safe.ca/pub/srctgz/%{name}-%{version}.tgz
219 URL: http://www.%{name}.safe.ca/index.html
220 Vendor: SAFE Inc.
221 Requires: kernel >= 2.6.24
222 Requires: util-linux-ng
223 Requires: bridge-utils
224 Requires: /usr/sbin/brctl,/sbin/ip,/bin/ps,/usr/bin/wc
225 Requires: /sbin/chkconfig
226 Requires: /bin/chmod,/bin/sed,/bin/sh,/bin/ln
227 #---------------------------------------------------------------
228 buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
229
230
231 %description
232 vzgot is a set of tool to manage linux container
233 it allow to run a wide range of distribution
234 (from RH-7.3 to FC12, Centos-4.6 to Centos-5.3)
235 while using a plain linux kernel (above 2.6.24).
236
237
238 %files
239 #%defattr(0640,root,root,0755)
240 %doc %{name}-%{version}*.build_date
241 %doc README Changes QUICK-START
242 %{_var}/lock/%{name}
243 %{_var}/lib/%{name}/RPM
244 %{_var}/lib/%{name}/vzdir
245 %{_var}/lib/%{name}/etc/ssh
246 %{_var}/lib/%{name}/home
247 %{_var}/lib/%{name}/cgroup.d
248 %{_var}/lib/%{name}/vztemplate
249 %{_initrddir}/%{name}
250 %{_usr}/sbin/%{name}
251 %{_usr}/sbin/%{name}.mksrvz
252 %{_usr}/sbin/%{name}.redoall
253 %{_var}/lib/%{name}/shell/%{name}.net
254 %{_var}/lib/%{name}/shell/%{name}.fboot
255 %{_var}/lib/%{name}/shell/%{name}.fboot.redhat
256 %{_var}/lib/%{name}/shell/%{name}.fboot.debian
257 %{_var}/lib/%{name}/shell/%{name}.open
258 %{_var}/lib/%{name}/shell/%{name}.close
259 %{_var}/lib/%{name}/shell/%{name}.start
260 %{_var}/lib/%{name}/shell/%{name}.create
261 %{_var}/lib/%{name}/shell/%{name}.destroy
262
263 %config(noreplace) %{_sysconfdir}/%{name}/vzgot_config
264 %config(noreplace) %{_sysconfdir}/%{name}/vzgot_list
265 %config(noreplace) %{_var}/lib/%{name}/etc/shadow
266 %config(noreplace) %{_var}/lib/%{name}/etc/resolv.conf
267 %config(noreplace) %{_var}/lib/%{name}/etc/groups
268 %config(noreplace) %{_var}/lib/%{name}/etc/users
269 %config(noreplace) %{_var}/lib/%{name}/etc/sudoers
270 %config(noreplace) %{_var}/lib/%{name}/etc/sysconfig/iptables
271 %config(noreplace) %{_var}/lib/%{name}/etc/snmp/snmpd.conf
272
273 #-----------------------------------------------------------
274 #This is the RPM install/upgrade/remove directive
275 #-----------------------------------------------------------
276 #before install or upgrade
277 %pre
278
279 #after install or upgrade
280 %post
281 if [ "$1" = 1 ]; then
282  /sbin/chkconfig %{name} on 2>/dev/null || :
283  #extracting HOST root password to be used as container common password
284  /bin/chmod 600 %{_var}/lib/%{name}/etc/shadow
285  /bin/sed 's/#.*//g' /etc/shadow        |  \
286         grep -v '^[[:space:]]*$'        |  \
287         grep root >>  %{_var}/lib/%{name}/etc/shadow
288  #extracting HOST nameserver to be used by container
289  /bin/sed 's/#.*//g' /etc/resolv.conf      \
290         >> %{_var}/lib/%{name}/etc/resolv.conf
291  fi
292
293 #before upgrade or remove
294 %postun
295
296 #after upgrade or remove
297 %preun
298 if [ "$1" = 0 ]; then
299   %{_initrddir}/%{name} stop 2>/dev/null || :
300   /sbin/chkconfig --del %{name} 2>/dev/null || :
301   fi
302
303 #-----------------------------------------------------------
304 #common part
305 #-----------------------------------------------------------
306 %prep
307
308 %setup -q
309
310 %build
311 %{__rm} -rf %{buildroot}
312 %{?_smp_mflags:%define _smp_mflags -j `/usr/bin/getconf _NPROCESSORS_ONLN`}
313 %{__make} -s %{?_smp_mflags} DIST=%{?ddist} prod
314
315 %clean 
316 %{__rm} -rf %{buildroot}
317
318 %install
319 #main install
320 %{__rm} -fr %{buildroot}
321 mkdir -p -m0755 %{buildroot}
322 %{__make} -s install DESTDIR=%{buildroot}
323
324 %changelog
325 * Mon Jan 4 2010 Jean-Marc Pigeon <jmp@@safe.ca> 0.71.6-20100104
326 - Bug Fix
327    * In none debug flag, vzgot was not returning echo
328      from called shell
329    * Defining a 'FLINUX' env variable within shell script
330      vzgot.mksrvz to be pass to 'vzgot create' and used by
331      vzgot.fboot to prepare container with the right
332      linux family (RedHat,SUSE,...) structure
333
334 * Sun Jan 3 2010 Jean-Marc Pigeon <jmp@@safe.ca> 0.71.3-20100104
335   * First release
336 @
337
338
339 0.84.0.0
340 log
341 @Ratrapage numero de Version
342 @
343 text
344 @d5 1
345 a5 1
346 %define revision %(R="$Revision: 0.84 $"; RR="${R##: }"; echo ${RR%% ?})
347 @
348
349
350 0.83
351 log
352 @Creation
353 #=================================================================================
354 @
355 text
356 @d5 1
357 a5 1
358 %define revision %(R="$Revision: 0.84.0.0 $"; RR="${R##: }"; echo ${RR%% ?})
359 d8 1
360 a8 1
361 %define revdate %(R="$Date: 2010/03/06 16:38:31 $"; RR="${R##: }"; echo ${RR%% ?})
362 @
363
364
365 0.83.0.0
366 log
367 @Ratrapage numero de Version
368 @
369 text
370 @d5 1
371 a5 1
372 %define revision %(R="$Revision: 0.83 $"; RR="${R##: }"; echo ${RR%% ?})
373 d8 1
374 a8 1
375 %define revdate %(R="$Date: 2010/03/06 16:39:08 $"; RR="${R##: }"; echo ${RR%% ?})
376 @
377
378
379 0.83.0.1
380 log
381 @Mise en place su GIT
382 @
383 text
384 @d5 1
385 a5 1
386 %define revision %(R="$Revision: 0.83.0.0 $"; RR="${R##: }"; echo ${RR%% ?})
387 @