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