Tagging module MyPLC - MyPLC-4.3-3
[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 3
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 * Tue Mar 24 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.3-3
199 - php include path tweaked for plekit includes
200 - reviewed myplc (fka native) packaging dependencies
201 - renumbered 4.3
202
203 * Thu Jan 29 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.3-2
204 - rename myplc into myplc-chroot and myplc-native into myplc
205 - new settings (shortname & hrn_root) for local peer
206
207 * Wed Sep 10 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.3-1
208 - First iteration of new data model
209 - Bunch of various fixes
210
211 * Tue May 20 2008 Faiyaz Ahmed <faiyaza@cs.princeton.edu> - MyPLC-4.2-15
212 - Removed proper ops from planetflow slice.
213
214 * Wed May 14 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-14
215 - myplc-native requires myplc-docs
216 - fixed doc build by locating locally installed DTDs at build-time
217
218 * Sun May 11 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-13
219 - turn myplc-docs off for now
220
221 * Sat May 10 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-12
222 - figures in doc package
223
224 * Fri May 09 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-11
225 - no more doc packaged outside of myplc-docs - doc/ cleaned up 
226 - chroot packaging does not have docs anymore
227 - 'cvs' and 'dev' not required from myplc-native anymore
228 - cosmetic change in kml output
229
230 * Thu May 08 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-10
231 - defaults for *_IP conf vars now void, expect more accurate /etc/hosts
232 - gethostbyname uses python rather than perl (hope this shrinks deps) 
233 - doc: reviewed myplc doc - deprecated everything related to myplc-devel
234 - doc: packaging doc in myplc-native (myplc&PLCAPI) & removed target files from svn
235 - make sync now works towards vserver-based myplc only 
236
237 * Mon May 05 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - MyPLC-4.2-9
238
239 - added vsys 'pfmount' script to the default netflow slice attributes.
240
241
242 * Thu Apr 24 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-8
243 - plc.d/bootcd step altered for handling legacy bootcd smooth migration
244 - to new bootcd packaging
245
246 * Wed Apr 23 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-7
247 - changes needed for bootcd 4.2 : new, possible multiple, installation locations, and new rpm name
248
249 * Tue Apr 22 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-6
250 - packaging of mplc-release in myplc-native
251 - sudoers.php is new to PlanetLabConf (needs nodeconfig-4.2-4)
252 - resolv file in /etc/resolv.conf, not plc_resolv.conf
253 - improved sirius script
254 - remove the 'driver' node-network-setting that was unused, and new 'Multihome' category
255 - expires more properly set 
256
257 * Mon Apr 07 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - MyPLC-4.2-4 MyPLC-4.2-5
258
259
260 * Wed Mar 26 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-3 MyPLC-4.2-4
261 - renew_reminder script moved to support-scripts/
262 - gen-aliases script added in support-scripts/
263 - sirius initscript moved to plc_sliceinitscripts (formerly inlined in db-config)
264 - plc-map script : no javascript for googlemap anymore, see new plc-kml script instead
265 - nodefamily-aware (creates legacy symlink /var/www/html/install-rpms/planetlab)
266 - new native slice attributes 'capabilities', 'vsys' and 'codemux'
267 - new setting 'Mom list address' for sending emails to a separate destination
268 - starts rsyslogd/syslogd as appropriate
269 - expects nodeconfig package (former PlanetLabConf/ dir from PLCWWW)
270 - convenience generation of yum.conf in resulting image based on build/mirroring
271
272 * Thu Feb 14 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - myplc-4.2-2 myplc-4.2-3
273 - refresh-peer.py removed (duplicate with PLCAPI)
274 - plc.d/ scripts cleaned up
275 - sirius initscript updated
276 - slice auto renewal fixed
277
278 * Fri Aug 31 2007 Marc E. Fiuczynski <mef@CS.Princeton.EDU>
279 - initial build.
280
281 %define module_current_branch 4.2