- don't list /plc/data twice
[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.2
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 -r 2
32 # Not until we can get the build server to run Fedora Core 4 or an
33 # updated version of yum.
34 #./build.sh -r 4
35 popd
36
37 %install
38 rm -rf $RPM_BUILD_ROOT
39
40 pushd myplc
41
42 # Install host startup script and configuration file
43 install -D -m 755 host.init $RPM_BUILD_ROOT/%{_sysconfdir}/init.d/plc
44 install -D -m 644 plc.sysconfig $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/plc
45
46 # Create convenient symlink
47 install -d -m 755 $RPM_BUILD_ROOT/%{_sysconfdir}
48 ln -sf /plc/data/etc/planetlab $RPM_BUILD_ROOT/%{_sysconfdir}/planetlab
49
50 # Install root filesystem
51 install -d -m 755 $RPM_BUILD_ROOT/plc/root
52 install -D -m 644 root.img $RPM_BUILD_ROOT/plc/root.img
53
54 # Install data directory
55 find data | cpio -p -d -u $RPM_BUILD_ROOT/plc/
56
57 popd
58
59 %clean
60 rm -rf $RPM_BUILD_ROOT
61
62 # If run under sudo
63 if [ -n "$SUDO_USER" ] ; then
64     # Allow user to delete the build directory
65     chown -R $SUDO_USER .
66     # Some temporary cdroot files like /var/empty/sshd and
67     # /usr/bin/sudo get created with non-readable permissions.
68     find . -not -perm +0600 -exec chmod u+rw {} \;
69     # Allow user to delete the built RPM(s)
70     chown -R $SUDO_USER %{_rpmdir}/%{_arch}
71 fi
72
73 %post
74 chkconfig --add plc
75 chkconfig plc on
76
77 %preun
78 # 0 = erase, 1 = upgrade
79 if [ $1 -eq 0 ] ; then
80     chkconfig plc off
81     chkconfig --del plc
82 fi
83
84 %files
85 %defattr(-,root,root,-)
86 # Host startup script and configuration file
87 %{_sysconfdir}/init.d/plc
88 %{_sysconfdir}/sysconfig/plc
89
90 # Symlink to /etc/planetlab within data directory
91 %{_sysconfdir}/planetlab
92
93 # Root filesystem
94 /plc/root.img
95 /plc/root
96
97 # Data directory
98 %dir %config(noreplace) /plc/data
99
100 %changelog
101 * Wed Apr  5 2006 Mark Huang <mlhuang@CS.Princeton.EDU> - 0.2-1
102 - Basic functionality complete. Consolidate into a single package
103   installed in /plc.
104
105 * Fri Mar 17 2006 Mark Huang <mlhuang@CS.Princeton.EDU> - 0.1-1
106 - Initial build.
107