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