fix resolv.conf issue on plc
[myplc.git] / build.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$
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 pldistro=$1; shift
22 RPM_BUILD_ROOT=$1 ; shift
23 PYTHON_SITEARCH=`python -c 'from distutils.sysconfig import get_python_lib; print get_python_lib(1)'`
24 rm -rf ${RPM_BUILD_ROOT}
25 mkdir -p ${RPM_BUILD_ROOT}
26 echo "* myplc-native: installing plc_config.py in " ${PYTHON_SITEARCH}
27 install -D -m 755 plc_config.py ${RPM_BUILD_ROOT}/${PYTHON_SITEARCH}/plc_config.py
28 install -D -m 644 bashrc ${RPM_BUILD_ROOT}/usr/share/myplc/bashrc
29 echo "* myplc-native: installing scripts in /usr/bin"
30 install -D -m 755 plc-config ${RPM_BUILD_ROOT}/usr/bin/plc-config
31 install -D -m 755 plc-config-tty ${RPM_BUILD_ROOT}/usr/bin/plc-config-tty
32 install -D -m 755 db-config ${RPM_BUILD_ROOT}/usr/bin/db-config
33 install -D -m 755 dns-config ${RPM_BUILD_ROOT}/usr/bin/dns-config
34 install -D -m 755 plc-map.py ${RPM_BUILD_ROOT}/usr/bin/plc-map.py
35 install -D -m 755 plc-kml.py ${RPM_BUILD_ROOT}/usr/bin/plc-kml.py
36 install -D -m 755 refresh-peer.py ${RPM_BUILD_ROOT}/usr/bin/refresh-peer.py
37 install -D -m 755 clean-empty-dirs.py ${RPM_BUILD_ROOT}/usr/bin/clean-empty-dirs.py
38 install -D -m 755 mtail.py ${RPM_BUILD_ROOT}/usr/bin/mtail.py
39 install -D -m 755 plc-check-ssl-peering.py ${RPM_BUILD_ROOT}/usr/bin/plc-check-ssl-peering.py
40 install -D -m 755 plc-orphan-accounts.py ${RPM_BUILD_ROOT}/usr/bin/plc-orphan-accounts.py
41
42 # Extra scripts (mostly for mail and dns) not installed by myplc by default.  Used in production
43 echo "* myplc-native: installing scripts in /etc/support-scripts"
44 mkdir -p ${RPM_BUILD_ROOT}/etc/support-scripts
45 cp support-scripts/* ${RPM_BUILD_ROOT}/etc/support-scripts
46 chmod 444 ${RPM_BUILD_ROOT}/etc/support-scripts/*
47
48 # copy initscripts to etc/plc_sliceinitscripts
49 mkdir -p ${RPM_BUILD_ROOT}/etc/plc_sliceinitscripts
50 cp plc_sliceinitscripts/* ${RPM_BUILD_ROOT}/etc/plc_sliceinitscripts
51 chmod 444 ${RPM_BUILD_ROOT}/etc/plc_sliceinitscripts/*
52
53 # Install initscripts
54 echo "* myplc-native: Installing initscripts"
55 install -D -m 755 plc.init ${RPM_BUILD_ROOT}/etc/init.d/plc
56 find plc.d | cpio -p -d -u ${RPM_BUILD_ROOT}/etc/
57 chmod 755 ${RPM_BUILD_ROOT}/etc/plc.d/*
58
59 # Install configuration file
60 echo "* myplc: Installing configuration file"
61 install -D -m 444 default_config.xml ${RPM_BUILD_ROOT}/etc/planetlab/default_config.xml
62 install -D -m 444 plc_config.dtd ${RPM_BUILD_ROOT}/etc/planetlab/plc_config.dtd
63
64 # Install db-config.d files
65 echo "* myplc: Installing db-config.d files"
66 mkdir -p ${RPM_BUILD_ROOT}/etc/planetlab/db-config.d
67 cp db-config.d/* ${RPM_BUILD_ROOT}/etc/planetlab/db-config.d
68 chmod 444 ${RPM_BUILD_ROOT}/etc/planetlab/db-config.d/*
69
70 # yumgroups.xml and yum repo : let noderepo handle that
71
72 exit 0