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