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