adaf3d3d4ca1b12adb41cd0e2db4b79203dabe06
[plcapi.git] / PLCAPI.spec
1 #
2 # $Id$
3 #
4
5 %define url $URL$
6
7 %define name PLCAPI
8 # this branch was created from tag PLCAPI-4.2-2 
9 %define version dummynet
10 %define taglevel 1
11
12 %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
13
14 Summary: PlanetLab Central API
15 Name: %{name}
16 Version: %{version}
17 Release: %{release}
18 License: PlanetLab
19 Group: System Environment/Daemons
20 Source0: %{name}-%{version}.tar.gz
21 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
22
23 Vendor: PlanetLab
24 Packager: PlanetLab Central <support@planet-lab.org>
25 Distribution: PlanetLab %{plrelease}
26 URL: %(echo %{url} | cut -d ' ' -f 2)
27
28 Obsoletes: plcapilib
29
30 # We use set everywhere
31 Requires: python >= 2.4
32
33 # We use psycopg2
34 BuildRequires: postgresql-devel
35
36 # Standard xmlrpc.so that ships with PHP does not marshal NULL
37 BuildRequires: php-devel
38 Obsoletes: php-xmlrpc
39 Provides: php-xmlrpc
40
41 # OpenJade does not honor XML catalog files and tries to access
42 # www.oasis-open.org even if DTDs are locally installed. Disable
43 # documentation generation for now.
44 # BuildRequires: docbook-dtds, docbook-utils-pdf
45
46 # PostgreSQL and SOAPpy are necessary to run the API server, but not
47 # plcsh. Since the only supported method of running the server is via
48 # MyPLC anyway, don't be so stringent about binary requirements, in
49 # case people want to install this package just for plcsh.
50 # Requires: postgresql-server, SOAPpy
51 AutoReqProv: no
52
53 %description
54 The PLCAPI package provides an XML-RPC and SOAP API for accessing the
55 PlanetLab Central (PLC) database. The API may be accessed directly via
56 the Python shell program plcsh, through a toy standalone server, or
57 through Apache mod_python.
58
59 %prep
60 %setup -q
61
62 %build
63 # python-pycurl and python-psycopg2 avail. from fedora 5
64 # make sure to check build/<pldistro>/plc.pkgs
65 if [ "%{distrorelease}" -le 4 ] ; then
66     modules="psycopg2 pycurl"
67 else
68     modules=""
69 fi
70 # Build __init__.py metafiles and PHP API. 
71 %{__make} %{?_smp_mflags} subdirs="php php/xmlrpc" modules="$modules"
72 # Build documentation
73 # beware that making the pdf file somehow overwrites the html
74 %{__make} -C doc PLCAPI.pdf
75 rm -f doc/PLCAPI.html
76 %{__make} -C doc PLCAPI.html
77
78 %install
79 rm -rf $RPM_BUILD_ROOT
80 if [ "%{distrorelease}" -le 4 ] ; then
81     modules="psycopg2 pycurl"
82 else
83     modules=""
84 fi
85 %{__make} %{?_smp_mflags} install DESTDIR="$RPM_BUILD_ROOT" datadir="%{_datadir}" bindir="%{_bindir}" modules="$modules"
86 #someone out there skips doc installation - we DO want this installed
87 for doc in PLCAPI.html PLCAPI.pdf ; do
88     install -D -m 644 doc/$doc $RPM_BUILD_ROOT/"%{_datadir}"/plc_api/doc/$doc
89 done
90
91 # Install shell symlink
92 mkdir -p $RPM_BUILD_ROOT/%{_bindir}
93 ln -s %{_datadir}/plc_api/plcsh $RPM_BUILD_ROOT/%{_bindir}/plcsh
94
95 mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/php.d
96 cat > $RPM_BUILD_ROOT/%{_sysconfdir}/php.d/xmlrpc.ini <<EOF
97 ; Enable xmlrpc extension module
98 extension=xmlrpc.so
99 EOF
100
101 %clean
102 rm -rf $RPM_BUILD_ROOT
103
104 %define php_extension_dir %(php-config --extension-dir)
105
106 %files
107 %defattr(-,root,root,-)
108 #someone out there skips doc installation - we DO want this installed
109 #%doc doc/PLCAPI.xml doc/PLCAPI.pdf doc/PLCAPI.html
110 %dir %{_datadir}/plc_api
111 %{_datadir}/plc_api/*
112 %{_bindir}/plcsh
113 %{php_extension_dir}/xmlrpc.so
114 %{_sysconfdir}/php.d/xmlrpc.ini
115 %{_bindir}/refresh-peer.py*
116
117 %changelog
118 * Fri Feb 01 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.2-1 PLCAPI-4.2-2
119 - refresh peer script to use a month-dependent logfile
120 - tracking the starting point for UniPi integration of the dummynet boxes
121
122 * Thu Jan 31 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.2-0 PLCAPI-4.2-1
123 - plcsh adds its own path to sys.path
124 - fix so GetNodes can be called from a Node
125
126 * Fri Oct 27 2006 Mark Huang <mlhuang@CS.Princeton.EDU> - 
127 - Initial build.