Change v3 to v4 yumgroups.xml
[myplc.git] / myplc.spec
1 Vendor: PlanetLab
2 Packager: PlanetLab Central <support@planet-lab.org>
3 Distribution: PlanetLab 4.0
4 URL: http://cvs.planet-lab.org/cvs/myplc
5
6 Summary: PlanetLab Central (PLC) Portable Installation
7 Name: myplc
8 Version: 0.5
9 Release: 5%{?pldistro:.%{pldistro}}%{?date:.%{date}}
10 License: PlanetLab
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 #
40 # myplc
41 #
42
43 # Install host startup script and configuration file
44 install -D -m 755 host.init $RPM_BUILD_ROOT/%{_sysconfdir}/init.d/plc
45 install -D -m 644 plc.sysconfig $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/plc
46
47 # Create convenient symlink
48 install -d -m 755 $RPM_BUILD_ROOT/%{_sysconfdir}
49 ln -sf /plc/data/etc/planetlab $RPM_BUILD_ROOT/%{_sysconfdir}/planetlab
50
51 # Install root filesystem
52 install -d -m 755 $RPM_BUILD_ROOT/plc/root
53 install -D -m 644 root.img $RPM_BUILD_ROOT/plc/root.img
54
55 # Install data directory
56 find data | cpio -p -d -u $RPM_BUILD_ROOT/plc/
57
58 popd
59
60 %clean
61 rm -rf $RPM_BUILD_ROOT
62
63 # If run under sudo
64 if [ -n "$SUDO_USER" ] ; then
65     # Allow user to delete the build directory
66     chown -h -R $SUDO_USER .
67     # Some temporary cdroot files like /var/empty/sshd and
68     # /usr/bin/sudo get created with non-readable permissions.
69     find . -not -perm +0600 -exec chmod u+rw {} \;
70     # Allow user to delete the built RPM(s)
71     chown -h -R $SUDO_USER %{_rpmdir}/%{_arch}
72 fi
73
74 %pre
75 if [ -x %{_sysconfdir}/init.d/plc ] ; then
76     %{_sysconfdir}/init.d/plc stop
77 fi
78
79 # Old versions of myplc used to ship with a bootstrapped database and
80 # /etc/planetlab directory. Including generated files in the manifest
81 # was dangerous; if /plc/data/var/lib/pgsql/data/base/1/16676 changed
82 # names from one RPM build to another, it would be rpmsaved and thus
83 # effectively deleted. Now we do not include these files in the
84 # manifest. However, to avoid deleting these files in the process of
85 # upgrading from one of these old versions of myplc, we must back up
86 # the database and /etc/planetlab and restore them after the old
87 # version has been uninstalled in %triggerpostun (also in %post, in
88 # case we are force upgrading to the same version).
89 #
90 # This code can be removed once all myplc-0.4-1 installations have
91 # been upgraded to at least myplc-0.4-2.
92
93 # 0 = install, 1 = upgrade
94 if [ $1 -gt 0 ] ; then
95     for dir in /var/lib/pgsql/data /etc/planetlab ; do
96         if [ -d /plc/data/$dir ] ; then
97             echo "Preserving /plc/data/$dir"
98             mkdir -p /plc/data/$dir.rpmsave
99             tar -C /plc/data/$dir -cpf - . | \
100                tar -C /plc/data/$dir.rpmsave -xpf -
101
102             # Except for the default configuration file and DTD, which
103             # really should be considered for upgrade.
104             rm -f /plc/data/$dir.rpmsave/{default_config.xml,plc_config.dtd}
105         fi
106     done
107 fi
108
109 %post
110 if [ -x /sbin/chkconfig ] ; then
111     /sbin/chkconfig --add plc
112     /sbin/chkconfig plc on
113 fi
114
115 %triggerpostun -- %{name}
116 # 0 = erase, 1 = upgrade
117 if [ $1 -gt 0 ] ; then
118     for dir in /var/lib/pgsql/data /etc/planetlab ; do
119         if [ -d /plc/data/$dir.rpmsave -a -d /plc/data/$dir ] ; then
120             echo "Merging /plc/data/$dir"
121             if tar -C /plc/data/$dir.rpmsave -cpf - . | \
122                tar -C /plc/data/$dir -xpf - ; then
123                 rm -rf /plc/data/$dir.rpmsave
124             fi
125         fi
126     done
127 fi    
128
129 %preun
130 # 0 = erase, 1 = upgrade
131 if [ $1 -eq 0 ] ; then
132     %{_sysconfdir}/init.d/plc stop
133     if [ -x /sbin/chkconfig ] ; then
134         /sbin/chkconfig plc off
135         /sbin/chkconfig --del plc
136     fi
137 fi
138
139 %files
140 %defattr(-,root,root,-)
141 # Host startup script and configuration file
142 %{_sysconfdir}/init.d/plc
143 %{_sysconfdir}/sysconfig/plc
144
145 # Symlink to /etc/planetlab within data directory
146 %{_sysconfdir}/planetlab
147
148 # Root filesystem
149 /plc/root.img
150 /plc/root
151
152 # Data directory
153 %dir /plc/data
154 %config(noreplace) /plc/data/*
155
156 %changelog
157 * Fri Jan 19 2007 Mark Huang <mlhuang@CS.Princeton.EDU> - 0.5-3
158 - Split off myplc-devel into separate spec file, so that it can be
159   built standalone.
160
161 * Tue Aug 22 2006 Mark Huang <mlhuang@CS.Princeton.EDU> - 0.4-3, 0.5-3
162 - MyPLC 0.4 RC3.
163 - Fix upgrade path from RC1.
164 - Always regenerate plc_config.xml at first startup
165 - Upgrade kernel, iptables, vnet to 2.6.17-1.2142_FC4-3.planetlab
166 - Minor PlanetFlow fixes
167 - pl_mom/swapmon: Minor fixes
168 - bootcd: Added Supermicro IPMI support
169 - bootmanager: Cleanup, fixed check for new disks
170
171 * Wed Aug 09 2006 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
172 - introduces variable %{build_devel} to allow custom sites to skip building
173   the myplc-devel package.
174
175 * Thu Jul 13 2006 Mark Huang <mlhuang@CS.Princeton.EDU> - 0.4-2, 0.5-2
176 - MyPLC 0.4 RC2.
177 - Fix many spec files (License replaces Copyright).
178 - Fix kernel build under gcc32 (module verification bug).
179 - Fix vnet build under gcc32
180 - Fix PlanetFlow. MySQL RPM postinstall script no longer starts the
181   server. Also, get hostnames list from PLC_WWW_HOST, not
182   www.planet-lab.org.
183 - Fix pl_mom/bwmon to use cached values if NM is unresponsive
184 - Fix pl_mom/swapmon reset logic to avoid endless loops
185 - Remove ksymoops, add kernel-smp to standard PlanetLab package group
186 - Add kernel-smp boot support to bootmanager
187 - Add badblock search support to bootmanager
188 - Build development environment (myplc-devel). Add support for
189   building myplc itself inside myplc-devel.
190 - Move step-specific initialization to appropriate plc.d scripts
191 - Fix postgresql startup failure when bootstrapping
192 - Allow CA to be configured for each SSL certificate set. Stop doing
193   root CA stuff, this is outside the scope of MyPLC. MyPLC now only
194   generates self-signed certificates, but supports replacement of the
195   self-signed certificates with real certifcates signed by another CA,
196   as long as the CA is specified.
197 - Self-sign the MA/SA SSL certificate (and by extension, the MA/SA API
198   certificate).
199 - pl_mom: Workarounds for when NM queries time out.
200 - plc_api: Honor PLC_MAIL_ENABLED.
201
202 * Wed Jul  6 2006 Mark Huang <mlhuang@CS.Princeton.EDU> - 0.4-1, 0.5-1
203 - First stable release of MyPLC 0.4 RC1.
204
205 * Wed Apr  5 2006 Mark Huang <mlhuang@CS.Princeton.EDU> - 0.2-1
206 - Basic functionality complete. Consolidate into a single package
207   installed in /plc.
208
209 * Fri Mar 17 2006 Mark Huang <mlhuang@CS.Princeton.EDU> - 0.1-1
210 - Initial build.
211