Merge remote-tracking branch 'origin/pycurl' into planetlab-4_0-branch
[plcapi.git] / trunk / PLCAPI.spec
1 #
2 # $Id$
3 #
4
5 %define url $URL$
6
7 %define name PLCAPI
8 %define version 4.2
9 %define subversion 0
10
11 %define release %{subversion}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
12
13 Summary: PlanetLab Central API
14 Name: %{name}
15 Version: %{version}
16 Release: %{release}
17 License: PlanetLab
18 Group: System Environment/Daemons
19 Source0: %{name}-%{version}.tar.gz
20 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
21 URL: %(echo %{url} | cut -d ' ' -f 2)
22
23 Obsoletes: plcapilib
24
25 # We use set everywhere
26 Requires: python >= 2.4
27
28 # We use psycopg2
29 BuildRequires: postgresql-devel
30
31 # Standard xmlrpc.so that ships with PHP does not marshal NULL
32 BuildRequires: php-devel
33 Obsoletes: php-xmlrpc
34 Provides: php-xmlrpc
35
36 # OpenJade does not honor XML catalog files and tries to access
37 # www.oasis-open.org even if DTDs are locally installed. Disable
38 # documentation generation for now.
39 # BuildRequires: docbook-dtds, docbook-utils-pdf
40
41 # PostgreSQL and SOAPpy are necessary to run the API server, but not
42 # plcsh. Since the only supported method of running the server is via
43 # MyPLC anyway, don't be so stringent about binary requirements, in
44 # case people want to install this package just for plcsh.
45 # Requires: postgresql-server, SOAPpy
46 AutoReqProv: no
47
48 %description
49 The PLCAPI package provides an XML-RPC and SOAP API for accessing the
50 PlanetLab Central (PLC) database. The API may be accessed directly via
51 the Python shell program plcsh, through a toy standalone server, or
52 through Apache mod_python.
53
54 %prep
55 %setup -q
56
57 %build
58 # Build __init__.py metafiles and PHP API. 
59 %{__make} %{?_smp_mflags} subdirs="php php/xmlrpc"
60 # Build documentation
61 # beware that making the pdf file somehow overwrites the html
62 %{__make} -C doc PLCAPI.pdf
63 rm -f doc/PLCAPI.html
64 %{__make} -C doc PLCAPI.html
65
66 %install
67 rm -rf $RPM_BUILD_ROOT
68 %{__make} %{?_smp_mflags} install DESTDIR="$RPM_BUILD_ROOT" datadir="%{_datadir}" bindir="%{_bindir}"
69 #someone out there skips doc installation - we DO want this installed
70 for doc in PLCAPI.html PLCAPI.pdf ; do
71     install -D -m 644 doc/$doc $RPM_BUILD_ROOT/"%{_datadir}"/plc_api/doc/$doc
72 done
73
74 # Install shell symlink
75 mkdir -p $RPM_BUILD_ROOT/%{_bindir}
76 ln -s %{_datadir}/plc_api/plcsh $RPM_BUILD_ROOT/%{_bindir}/plcsh
77
78 mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/php.d
79 cat > $RPM_BUILD_ROOT/%{_sysconfdir}/php.d/xmlrpc.ini <<EOF
80 ; Enable xmlrpc extension module
81 extension=xmlrpc.so
82 EOF
83
84 %clean
85 rm -rf $RPM_BUILD_ROOT
86
87 %define php_extension_dir %(php-config --extension-dir)
88
89 %files
90 %defattr(-,root,root,-)
91 #someone out there skips doc installation - we DO want this installed
92 #%doc doc/PLCAPI.xml doc/PLCAPI.pdf doc/PLCAPI.html
93 %dir %{_datadir}/plc_api
94 %{_datadir}/plc_api/*
95 %{_bindir}/plcsh
96 %{php_extension_dir}/xmlrpc.so
97 %{_sysconfdir}/php.d/xmlrpc.ini
98 %{_bindir}/refresh-peer.py*
99
100 %changelog
101 * Fri Oct 27 2006 Mark Huang <mlhuang@CS.Princeton.EDU> - 
102 - Initial build.