Tagging module MyPLC - MyPLC-5.0-2
[myplc.git] / myplc.spec
1 #
2 # $Id$
3 #
4 %define url $URL$
5
6 %define name myplc
7 %define version 5.0
8 %define taglevel 2
9
10 %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
11
12 Summary: PlanetLab Central (PLC) Portable Installation
13 Name: %{name}
14 Version: %{version}
15 Release: %{release}
16 License: PlanetLab
17 Group: Applications/Systems
18 Source0: %{name}-%{version}.tar.gz
19 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
20 BuildArch: noarch
21
22 Vendor: PlanetLab
23 Packager: PlanetLab Central <support@planet-lab.org>
24 Distribution: PlanetLab %{plrelease}
25 URL: %(echo %{url} | cut -d ' ' -f 2)
26
27 Requires: bzip2
28 Requires: sendmail-cf
29 Requires: tar 
30 Requires: less
31 Requires: perl-GD
32 Requires: openssl
33 Requires: xmlsec1
34 Requires: gd
35 Requires: expect
36 Requires: php-pgsql
37 Requires: curl
38 Requires: python-pycurl
39 Requires: python-psycopg2
40 Requires: httpd
41 Requires: rsync
42 Requires: mod_python
43 Requires: mod_ssl
44 Requires: bootmanager
45 Requires: python-devel
46 Requires: SOAPpy
47 Requires: vixie-cron
48 Requires: yum
49 Requires: php-gd
50 Requires: PyXML
51 Requires: sendmail
52 Requires: python >= 2.4
53 Requires: createrepo
54 Requires: postgresql-python
55 Requires: cpio
56 Requires: postgresql-server
57 Requires: wget
58 Requires: php
59 Requires: xmlsec1-openssl
60 Requires: postgresql
61 Requires: openssh
62 Requires: bootcd-%{pldistro}-%{_arch}
63 Requires: dnsmasq
64 Requires: diffutils
65 Requires: gzip
66 Requires: vim-minimal
67 Requires: findutils
68 # planetlab stuff
69 Requires: PLCWWW
70 Requires: nodeconfig
71 Requires: PLCAPI
72 Requires: bootstrapfs-%{pldistro}-%{_arch}
73 Requires: myplc-docs
74 Requires: myplc-release
75
76 # argh - ugly - we might wish to use something from build/config.%{pldistro} instead
77 %if "%{pldistro}" == "onelab"
78 Requires: dummynet_image
79 %endif
80
81 %define debug_package %{nil}
82
83 %description
84 MyPLC is a complete PlanetLab Central (PLC) portable installation
85 contained within a chroot jail. The default installation consists of a
86 web server, an XML-RPC API server, a boot server, and a database
87 server: the core components of PLC. The installation may be customized
88 through a graphical interface. All PLC services are started up and
89 shut down through a single System V init script installed in the host
90 system.
91
92 %prep
93 %setup -q
94
95 %build
96
97 %install
98 pushd MyPLC
99 rm -rf $RPM_BUILD_ROOT
100 ./build.sh %{pldistro} $RPM_BUILD_ROOT
101 popd
102
103 %clean
104 rm -rf $RPM_BUILD_ROOT
105
106 # If run under sudo
107 if [ -n "$SUDO_USER" ] ; then
108     # Allow user to delete the build directory
109     chown -h -R $SUDO_USER .
110     # Some temporary cdroot files like /var/empty/sshd and
111     # /usr/bin/sudo get created with non-readable permissions.
112     find . -not -perm +0600 -exec chmod u+rw {} \;
113     # Allow user to delete the built RPM(s)
114     [ -d %{_rpmdir}/noarch ] && chown -h -R $SUDO_USER %{_rpmdir}/noarch
115 fi
116
117 %pre
118 if [ -x %{_sysconfdir}/init.d/plc ] ; then
119     %{_sysconfdir}/init.d/plc stop
120 fi
121
122 # Old versions of myplc used to ship with a bootstrapped database and
123 # /etc/planetlab directory. Including generated files in the manifest
124 # was dangerous; if /plc/data/var/lib/pgsql/data/base/1/16676 changed
125 # names from one RPM build to another, it would be rpmsaved and thus
126 # effectively deleted. Now we do not include these files in the
127 # manifest. However, to avoid deleting these files in the process of
128 # upgrading from one of these old versions of myplc, we must back up
129 # the database and /etc/planetlab and restore them after the old
130 # version has been uninstalled in %triggerpostun (also in %post, in
131 # case we are force upgrading to the same version).
132 #
133 # This code can be removed once all myplc-0.4-1 installations have
134 # been upgraded to at least myplc-0.4-2.
135
136 # 0 = install, 1 = upgrade
137 if [ $1 -gt 0 ] ; then
138     for dir in /var/lib/pgsql/data /etc/planetlab ; do
139         if [ -d $dir ] ; then
140             echo "Preserving $dir"
141             mkdir -p $dir.rpmsave
142             tar -C $dir -cpf - . | \
143                tar -C $dir.rpmsave -xpf -
144
145             # Except for the default configuration file and DTD, which
146             # really should be considered for upgrade.
147             rm -f $dir.rpmsave/{default_config.xml,plc_config.dtd}
148         fi
149     done
150 fi
151
152 %post
153 if [ -x /sbin/chkconfig ] ; then
154     /sbin/chkconfig --add plc
155     /sbin/chkconfig plc on
156 fi
157 pushd /usr/share/myplc &> /dev/null
158 python plc_config.py build
159 python plc_config.py install
160 popd &> /dev/null
161
162 %triggerpostun -- %{name}
163 # 0 = erase, 1 = upgrade
164 if [ $1 -gt 0 ] ; then
165     for dir in /var/lib/pgsql/data /etc/planetlab ; do
166         if [ -d $dir.rpmsave -a -d $dir ] ; then
167             echo "Merging $dir"
168             if tar -C $dir.rpmsave -cpf - . | \
169                tar -C $dir -xpf - ; then
170                 rm -rf $dir.rpmsave
171             fi
172         fi
173     done
174 fi    
175
176 %preun
177 # 0 = erase, 1 = upgrade
178 if [ $1 -eq 0 ] ; then
179     %{_sysconfdir}/init.d/plc stop
180     if [ -x /sbin/chkconfig ] ; then
181         /sbin/chkconfig plc off
182         /sbin/chkconfig --del plc
183     fi
184 fi
185
186 %files
187 %defattr(-,root,root,-)
188 # Host startup script and configuration file
189 /etc/init.d/plc
190 /etc/plc.d
191 /etc/planetlab
192 /etc/plc_sliceinitscripts/sirius
193 /etc/support-scripts/gen_aliases.py*
194 /etc/support-scripts/renew_reminder.py*
195 /etc/support-scripts/renew_reminder_logrotate
196 /usr/bin/plc-config
197 /usr/bin/plc-config-tty
198 /usr/bin/db-config
199 /usr/bin/dns-config
200 /usr/bin/plc-map.py*
201 /usr/bin/plc-kml.py*
202 /usr/bin/refresh-peer.py*
203 /usr/bin/clean-empty-dirs.py*
204 /usr/bin/mtail.py*
205 /usr/bin/check-ssl-peering.py*
206 /usr/share/myplc
207
208 %changelog
209 * Thu Jan 29 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-5.0-2
210 - rename myplc into myplc-chroot and myplc-native into myplc
211 - new settings (shortname & hrn_root) for local peer
212
213 * Wed Sep 10 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-5.0-1
214 - First iteration of new data model
215 - Bunch of various fixes
216
217 * Tue May 20 2008 Faiyaz Ahmed <faiyaza@cs.princeton.edu> - MyPLC-4.2-15
218 - Removed proper ops from planetflow slice.
219
220 * Wed May 14 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-14
221 - myplc-native requires myplc-docs
222 - fixed doc build by locating locally installed DTDs at build-time
223
224 * Sun May 11 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-13
225 - turn myplc-docs off for now
226
227 * Sat May 10 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-12
228 - figures in doc package
229
230 * Fri May 09 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-11
231 - no more doc packaged outside of myplc-docs - doc/ cleaned up 
232 - chroot packaging does not have docs anymore
233 - 'cvs' and 'dev' not required from myplc-native anymore
234 - cosmetic change in kml output
235
236 * Thu May 08 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-10
237 - defaults for *_IP conf vars now void, expect more accurate /etc/hosts
238 - gethostbyname uses python rather than perl (hope this shrinks deps) 
239 - doc: reviewed myplc doc - deprecated everything related to myplc-devel
240 - doc: packaging doc in myplc-native (myplc&PLCAPI) & removed target files from svn
241 - make sync now works towards vserver-based myplc only 
242
243 * Mon May 05 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - MyPLC-4.2-9
244
245 - added vsys 'pfmount' script to the default netflow slice attributes.
246
247
248 * Thu Apr 24 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-8
249 - plc.d/bootcd step altered for handling legacy bootcd smooth migration
250 - to new bootcd packaging
251
252 * Wed Apr 23 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-7
253 - changes needed for bootcd 4.2 : new, possible multiple, installation locations, and new rpm name
254
255 * Tue Apr 22 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-6
256 - packaging of mplc-release in myplc-native
257 - sudoers.php is new to PlanetLabConf (needs nodeconfig-4.2-4)
258 - resolv file in /etc/resolv.conf, not plc_resolv.conf
259 - improved sirius script
260 - remove the 'driver' node-network-setting that was unused, and new 'Multihome' category
261 - expires more properly set 
262
263 * Mon Apr 07 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - MyPLC-4.2-4 MyPLC-4.2-5
264
265
266 * Wed Mar 26 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-3 MyPLC-4.2-4
267 - renew_reminder script moved to support-scripts/
268 - gen-aliases script added in support-scripts/
269 - sirius initscript moved to plc_sliceinitscripts (formerly inlined in db-config)
270 - plc-map script : no javascript for googlemap anymore, see new plc-kml script instead
271 - nodefamily-aware (creates legacy symlink /var/www/html/install-rpms/planetlab)
272 - new native slice attributes 'capabilities', 'vsys' and 'codemux'
273 - new setting 'Mom list address' for sending emails to a separate destination
274 - starts rsyslogd/syslogd as appropriate
275 - expects nodeconfig package (former PlanetLabConf/ dir from PLCWWW)
276 - convenience generation of yum.conf in resulting image based on build/mirroring
277
278 * Thu Feb 14 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - myplc-4.2-2 myplc-4.2-3
279 - refresh-peer.py removed (duplicate with PLCAPI)
280 - plc.d/ scripts cleaned up
281 - sirius initscript updated
282 - slice auto renewal fixed
283
284 * Fri Aug 31 2007 Marc E. Fiuczynski <mef@CS.Princeton.EDU>
285 - initial build.
286
287 %define module_current_branch 4.2