use correct spec varname
[myplc.git] / myplc.spec
1 #
2 # $Id$
3 %define url $URL$
4
5 %define name myplc
6 %define version 5.0
7 %define taglevel 0
8
9 %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
10 %global python_sitearch %( python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)" )
11
12 Name: %{name}
13 Version: %{version}
14 Release: %{release}
15 License: PlanetLab
16 Source0: %{name}-%{version}.tar.gz
17 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
18 BuildArch: noarch
19
20 Vendor: PlanetLab
21 Packager: PlanetLab Central <support@planet-lab.org>
22 Distribution: PlanetLab %{plrelease}
23 URL: %(echo %{url} | cut -d ' ' -f 2)
24
25 %define nodefamily %{pldistro}-%{distroname}-%{_arch}
26
27 ####################### myplc
28 Summary: PlanetLab Central (PLC) Portable Installation
29 Group: Applications/Systems
30
31 # as much as possible, requires should go in the subpackages specfile
32 Requires: bzip2
33 Requires: tar 
34 Requires: less
35 Requires: sendmail
36 Requires: sendmail-cf
37 Requires: openssl
38 Requires: expect
39 Requires: php-pgsql
40 Requires: curl
41 Requires: rsync
42 Requires: python-devel
43 Requires: yum
44 Requires: PyXML
45 Requires: createrepo
46 Requires: cpio
47 Requires: wget
48 Requires: php
49 Requires: openssh
50 Requires: dnsmasq
51 Requires: diffutils
52 Requires: gzip
53 Requires: vim-minimal
54 Requires: findutils
55 Requires: xmlsec1
56 Requires: xmlsec1-openssl
57 %if "%{distro}" == "Fedora" && %{distrorelease} >= 10
58 Requires: cronie
59 %else
60 Requires: vixie-cron
61 %endif
62 # planetlab stuff
63 Requires: bootmanager
64 # make sure to remove 2-fold nodefamily stuff
65 Conflicts: bootcd-%{pldistro}-%{_arch}
66 Requires: bootcd-%{nodefamily}
67 Requires: bootcd-initscripts
68 Requires: PLCWWW
69 Requires: www-register-wizard
70 Requires: nodeconfig
71 Requires: PLCAPI
72 # make sure to remove 2-fold nodefamily stuff
73 Conflicts: bootstrapfs-%{pldistro}-%{_arch}
74 Requires: bootstrapfs-%{nodefamily}
75 Requires: myplc-docs
76 Requires: myplc-release
77 Requires: myplc-config
78
79 %define debug_package %{nil}
80
81 %description
82 MyPLC is a complete PlanetLab Central (PLC) portable installation
83 contained within a chroot jail. The default installation consists of a
84 web server, an XML-RPC API server, a boot server, and a database
85 server: the core components of PLC. The installation may be customized
86 through a graphical interface. All PLC services are started up and
87 shut down through a single System V init script installed in the host
88 system.
89
90 ####################### myplc-config
91
92 %package config
93
94 Summary: PlanetLab Central (PLC) configuration python module
95 Group: Applications/Systems
96 Requires: python
97
98 %description config
99 This package provides the Python module to configure MyPLC.
100
101
102 %prep
103 %setup -q
104
105 %build
106
107 %install
108 rm -rf $RPM_BUILD_ROOT
109
110 # Install configuration scripts
111 echo "* Installing plc_config.py in " ${PYTHON_SITEARCH}
112 PYTHON_SITEARCH=`python -c 'from distutils.sysconfig import get_python_lib; print get_python_lib(1)'`
113 install -D -m 755 plc_config.py ${RPM_BUILD_ROOT}/${PYTHON_SITEARCH}/plc_config.py
114
115 echo "* Installing scripts in /usr/bin"
116 mkdir -p ${RPM_BUILD_ROOT}/usr/bin
117 rsync -av --exclude .svn bin/ ${RPM_BUILD_ROOT}/usr/bin/
118 chmod 755 ${RPM_BUILD_ROOT}/usr/bin/*
119
120 # Install initscript 
121 echo "* Installing plc initscript"
122 install -D -m 755 plc.init ${RPM_BUILD_ROOT}/etc/init.d/plc
123
124 # Install initscripts
125 echo "* Installing plc.d initscripts"
126 find plc.d | cpio -p -d -u ${RPM_BUILD_ROOT}/etc/
127 chmod 755 ${RPM_BUILD_ROOT}/etc/plc.d/*
128
129 # Install db-config.d files
130 echo "* Installing db-config.d files"
131 mkdir -p ${RPM_BUILD_ROOT}/etc/planetlab/db-config.d
132 cp db-config.d/* ${RPM_BUILD_ROOT}/etc/planetlab/db-config.d
133 chmod 444 ${RPM_BUILD_ROOT}/etc/planetlab/db-config.d/*
134
135 # Extra scripts (mostly for mail and dns) not installed by myplc by default.  Used in production
136 echo "* Installing scripts in /etc/support-scripts"
137 mkdir -p ${RPM_BUILD_ROOT}/etc/support-scripts
138 cp support-scripts/* ${RPM_BUILD_ROOT}/etc/support-scripts
139 chmod 444 ${RPM_BUILD_ROOT}/etc/support-scripts/*
140
141 # copy initscripts to etc/plc_sliceinitscripts
142 mkdir -p ${RPM_BUILD_ROOT}/etc/plc_sliceinitscripts
143 cp plc_sliceinitscripts/* ${RPM_BUILD_ROOT}/etc/plc_sliceinitscripts
144 chmod 444 ${RPM_BUILD_ROOT}/etc/plc_sliceinitscripts/*
145
146 # Install configuration file
147 echo "* myplc: Installing configuration file"
148 install -D -m 444 plc_config.dtd ${RPM_BUILD_ROOT}/etc/planetlab/plc_config.dtd
149 sed -e "s,@PLDISTRO@,%{pldistro},g" -e "s,@FCDISTRO@,%{distroname},g" -e "s,@ARCH@,%{_arch},g" \
150     default_config.xml > ${RPM_BUILD_ROOT}/etc/planetlab/default_config.xml
151 chmod 444 ${RPM_BUILD_ROOT}/etc/planetlab/default_config.xml
152
153 echo "* Installing bashrc convenience"
154 install -D -m 644 bashrc ${RPM_BUILD_ROOT}/usr/share/myplc/bashrc
155
156 # yumgroups.xml and yum repo : let noderepo handle that
157
158 %clean
159 rm -rf $RPM_BUILD_ROOT
160
161 %pre
162 if [ -x %{_sysconfdir}/init.d/plc ] ; then
163     %{_sysconfdir}/init.d/plc stop
164 fi
165
166 # Old versions of myplc used to ship with a bootstrapped database and
167 # /etc/planetlab directory. Including generated files in the manifest
168 # was dangerous; if /plc/data/var/lib/pgsql/data/base/1/16676 changed
169 # names from one RPM build to another, it would be rpmsaved and thus
170 # effectively deleted. Now we do not include these files in the
171 # manifest. However, to avoid deleting these files in the process of
172 # upgrading from one of these old versions of myplc, we must back up
173 # the database and /etc/planetlab and restore them after the old
174 # version has been uninstalled in %triggerpostun (also in %post, in
175 # case we are force upgrading to the same version).
176 #
177 # This code can be removed once all myplc-0.4-1 installations have
178 # been upgraded to at least myplc-0.4-2.
179
180 # 0 = install, 1 = upgrade
181 if [ $1 -gt 0 ] ; then
182     for dir in /var/lib/pgsql/data /etc/planetlab ; do
183         if [ -d $dir ] ; then
184             echo "Preserving $dir"
185             mkdir -p $dir.rpmsave
186             tar -C $dir -cpf - . | \
187                tar -C $dir.rpmsave -xpf -
188
189             # Except for the default configuration file and DTD, which
190             # really should be considered for upgrade.
191             rm -f $dir.rpmsave/{default_config.xml,plc_config.dtd}
192         fi
193     done
194 fi
195
196 %post
197 if [ -x /sbin/chkconfig ] ; then
198     /sbin/chkconfig --add plc
199     /sbin/chkconfig plc on
200 fi
201
202 %triggerpostun -- %{name}
203 # 0 = erase, 1 = upgrade
204 if [ $1 -gt 0 ] ; then
205     for dir in /var/lib/pgsql/data /etc/planetlab ; do
206         if [ -d $dir.rpmsave -a -d $dir ] ; then
207             echo "Merging $dir"
208             if tar -C $dir.rpmsave -cpf - . | \
209                tar -C $dir -xpf - ; then
210                 rm -rf $dir.rpmsave
211             fi
212         fi
213     done
214 fi    
215
216 %preun
217 # 0 = erase, 1 = upgrade
218 if [ $1 -eq 0 ] ; then
219     %{_sysconfdir}/init.d/plc stop
220     if [ -x /sbin/chkconfig ] ; then
221         /sbin/chkconfig plc off
222         /sbin/chkconfig --del plc
223     fi
224 fi
225
226 %files
227 %defattr(-,root,root,-)
228 # Host startup script and configuration file
229 /etc/init.d/plc
230 /etc/plc.d
231 /etc/planetlab
232 /etc/plc_sliceinitscripts
233 /etc/support-scripts
234 /usr/bin/
235 /usr/share/myplc/bashrc
236
237 %files config
238 %defattr(-,root,root,-)
239 /usr/bin/plc-config
240 %{python_sitearch}/plc_config.py*
241
242
243 %changelog
244 * Sat Jan 09 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.3-37
245 - support for fedora 12
246 - new package myplc-config for use by sfa
247 - drupal user registration turned off
248
249 * Thu Dec 31 2009 Marc Fiuczynski <mef@cs.princeton.edu> - MyPLC-4.3-36
250 - - fix to make sure when API, BOOT, MONITOR are on the same
251 - machine as WWW that the SSL key,cert for WWW takes precedence.
252 - - Do proper setup for SSL CA certficate to be used as the server
253 - chain.
254
255 * Wed Dec 23 2009 Marc Fiuczynski <mef@cs.princeton.edu> - MyPLC-4.3-35
256 - - Change sysctl.conf source to be PlanetLabConfsysctl.con rather than the php script.
257
258 * Tue Dec 22 2009 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - MyPLC-4.3-34
259 - depend on pcucontrol
260
261 * Fri Dec 18 2009 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - MyPLC-4.3-33
262 - * validate input according to type in plc_config
263 - * added the _genicw system slice
264 - * add tag types for sites and persons
265 - * add new tags for nodes and slices for exemption from myops
266
267 * Thu Nov 26 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.3-32
268 - turn off drupal on a box that acts as BOOT server but not as WWW server
269 - cleanup some obsolete code for old chroot-jail packaging in the process
270 - new bootcd-kernel script for keeping bootcd variants up2date
271
272 * Mon Nov 09 2009 Daniel Hokka Zakrisson <daniel@hozac.com> - MyPLC-4.3-31
273 - Make the /etc/hosts manipulation optional.
274
275 * Thu Nov 05 2009 Daniel Hokka Zakrisson <daniel@hozac.com> - MyPLC-4.3-30
276 - Fix SetRole.
277
278 * Tue Nov 03 2009 Marc Fiuczynski <mef@cs.princeton.edu> - MyPLC-4.3-29
279 - - Added "SetRole()" so that db-config.d/ scriplets can insert roles
280 - into the DB.
281 - - Added the root ssh key handling support back into plc.d/ssh and the
282 - default xml file.  This should be identical to the way it was in
283 - rc12.
284 - - Added support in the db-config.d/01-init script to register the root
285 - ssh public key with the default administrator.  In this way the root
286 - ssh key will make it into the root account on the nodes by means of
287 - NodeManager's specialaccounts plugin.
288
289 * Tue Oct 20 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.3-28
290 - db-config ignores sliver tags
291 - sirius's db-config script renamed (was sirious)
292
293 * Tue Oct 13 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.3-27
294 - fix for silverauth - missing tag types now created at plc startup time
295
296 * Fri Oct 09 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.3-26
297 - plc.d/ssl preserves SSL certificates when it thinkfs they're obsolete
298
299 * Wed Oct 07 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.3-25
300 - companion to NM's specialaccounts plugin
301 - do not generate /etc/planetlab/root_ssh_key* anymore
302 - remove related config. variables and conf_files
303
304 * Sun Sep 20 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - MyPLC-4.3-24
305 - clarified description text to refer only to plcrt and not other optional
306 - packages.
307
308 * Sat Sep 19 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - MyPLC-4.3-23
309 - fixed a bug setting slice multiple attributes with the same tag name
310
311 * Mon Sep 07 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.3-22
312 - SSL setup for monitor box, and related new config variables
313 - new conf_file for /etc/planetlab/extensions
314 - various tweaks in db-config internals, about initscripts among others
315 - also more messages defined in the db
316
317 * Tue Jul 07 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.3-21
318 - create node tags, like e.g. 'arch', that were not handled with 4.3-20
319
320 * Tue Jul 07 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.3-20
321 - bugfix in db-config, tag 4.3-19 would not fly
322
323 * Mon Jul 06 2009 Marc Fiuczynski <mef@cs.princeton.edu> - MyPLC-4.3-19
324 - Refactored db-config into snippets in db-config.d/.
325
326 * Thu Jul 02 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.3-18
327 - oops, tag 4.3-17 was broken and would not work
328
329 * Wed Jul 01 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.3-17
330 - bugfix - escape sequences inserted in xml configs
331
332 * Fri Jun 26 2009 Marc Fiuczynski <mef@cs.princeton.edu> - MyPLC-4.3-16
333 - Handle db-config.d files properly.
334
335 * Tue Jun 23 2009 Marc Fiuczynski <mef@cs.princeton.edu> - MyPLC-4.3-15
336 - - Fix /etc/init.d/plc to have command usage show up on the tty rather
337 - than the log file
338 - - Fix db-config to be a bit more cautious when
339 - /etc/planetlab/db-config.d doesn''t exist
340 - - Clean up db-config approach to ignore .bak, *~, .rpm{save,new}, and
341 - .orig files.
342 - - Refactor generic plc-config-tty code into plc_config.py.
343 - plc-config-tty now contains MyPLC specific paths, "usual" variables,
344 - and the list of validated variables and the corresponding
345 - validator() function. This refactoring lets one reuse plc_config.py
346 - as a generic cmdline configuration tool for highly customer MyPLC
347 - like software.
348
349 * Mon Jun 15 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - MyPLC-4.3-14
350 - update PCU Type descriptions.
351 - updates to init scripts
352
353 * Wed Jun 03 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.3-13
354 - requires monitor-pcucontrol so register-wizard can work
355
356 * Tue May 26 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.3-12
357 - cleaned up plc-config-tty, no more need to configure plc-devel
358
359 * Tue May 19 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.3-11
360 - first draft of plc-orpha-accounts.py, and rename check-ssl-peering into plc-<>
361
362 * Wed May 06 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.3-9
363 - fix issue in db-config that prevented correct operation
364
365 * Wed May 06 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.3-8
366 - remove support for chroot-based packaging - no crond nor syslog step anymore
367 - plc init script now named plc.init instead of former guest.init
368
369 * Mon May 04 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - MyPLC-4.3-7
370 - add Monitor to docs build
371
372 * Wed Apr 29 2009 Marc Fiuczynski <mef@cs.princeton.edu> - MyPLC-4.3-6
373 - plc_config.py and plc-config-tty: generalized to work for more diverse
374 - MyPLC configurations.
375 - plc.d/httpd: only update httpd_conf with /data for chroot-ed MyPLC
376 - deployments and increase the memory limits in php.ini
377 - plc.d/crond: add --full option to vacuumdb
378
379 * Tue Apr 07 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.3-5
380 - avoid generating ssl certificates for disabled services among www api boot
381
382 * Mon Mar 30 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.3-4
383 - cleaned up old entries in db-config
384 - mtail more robust
385
386 * Tue Mar 24 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.3-3
387 - php include path tweaked for plekit includes
388 - reviewed myplc (fka native) packaging dependencies
389 - renumbered 4.3
390
391 * Thu Jan 29 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.3-2
392 - rename myplc into myplc-chroot and myplc-native into myplc
393 - new settings (shortname & hrn_root) for local peer
394
395 * Wed Sep 10 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.3-1
396 - First iteration of new data model
397 - Bunch of various fixes
398
399 * Tue May 20 2008 Faiyaz Ahmed <faiyaza@cs.princeton.edu> - MyPLC-4.2-15
400 - Removed proper ops from planetflow slice.
401
402 * Wed May 14 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-14
403 - myplc-native requires myplc-docs
404 - fixed doc build by locating locally installed DTDs at build-time
405
406 * Sun May 11 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-13
407 - turn myplc-docs off for now
408
409 * Sat May 10 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-12
410 - figures in doc package
411
412 * Fri May 09 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-11
413 - no more doc packaged outside of myplc-docs - doc/ cleaned up 
414 - chroot packaging does not have docs anymore
415 - 'cvs' and 'dev' not required from myplc-native anymore
416 - cosmetic change in kml output
417
418 * Thu May 08 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-10
419 - defaults for *_IP conf vars now void, expect more accurate /etc/hosts
420 - gethostbyname uses python rather than perl (hope this shrinks deps) 
421 - doc: reviewed myplc doc - deprecated everything related to myplc-devel
422 - doc: packaging doc in myplc-native (myplc&PLCAPI) & removed target files from svn
423 - make sync now works towards vserver-based myplc only 
424
425 * Mon May 05 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - MyPLC-4.2-9
426
427 - added vsys 'pfmount' script to the default netflow slice attributes.
428
429
430 * Thu Apr 24 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-8
431 - plc.d/bootcd step altered for handling legacy bootcd smooth migration
432 - to new bootcd packaging
433
434 * Wed Apr 23 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-7
435 - changes needed for bootcd 4.2 : new, possible multiple, installation locations, and new rpm name
436
437 * Tue Apr 22 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-6
438 - packaging of mplc-release in myplc-native
439 - sudoers.php is new to PlanetLabConf (needs nodeconfig-4.2-4)
440 - resolv file in /etc/resolv.conf, not plc_resolv.conf
441 - improved sirius script
442 - remove the 'driver' node-network-setting that was unused, and new 'Multihome' category
443 - expires more properly set 
444
445 * Mon Apr 07 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - MyPLC-4.2-4 MyPLC-4.2-5
446
447
448 * Wed Mar 26 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-3 MyPLC-4.2-4
449 - renew_reminder script moved to support-scripts/
450 - gen-aliases script added in support-scripts/
451 - sirius initscript moved to plc_sliceinitscripts (formerly inlined in db-config)
452 - plc-map script : no javascript for googlemap anymore, see new plc-kml script instead
453 - nodefamily-aware (creates legacy symlink /var/www/html/install-rpms/planetlab)
454 - new native slice attributes 'capabilities', 'vsys' and 'codemux'
455 - new setting 'Mom list address' for sending emails to a separate destination
456 - starts rsyslogd/syslogd as appropriate
457 - expects nodeconfig package (former PlanetLabConf/ dir from PLCWWW)
458 - convenience generation of yum.conf in resulting image based on build/mirroring
459
460 * Thu Feb 14 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - myplc-4.2-2 myplc-4.2-3
461 - refresh-peer.py removed (duplicate with PLCAPI)
462 - plc.d/ scripts cleaned up
463 - sirius initscript updated
464 - slice auto renewal fixed
465
466 * Fri Aug 31 2007 Marc E. Fiuczynski <mef@CS.Princeton.EDU>
467 - initial build.
468
469 %define module_current_branch 4.3