94cb7443498dd01a5ce05940d9604c76180cac52
[plcapi.git] / PLCAPI.spec
1 %define name PLCAPI
2 %define version 5.0
3 %define taglevel 25
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 * Sun Jan 23 2011 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - plcapi-5.0-25
148 - altered checking of optional fields in Interfaces
149 - UpdateTagType more picky on inputs - msg when trying to set roles, which is not supported
150 - has pyxml and python-simplejson as new deps
151
152 * Wed Dec 08 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - plcapi-5.0-24
153 - tweak doc extraction for fedora14
154
155 * Tue Dec 07 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - plcapi-5.0-23
156 - builtin accessors for the myslice page
157 - Get{Node,Interface}Tags allowed to techs
158 - tweak in ratelimitaspect.py
159
160 * Mon Dec 06 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - plcapi-5.0-22
161 - add admin role to accessor-related tags (arch, {fc,pl}distro)
162
163 * Mon Dec 06 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - plcapi-5.0-21
164 - bugfix in {Update,Delete}PersonTag
165 - updated xml doc for filters, accessors and tagtypes
166 - more explicit msg in case of missing roles
167 - improvements in ratelimitaspects.py
168
169 * Fri Dec 03 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - plcapi-5.0-20
170 - fix the roles for ssh_key and hmac tags
171
172 * Wed Dec 01 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - plcapi-5.0-19
173 - tag permissions system based on roles and not min_role_ids
174 - accessors simplified accordingly (no more min_role_id)
175 - new methods AddRoleToTagType and DeleteRoleFromTagType
176 - accessor-related tagtypes are created sooner, and enforced
177 - cleaned up redundancy between db-config.d and accessors
178
179 * Thu Sep 16 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - plcapi-5.0-18
180 - fix RefreshPeer that was not working in 5.0-17
181
182 * Thu Sep 16 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - plcapi-5.0-17
183 - RefreshPeer is able to cope with 2 peers running different releases of the api
184 - DeletePerson can be used on duplicates
185 - first appearance of ModPythonJson.py
186
187 * Wed Sep 01 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - plcapi-5.0-16
188 - set accessors return the new value
189 - tweaks in the pubsub groups management
190
191 * Wed Jul 28 2010 S.Çağlar Onur <caglar@cs.princeton.edu> - plcapi-5.0-15
192 - convert hostnames to lower case and use ILIKE instead of LIKE
193
194 * Fri Jul 16 2010 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - plcapi-5.0-14
195 - use hrn in pubsub groups
196
197 * Tue Jul 13 2010 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - plcapi-5.0-13
198 - - Add timestamps to Nodes, PCUs and Interfaces to make concrete statements about a node's configuration state.
199 - - OMF fixes
200
201 * Mon Jun 28 2010 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - PLCAPI-5.0-12
202 - automatically set vsys tag for omf controlled slices
203
204 * Sat Jun 26 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-5.0-11
205 - addition of the 'ssh_key' slice tag
206 - first draft of the LDAP interface
207
208 * Tue Jun 22 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-5.0-10
209 - reservation granularity defined in plc-config-tty (requires myplc 5.0.5)
210 - and readable through GetLeaseGranularity
211 - GetSlivers to expose reservation_policy and lease_granularity
212 - GetBootMedium fixed for reservable nodes
213 - tweaks in pcucontrol (requires pcucontrol-1.0-6)
214 - new Apache mod_wsgi python interface
215
216 * Fri May 14 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-5.0-9
217 - the leases system
218
219 * Wed Apr 14 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-5.0-8
220 - previous tag had gone wrong
221
222 * Wed Apr 14 2010 Talip Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - PLCAPI-5.0-6
223 - fix pubsub hostname
224
225 * Fri Apr 02 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-5.0-5
226 - tweaks for the omf support (xmpp groups and RC-controlled slices)
227 - BootNodeUpdate supports also ssh_rsa_key (and logs only changes)
228 - GetNodeFlavour exposes fcdistro
229
230 * Sun Mar 14 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-5.0-4
231 - do not use UpdateNode for handling the 'hrn' tag - should fix refresh peer & foreign nodes more generally
232
233 * Fri Mar 12 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-5.0-3
234 - slice tag 'omf_control' supported for getting OMF's resource controller shipped to slivers
235 - pyaspect hooks allow to  maintain the namespace xmpp groups
236 - new omf_slicemgr is a proxy to xmpp, used by these hooks
237 - nodes have their hrn exposed in the 'hrn' tag
238 - node hrn exposed in GetSlivers, as well as the overall xmpp config
239 - system slice 'drl' gets created by db-config
240 - daniel's changes to Filter for supporting wildcards in lists
241 - AddSliceTag consistency check tweaked
242
243 * Thu Feb 11 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-5.0-2
244 - major cleanup
245 - get rid of all 4.2-related legacy code
246 - reset the migrations code, planetlab5.sql somes with (5,100)
247 - uses hashlib module when available
248
249 * Fri Jan 29 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-5.0-1
250 - first working version of 5.0:
251 - pld.c/, db-config.d/ and nodeconfig/ scripts should now sit in the module they belong to
252 - nodefamily is 3-fold with pldistro-fcdistro-arch
253 - site and person tags
254 - new methods GetSliceFamily and GetNodeFlavour
255 - deprecated the dummynet stuff that were for the external dummyboxes
256 - tags definition : more consistency between db-config scripts and accessors
257 - (get accessor to create the tag type too if absent)
258 - logging an event for AddSliceToNodes
259
260 * Sat Jan 09 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-32
261 - support for fedora 12
262 - fix subtle bug in filtering with ] and quotes
263
264 * Fri Dec 18 2009 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - PLCAPI-4.3-31
265 - * patch for php-5.3 (the one in f12)
266 - * validate email addresses with regex
267 - * add PersonTags and SiteTags
268 - * add additional accessors for node tags (kvariant, serial, ..)
269
270 * Tue Nov 03 2009 Marc Fiuczynski <mef@cs.princeton.edu> - PLCAPI-4.3-30
271 - Redacting password, session, and authstring values from the event log.
272
273 * Mon Oct 19 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-29
274 - let AddSite set ext_consortium_id - required for the poorman registration pages
275 - drop version constraint on Requires: postgresql-python
276 - don't log system calls nor ReportRunLevel
277
278 * Thu Oct 15 2009 Daniel Hokka Zakrisson <daniel@hozac.com> - PLCAPI-4.3-28
279 - Fix requires for CentOS.
280
281 * Fri Oct 09 2009 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - PLCAPI-4.3-27
282 - Require postgresql 8.2 (for array operators && and @>)
283
284 * Thu Oct 08 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-26
285 - Filter now supports the | and & features to match in sequence values
286 - bugfix in the postgresql wrapper for sequence filter values
287 - reviewed GetSlivers to export admin keys more efficiently
288 - fix checking roles in UpdateSliceTag
289
290 * Sat Sep 26 2009 Marc Fiuczynski <mef@cs.princeton.edu> - PLCAPI-4.3-25
291 - - Some typos in the documentation were fixed.
292 - - UpdateSliceTag check if a node's min_role_id is >= (rather than >)
293 - to the tag's min_role_id.
294
295 * Fri Sep 18 2009 anil vengalil <avengali@sophia.inria.fr> - PLCAPI-4.3-24
296
297 * Mon Sep 07 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-23
298 - Ongoing work to add upcalls, using new SFA class
299 - new methods BindObjectToPeer, UnBindObjectFromPeer, still for SFA
300 - reviewed type-checking for the 3 taggable classes node-interface-slice
301 - cleanup ald dummynet stuff
302 - expose the 'extensions' accessors to the API
303 - tweaked checks in AddSliceTag
304 - GetPersons exposes roles by default
305 - bugfix in ReportRunLevel for non-string levels
306 - tweaks in GetSlivers ( seems that it now exposes the keys for the root context )
307
308 * Fri Jul 10 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-22
309 - new BindObjectToPeer method for sfa
310 - AddSliceTag and UpdateSliceTag open to the 'node' auth method with restrictions
311
312 * Wed Jul 01 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-21
313 - getbootmedium supports options as tags (serial, cramfs, kvariant, kargs, no-hangcheck )
314 - reportrunlevel logs its calls only when run_level changes
315 - pycurl more robust wrt to xmlrpclib.Transport
316
317 * Tue Jun 16 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-20
318 - produce a wsdl interface
319 - bugfix in getbootmedium for nodes with interface tags
320
321 * Sun Jun 07 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-19
322 - bugfix for some rare pattern-based filters
323
324 * Wed Jun 03 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-18
325 - improvements in the 4.2 legacy layer
326
327 * Sat May 30 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-17
328 - bugfix required for slice tags set on nodegroups
329
330 * Thu May 28 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-16
331 - more complete compatibility layer - second iteration, with legacy code isolated in Legacy/
332
333 * Tue May 26 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-15
334 - more powerful legacy layer with 4.2
335
336 * Fri May 15 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-14
337 - RefreshPeer sets lock per-peer to avoid multiple concurent instances
338 - migration script has an option for running interactively
339
340 * Wed May 06 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-13
341 - skips already added entries
342
343 * Tue Apr 28 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-12
344 - yet another set of fixes for external dummynet boxes
345
346 * Wed Apr 22 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-11
347 - GetDummyBoxMedium returns a base64-encoded boot image, doc is updated
348 - and tmp file is cleaned up
349
350 * Wed Apr 22 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-10
351 - restore missing ResolveSlices
352
353 * Mon Apr 20 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-9
354 - new method GetDummyBoxMedium
355
356 * Fri Apr 17 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-8
357 - remove duplicate in Methods/__init__ that was breaking build of myplc-docs
358
359 * Fri Apr 17 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-7
360 - support for external dummynet boxes back in 4.3 - first draft
361
362 * Thu Apr 09 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-6
363 - fixes for smooth federation between 4.2 and 4.3
364 - peername is not UNIQUE in schema anymore, was preventing delete/recreate
365
366 * Tue Apr 07 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-5
367 - support for BootCD variants (GetBootMedium ['variant:centos5'])
368 - fix corner case with filters like {'~slice_id':[]}
369 - fix transaction leak that caused the db connections pool to exhaust
370 - properly expose all methods, including Legacy/, and not only Methods/
371
372 * Tue Mar 24 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-4
373 - renumbered as 4.3
374 - nodes have new fields run_level (in addition to boot_state) and verified
375 - tweaked migration from 4.2
376 - tuned rpm dependencies
377 - doc generation more explicit about errors like missing python modules
378 - removed obsolete method GetSlicesMD5
379
380 * Wed Jan 28 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-3
381 - unified all tags
382 - renamed interface settings into interface tags and slice attributes into slice tags
383 - nodes have a node_type
384 - various changes on the way to 4.3
385
386 * Thu Nov 27 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-2
387 - Checkpointing : this version still has interface settings and slice attributes
388
389 * Wed Sep 10 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-1
390 - first iteration with taggable nodes/interfaces/slices
391 - embryo for ilinks
392 - cleaned up boot states
393 - migration script moslty complete
394
395 * Wed May 14 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.2-8
396 - fixed doc build by locating locally installed DTDs at build-time
397
398 * Fri May 09 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.2-7
399 - no more doc packaged outside of myplc-docs - doc/ cleaned up
400 - enhancements in doc on filters 
401 - bootcd-aware GetBootMedium merged from onelab
402
403 * Thu May 08 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.2-6
404 - checkpoint while the new myplc-docs package is underway
405 - bugfix: GetSlivers & conf files
406 - doc: removed target files 
407
408 * Wed Apr 23 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - PLCAPI-4.2-5
409 - Removed conditions on the persons, site, and nodes indexes.  previsouly only
410 - the non-deleted fields were index, resulting in massivly slow queries.
411
412
413 * Wed Mar 26 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.2-3 PLCAPI-4.2-4
414 - plcsh: better handling of options when running as a shell script
415 - getbootmedium exports compute_key
416 - tweaks for accepted args in GetPCUTypes and BootNotifyOwners
417
418 * Thu Feb 14 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.2-2 PLCAPI-4.2-3
419 - GetBootMedium support for build.sh full options, incl. serial & console_spec 
420 - GetBootMedium simpler, cleaner and safer use of tmpdirs in (dated from bootcustom.sh)
421
422 * Fri Feb 01 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.2-1 PLCAPI-4.2-2
423 - refresh peer script to use a month-dependent logfile
424 - tracking the starting point for UniPi integration of the dummynet boxes
425
426 * Thu Jan 31 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.2-0 PLCAPI-4.2-1
427 - plcsh adds its own path to sys.path
428 - fix so GetNodes can be called from a Node
429
430 * Fri Oct 27 2006 Mark Huang <mlhuang@CS.Princeton.EDU> - 
431 - Initial build.
432
433 %define module_current_branch 4.3