pycurl & psycopg2 were made but not installed on fc4
[plcapi.git] / 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 # python-pycurl and python-psycopg2 avail. from fedora 5
59 # make sure to check build/<pldistro>/plc.pkgs
60 if [ "%{distrorelease}" -le 4 ] ; then
61     modules="psycopg2 pycurl"
62 else
63     modules=""
64 fi
65 # Build __init__.py metafiles and PHP API. 
66 %{__make} %{?_smp_mflags} subdirs="php php/xmlrpc" modules="$modules"
67 # Build documentation
68 # beware that making the pdf file somehow overwrites the html
69 %{__make} -C doc PLCAPI.pdf
70 rm -f doc/PLCAPI.html
71 %{__make} -C doc PLCAPI.html
72
73 %install
74 rm -rf $RPM_BUILD_ROOT
75 %{__make} %{?_smp_mflags} install DESTDIR="$RPM_BUILD_ROOT" datadir="%{_datadir}" bindir="%{_bindir}" modules="$modules"
76 #someone out there skips doc installation - we DO want this installed
77 for doc in PLCAPI.html PLCAPI.pdf ; do
78     install -D -m 644 doc/$doc $RPM_BUILD_ROOT/"%{_datadir}"/plc_api/doc/$doc
79 done
80
81 # Install shell symlink
82 mkdir -p $RPM_BUILD_ROOT/%{_bindir}
83 ln -s %{_datadir}/plc_api/plcsh $RPM_BUILD_ROOT/%{_bindir}/plcsh
84
85 mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/php.d
86 cat > $RPM_BUILD_ROOT/%{_sysconfdir}/php.d/xmlrpc.ini <<EOF
87 ; Enable xmlrpc extension module
88 extension=xmlrpc.so
89 EOF
90
91 %clean
92 rm -rf $RPM_BUILD_ROOT
93
94 %define php_extension_dir %(php-config --extension-dir)
95
96 %files
97 %defattr(-,root,root,-)
98 #someone out there skips doc installation - we DO want this installed
99 #%doc doc/PLCAPI.xml doc/PLCAPI.pdf doc/PLCAPI.html
100 %dir %{_datadir}/plc_api
101 %{_datadir}/plc_api/*
102 %{_bindir}/plcsh
103 %{php_extension_dir}/xmlrpc.so
104 %{_sysconfdir}/php.d/xmlrpc.ini
105 %{_bindir}/refresh-peer.py*
106
107 %changelog
108 * Fri Oct 27 2006 Mark Huang <mlhuang@CS.Princeton.EDU> - 
109 - Initial build.