[minor] add required build deps.
[plcapi.git] / PLCAPI.spec
1 %define url $URL$
2
3 %define name PLCAPI
4 %define version 5.0
5 %define taglevel 24
6
7 %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
8
9 Summary: PlanetLab Central API
10 Name: %{name}
11 Version: %{version}
12 Release: %{release}
13 License: PlanetLab
14 Group: System Environment/Daemons
15 Source0: %{name}-%{version}.tar.gz
16 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
17
18 Vendor: PlanetLab
19 Packager: PlanetLab Central <support@planet-lab.org>
20 Distribution: PlanetLab %{plrelease}
21 URL: %(echo %{url} | cut -d ' ' -f 2)
22
23 Obsoletes: plcapilib
24
25 # We use set everywhere
26 Requires: python >= 2.4
27 Requires: postgresql >= 8.2, postgresql-server >= 8.2
28 Requires: postgresql-python
29 Requires: python-psycopg2
30 Requires: python-pycurl
31 Requires: httpd
32 Requires: mod_python
33 # mod_wsgi will replace mod_python when we are ready
34 Requires: mod_wsgi
35 Requires: mod_ssl
36 Requires: SOAPpy
37 Requires: python-simplejson
38 # for the RebootNodeWithPCU method
39 Requires: pcucontrol >= 1.0-6
40 # for OMF integration
41 Requires: pyaspects >= 0.4
42 Requires: python-twisted-words
43 Requires: python-twisted-web
44 # ldap
45 Requires: python-ldap
46 # for memcache
47 Requires: python-memcached
48 Requires: memcached
49 ### avoid having yum complain about updates, as stuff is moving around
50 # plc.d/api
51 Conflicts: MyPLC <= 4.3
52
53 # We use psycopg2
54 #
55 # but we don't need to rebuild it as we depend on distro's packages - baris
56 # BuildRequires: postgresql-devel
57
58 # Standard xmlrpc.so that ships with PHP does not marshal NULL
59 BuildRequires: php-devel PyXML python-simplejson
60 Obsoletes: php-xmlrpc
61 Provides: php-xmlrpc
62
63 # PostgreSQL and SOAPpy are necessary to run the API server, but not
64 # plcsh. Since the only supported method of running the server is via
65 # MyPLC anyway, don't be so stringent about binary requirements, in
66 # case people want to install this package just for plcsh.
67 # Requires: postgresql-server, SOAPpy
68 AutoReqProv: no
69
70 %description
71 The PLCAPI package provides an XML-RPC and SOAP API for accessing the
72 PlanetLab Central (PLC) database. The API may be accessed directly via
73 the Python shell program plcsh, through a toy standalone server, or
74 through Apache mod_python.
75
76 %prep
77 %setup -q
78
79 %build
80 # python-pycurl and python-psycopg2 avail. from fedora 5
81 # we used to ship our own version of psycopg2 and pycurl, for fedora4
82 # starting with 4.3, support for these two modules is taken out
83
84 # Build __init__.py metafiles and PHP API. 
85 %{__make} %{?_smp_mflags}
86 %{__make} -C wsdl
87
88 %install
89 rm -rf $RPM_BUILD_ROOT
90 %{__make} %{?_smp_mflags} install DESTDIR="$RPM_BUILD_ROOT" datadir="%{_datadir}" bindir="%{_bindir}"
91
92 # Install shell symlink
93 mkdir -p $RPM_BUILD_ROOT/%{_bindir}
94 ln -s %{_datadir}/plc_api/plcsh $RPM_BUILD_ROOT/%{_bindir}/plcsh
95
96 mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/php.d
97 cat > $RPM_BUILD_ROOT/%{_sysconfdir}/php.d/xmlrpc.ini <<EOF
98 ; Enable xmlrpc extension module
99 extension=xmlrpc.so
100 EOF
101
102 # Install initscripts
103 echo "* Installing initscripts"
104 find plc.d | cpio -p -d -u ${RPM_BUILD_ROOT}/etc/
105 chmod 755 ${RPM_BUILD_ROOT}/etc/plc.d/*
106
107 # Install db-config.d files
108 echo "* Installing db-config.d files"
109 mkdir -p ${RPM_BUILD_ROOT}/etc/planetlab/db-config.d
110 cp db-config.d/* ${RPM_BUILD_ROOT}/etc/planetlab/db-config.d
111 chmod 444 ${RPM_BUILD_ROOT}/etc/planetlab/db-config.d/*
112
113 # Install wsdl
114 echo "* Installing wsdl"
115 install -D -m 644 wsdl/plcapi.wsdl $RPM_BUILD_ROOT/var/www/html/wsdl/plcapi.wsdl
116
117 # Install omf_slicemgr.py
118 install -D -m 755 omf/omf_slicemgr.py $RPM_BUILD_ROOT/usr/bin/omf_slicemgr.py
119 install -D -m 755 omf/reset_xmpp_pubsub_nodes.py $RPM_BUILD_ROOT/usr/bin/reset_xmpp_pubsub_nodes.py
120 mkdir -p $RPM_BUILD_ROOT/var/log/omf
121
122 # Install ratelimit log
123 touch $RPM_BUILD_ROOT/var/log/plc_api_ratelimit.log
124 chown apache:apache $RPM_BUILD_ROOT/var/log/plc_api_ratelimit.log
125
126 %clean
127 rm -rf $RPM_BUILD_ROOT
128
129 %define php_extension_dir %(php-config --extension-dir)
130
131 %files
132 %defattr(-,root,root,-)
133 %dir %{_datadir}/plc_api
134 %dir /var/log/omf/
135 %{_datadir}/plc_api/*
136 %{_bindir}/plcsh
137 %{php_extension_dir}/xmlrpc.so
138 %{_sysconfdir}/php.d/xmlrpc.ini
139 %config (noreplace) %{_datadir}/plc_api/PLC/Accessors/Accessors_site.py
140 /etc/plc.d
141 /etc/planetlab/db-config.d
142 /var/www/html/wsdl/plcapi.wsdl
143 /usr/bin/omf_slicemgr.py*
144 /usr/bin/reset_xmpp_pubsub_nodes.py*
145 /var/log/plc_api_ratelimit.log
146
147
148 %changelog
149 * Wed Dec 08 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - plcapi-5.0-24
150 - tweak doc extraction for fedora14
151
152 * Tue Dec 07 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - plcapi-5.0-23
153 - builtin accessors for the myslice page
154 - Get{Node,Interface}Tags allowed to techs
155 - tweak in ratelimitaspect.py
156
157 * Mon Dec 06 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - plcapi-5.0-22
158 - add admin role to accessor-related tags (arch, {fc,pl}distro)
159
160 * Mon Dec 06 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - plcapi-5.0-21
161 - bugfix in {Update,Delete}PersonTag
162 - updated xml doc for filters, accessors and tagtypes
163 - more explicit msg in case of missing roles
164 - improvements in ratelimitaspects.py
165
166 * Fri Dec 03 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - plcapi-5.0-20
167 - fix the roles for ssh_key and hmac tags
168
169 * Wed Dec 01 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - plcapi-5.0-19
170 - tag permissions system based on roles and not min_role_ids
171 - accessors simplified accordingly (no more min_role_id)
172 - new methods AddRoleToTagType and DeleteRoleFromTagType
173 - accessor-related tagtypes are created sooner, and enforced
174 - cleaned up redundancy between db-config.d and accessors
175
176 * Thu Sep 16 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - plcapi-5.0-18
177 - fix RefreshPeer that was not working in 5.0-17
178
179 * Thu Sep 16 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - plcapi-5.0-17
180 - RefreshPeer is able to cope with 2 peers running different releases of the api
181 - DeletePerson can be used on duplicates
182 - first appearance of ModPythonJson.py
183
184 * Wed Sep 01 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - plcapi-5.0-16
185 - set accessors return the new value
186 - tweaks in the pubsub groups management
187
188 * Wed Jul 28 2010 S.Çağlar Onur <caglar@cs.princeton.edu> - plcapi-5.0-15
189 - convert hostnames to lower case and use ILIKE instead of LIKE
190
191 * Fri Jul 16 2010 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - plcapi-5.0-14
192 - use hrn in pubsub groups
193
194 * Tue Jul 13 2010 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - plcapi-5.0-13
195 - - Add timestamps to Nodes, PCUs and Interfaces to make concrete statements about a node's configuration state.
196 - - OMF fixes
197
198 * Mon Jun 28 2010 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - PLCAPI-5.0-12
199 - automatically set vsys tag for omf controlled slices
200
201 * Sat Jun 26 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-5.0-11
202 - addition of the 'ssh_key' slice tag
203 - first draft of the LDAP interface
204
205 * Tue Jun 22 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-5.0-10
206 - reservation granularity defined in plc-config-tty (requires myplc 5.0.5)
207 - and readable through GetLeaseGranularity
208 - GetSlivers to expose reservation_policy and lease_granularity
209 - GetBootMedium fixed for reservable nodes
210 - tweaks in pcucontrol (requires pcucontrol-1.0-6)
211 - new Apache mod_wsgi python interface
212
213 * Fri May 14 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-5.0-9
214 - the leases system
215
216 * Wed Apr 14 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-5.0-8
217 - previous tag had gone wrong
218
219 * Wed Apr 14 2010 Talip Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - PLCAPI-5.0-6
220 - fix pubsub hostname
221
222 * Fri Apr 02 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-5.0-5
223 - tweaks for the omf support (xmpp groups and RC-controlled slices)
224 - BootNodeUpdate supports also ssh_rsa_key (and logs only changes)
225 - GetNodeFlavour exposes fcdistro
226
227 * Sun Mar 14 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-5.0-4
228 - do not use UpdateNode for handling the 'hrn' tag - should fix refresh peer & foreign nodes more generally
229
230 * Fri Mar 12 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-5.0-3
231 - slice tag 'omf_control' supported for getting OMF's resource controller shipped to slivers
232 - pyaspect hooks allow to  maintain the namespace xmpp groups
233 - new omf_slicemgr is a proxy to xmpp, used by these hooks
234 - nodes have their hrn exposed in the 'hrn' tag
235 - node hrn exposed in GetSlivers, as well as the overall xmpp config
236 - system slice 'drl' gets created by db-config
237 - daniel's changes to Filter for supporting wildcards in lists
238 - AddSliceTag consistency check tweaked
239
240 * Thu Feb 11 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-5.0-2
241 - major cleanup
242 - get rid of all 4.2-related legacy code
243 - reset the migrations code, planetlab5.sql somes with (5,100)
244 - uses hashlib module when available
245
246 * Fri Jan 29 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-5.0-1
247 - first working version of 5.0:
248 - pld.c/, db-config.d/ and nodeconfig/ scripts should now sit in the module they belong to
249 - nodefamily is 3-fold with pldistro-fcdistro-arch
250 - site and person tags
251 - new methods GetSliceFamily and GetNodeFlavour
252 - deprecated the dummynet stuff that were for the external dummyboxes
253 - tags definition : more consistency between db-config scripts and accessors
254 - (get accessor to create the tag type too if absent)
255 - logging an event for AddSliceToNodes
256
257 * Sat Jan 09 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-32
258 - support for fedora 12
259 - fix subtle bug in filtering with ] and quotes
260
261 * Fri Dec 18 2009 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - PLCAPI-4.3-31
262 - * patch for php-5.3 (the one in f12)
263 - * validate email addresses with regex
264 - * add PersonTags and SiteTags
265 - * add additional accessors for node tags (kvariant, serial, ..)
266
267 * Tue Nov 03 2009 Marc Fiuczynski <mef@cs.princeton.edu> - PLCAPI-4.3-30
268 - Redacting password, session, and authstring values from the event log.
269
270 * Mon Oct 19 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-29
271 - let AddSite set ext_consortium_id - required for the poorman registration pages
272 - drop version constraint on Requires: postgresql-python
273 - don't log system calls nor ReportRunLevel
274
275 * Thu Oct 15 2009 Daniel Hokka Zakrisson <daniel@hozac.com> - PLCAPI-4.3-28
276 - Fix requires for CentOS.
277
278 * Fri Oct 09 2009 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - PLCAPI-4.3-27
279 - Require postgresql 8.2 (for array operators && and @>)
280
281 * Thu Oct 08 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-26
282 - Filter now supports the | and & features to match in sequence values
283 - bugfix in the postgresql wrapper for sequence filter values
284 - reviewed GetSlivers to export admin keys more efficiently
285 - fix checking roles in UpdateSliceTag
286
287 * Sat Sep 26 2009 Marc Fiuczynski <mef@cs.princeton.edu> - PLCAPI-4.3-25
288 - - Some typos in the documentation were fixed.
289 - - UpdateSliceTag check if a node's min_role_id is >= (rather than >)
290 - to the tag's min_role_id.
291
292 * Fri Sep 18 2009 anil vengalil <avengali@sophia.inria.fr> - PLCAPI-4.3-24
293
294 * Mon Sep 07 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-23
295 - Ongoing work to add upcalls, using new SFA class
296 - new methods BindObjectToPeer, UnBindObjectFromPeer, still for SFA
297 - reviewed type-checking for the 3 taggable classes node-interface-slice
298 - cleanup ald dummynet stuff
299 - expose the 'extensions' accessors to the API
300 - tweaked checks in AddSliceTag
301 - GetPersons exposes roles by default
302 - bugfix in ReportRunLevel for non-string levels
303 - tweaks in GetSlivers ( seems that it now exposes the keys for the root context )
304
305 * Fri Jul 10 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-22
306 - new BindObjectToPeer method for sfa
307 - AddSliceTag and UpdateSliceTag open to the 'node' auth method with restrictions
308
309 * Wed Jul 01 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-21
310 - getbootmedium supports options as tags (serial, cramfs, kvariant, kargs, no-hangcheck )
311 - reportrunlevel logs its calls only when run_level changes
312 - pycurl more robust wrt to xmlrpclib.Transport
313
314 * Tue Jun 16 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-20
315 - produce a wsdl interface
316 - bugfix in getbootmedium for nodes with interface tags
317
318 * Sun Jun 07 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-19
319 - bugfix for some rare pattern-based filters
320
321 * Wed Jun 03 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-18
322 - improvements in the 4.2 legacy layer
323
324 * Sat May 30 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-17
325 - bugfix required for slice tags set on nodegroups
326
327 * Thu May 28 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-16
328 - more complete compatibility layer - second iteration, with legacy code isolated in Legacy/
329
330 * Tue May 26 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-15
331 - more powerful legacy layer with 4.2
332
333 * Fri May 15 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-14
334 - RefreshPeer sets lock per-peer to avoid multiple concurent instances
335 - migration script has an option for running interactively
336
337 * Wed May 06 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-13
338 - skips already added entries
339
340 * Tue Apr 28 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-12
341 - yet another set of fixes for external dummynet boxes
342
343 * Wed Apr 22 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-11
344 - GetDummyBoxMedium returns a base64-encoded boot image, doc is updated
345 - and tmp file is cleaned up
346
347 * Wed Apr 22 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-10
348 - restore missing ResolveSlices
349
350 * Mon Apr 20 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-9
351 - new method GetDummyBoxMedium
352
353 * Fri Apr 17 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-8
354 - remove duplicate in Methods/__init__ that was breaking build of myplc-docs
355
356 * Fri Apr 17 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-7
357 - support for external dummynet boxes back in 4.3 - first draft
358
359 * Thu Apr 09 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-6
360 - fixes for smooth federation between 4.2 and 4.3
361 - peername is not UNIQUE in schema anymore, was preventing delete/recreate
362
363 * Tue Apr 07 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-5
364 - support for BootCD variants (GetBootMedium ['variant:centos5'])
365 - fix corner case with filters like {'~slice_id':[]}
366 - fix transaction leak that caused the db connections pool to exhaust
367 - properly expose all methods, including Legacy/, and not only Methods/
368
369 * Tue Mar 24 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-4
370 - renumbered as 4.3
371 - nodes have new fields run_level (in addition to boot_state) and verified
372 - tweaked migration from 4.2
373 - tuned rpm dependencies
374 - doc generation more explicit about errors like missing python modules
375 - removed obsolete method GetSlicesMD5
376
377 * Wed Jan 28 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-3
378 - unified all tags
379 - renamed interface settings into interface tags and slice attributes into slice tags
380 - nodes have a node_type
381 - various changes on the way to 4.3
382
383 * Thu Nov 27 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-2
384 - Checkpointing : this version still has interface settings and slice attributes
385
386 * Wed Sep 10 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-1
387 - first iteration with taggable nodes/interfaces/slices
388 - embryo for ilinks
389 - cleaned up boot states
390 - migration script moslty complete
391
392 * Wed May 14 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.2-8
393 - fixed doc build by locating locally installed DTDs at build-time
394
395 * Fri May 09 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.2-7
396 - no more doc packaged outside of myplc-docs - doc/ cleaned up
397 - enhancements in doc on filters 
398 - bootcd-aware GetBootMedium merged from onelab
399
400 * Thu May 08 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.2-6
401 - checkpoint while the new myplc-docs package is underway
402 - bugfix: GetSlivers & conf files
403 - doc: removed target files 
404
405 * Wed Apr 23 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - PLCAPI-4.2-5
406 - Removed conditions on the persons, site, and nodes indexes.  previsouly only
407 - the non-deleted fields were index, resulting in massivly slow queries.
408
409
410 * Wed Mar 26 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.2-3 PLCAPI-4.2-4
411 - plcsh: better handling of options when running as a shell script
412 - getbootmedium exports compute_key
413 - tweaks for accepted args in GetPCUTypes and BootNotifyOwners
414
415 * Thu Feb 14 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.2-2 PLCAPI-4.2-3
416 - GetBootMedium support for build.sh full options, incl. serial & console_spec 
417 - GetBootMedium simpler, cleaner and safer use of tmpdirs in (dated from bootcustom.sh)
418
419 * Fri Feb 01 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.2-1 PLCAPI-4.2-2
420 - refresh peer script to use a month-dependent logfile
421 - tracking the starting point for UniPi integration of the dummynet boxes
422
423 * Thu Jan 31 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.2-0 PLCAPI-4.2-1
424 - plcsh adds its own path to sys.path
425 - fix so GetNodes can be called from a Node
426
427 * Fri Oct 27 2006 Mark Huang <mlhuang@CS.Princeton.EDU> - 
428 - Initial build.
429
430 %define module_current_branch 4.3