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