- build FC4 based MyPLC by default
[myplc.git] / myplc.spec
1 Vendor: PlanetLab
2 Packager: PlanetLab Central <support@planet-lab.org>
3 Distribution: PlanetLab 3.3
4 URL: http://cvs.planet-lab.org/cvs/myplc
5
6 Summary: PlanetLab Central (PLC) Portable Installation
7 Name: myplc
8 Version: 0.3
9 Release: 1%{?pldistro:.%{pldistro}}%{?date:.%{date}}
10 License: BSD
11 Group: Applications/Systems
12 Source0: %{name}-%{version}.tar.gz
13 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
14
15 %define debug_package %{nil}
16
17 %description
18 MyPLC is a complete PlanetLab Central (PLC) portable installation
19 contained within a chroot jail. The default installation consists of a
20 web server, an XML-RPC API server, a boot server, and a database
21 server: the core components of PLC. The installation may be customized
22 through a graphical interface. All PLC services are started up and
23 shut down through a single System V init script installed in the host
24 system.
25
26 %prep
27 %setup -q
28
29 %build
30 pushd myplc
31 ./build.sh
32 popd
33
34 %install
35 rm -rf $RPM_BUILD_ROOT
36
37 pushd myplc
38
39 # Install host startup script and configuration file
40 install -D -m 755 host.init $RPM_BUILD_ROOT/%{_sysconfdir}/init.d/plc
41 install -D -m 644 plc.sysconfig $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/plc
42
43 # Create convenient symlink
44 install -d -m 755 $RPM_BUILD_ROOT/%{_sysconfdir}
45 ln -sf /plc/data/etc/planetlab $RPM_BUILD_ROOT/%{_sysconfdir}/planetlab
46
47 # Install root filesystem
48 install -d -m 755 $RPM_BUILD_ROOT/plc/root
49 install -D -m 644 root.img $RPM_BUILD_ROOT/plc/root.img
50
51 # Install data directory
52 find data | cpio -p -d -u $RPM_BUILD_ROOT/plc/
53
54 popd
55
56 %clean
57 rm -rf $RPM_BUILD_ROOT
58
59 # If run under sudo
60 if [ -n "$SUDO_USER" ] ; then
61     # Allow user to delete the build directory
62     chown -R $SUDO_USER .
63     # Some temporary cdroot files like /var/empty/sshd and
64     # /usr/bin/sudo get created with non-readable permissions.
65     find . -not -perm +0600 -exec chmod u+rw {} \;
66     # Allow user to delete the built RPM(s)
67     chown -R $SUDO_USER %{_rpmdir}/%{_arch}
68 fi
69
70 %pre
71 if [ -x %{_sysconfdir}/init.d/plc ] ; then
72     service plc stop
73 fi
74
75 %post
76 chkconfig --add plc
77 chkconfig plc on
78
79 %preun
80 # 0 = erase, 1 = upgrade
81 if [ $1 -eq 0 ] ; then
82     service plc stop
83     chkconfig plc off
84     chkconfig --del plc
85 fi
86
87 %files
88 %defattr(-,root,root,-)
89 # Host startup script and configuration file
90 %{_sysconfdir}/init.d/plc
91 %{_sysconfdir}/sysconfig/plc
92
93 # Symlink to /etc/planetlab within data directory
94 %{_sysconfdir}/planetlab
95
96 # Root filesystem
97 /plc/root.img
98 /plc/root
99
100 # Data directory
101 %dir /plc/data
102 %config(noreplace) /plc/data/*
103
104 %changelog
105 * Wed Apr  5 2006 Mark Huang <mlhuang@CS.Princeton.EDU> - 0.2-1
106 - Basic functionality complete. Consolidate into a single package
107   installed in /plc.
108
109 * Fri Mar 17 2006 Mark Huang <mlhuang@CS.Princeton.EDU> - 0.1-1
110 - Initial build.
111