snafu
[myplc.git] / build-native.sh
1 #!/bin/bash
2 #
3 # Builds MyPLC, either inside the MyPLC development environment in
4 # devel/root (if PLC_DEVEL_BOOTSTRAP is true), or in the current host
5 # environment (may be itself a MyPLC development environment or a
6 # Fedora environment with the appropriate development packages
7 # installed).
8 #
9 # Marc E. Fiuczynski <mef@cs.princeton.edu>
10 # Copyright (C) 2007 The Trustees of Princeton University
11 #
12 # $Id: build-native.sh,v 1.1.2.4 2007/08/31 06:53:39 mef Exp $
13 #
14
15 . build.functions
16
17 # XXX .spec file needs to have the appropriate set of requires statements
18
19 # Install configuration scripts
20 echo "* myplc-native: Installing configuration scripts"
21 tmpdir=$1
22 mkdir -p ${tmpdir}
23 rm -rf ${tmpdir}
24 mkdir -p ${tmpdir}
25 install -D -m 755 plc-config ${tmpdir}/usr/bin/plc-config
26 install -D -m 755 plc-config-tty ${tmpdir}/usr/bin/plc-config-tty
27 install -D -m 755 db-config ${tmpdir}/usr/bin/db-config
28 install -D -m 755 dns-config ${tmpdir}/usr/bin/dns-config
29 echo "* myplc-native: skipping build/install of plc_config.py"
30
31 # XXX needs to be done by %pre script in .spec file
32 # install -D -m 755 plc_config.py /tmp/plc_config.py
33 # sh -c 'cd ${tmpdir}; python plc_config.py build; python plc_config.py install'
34 # XXX needs to be done by %pre script in .spec file
35 # sh -c 'chkconfig --add plc; chkconfig plc on'
36
37
38
39 # Install initscripts
40 echo "* myplc-native: Installing initscripts"
41 find plc.d | cpio -p -d -u ${tmpdir}/etc/
42 install -D -m 755 guest.init ${tmpdir}/etc/init.d/plc
43
44
45 # Install web scripts
46 echo "* myplc: Installing web scripts"
47 mkdir -p ${tmpdir}/usr/bin
48 install -m 755 \
49     $srcdir/plc/scripts/gen-sites-xml.py \
50     $srcdir/plc/scripts/gen-slices-xml-05.py \
51     $srcdir/plc/scripts/gen-static-content.py \
52     ${tmpdir}/usr/bin/
53
54 # Install configuration file
55 echo "* myplc: Installing configuration file"
56 install -D -m 444 plc_config.xml ${tmpdir}/etc/planetlab/default_config.xml
57 install -D -m 444 plc_config.dtd ${tmpdir}/etc/planetlab/plc_config.dtd
58
59 # Initialize node RPMs directory. The PlanetLab-Bootstrap.tar.bz2
60 # tarball already contains all of the node RPMs pre-installed. Only
61 # updates or optional packages should be placed in this directory.
62 install -D -m 644 $pl_YUMGROUPSXML \
63     ${tmpdir}/var/www/html/install-rpms/planetlab/yumgroups.xml
64
65 exit 0