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