still for fc4 - the fix this morning was not enough
[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 if [ "%{distrorelease}" -le 4 ] ; then
76     modules="psycopg2 pycurl"
77 else
78     modules=""
79 fi
80 %{__make} %{?_smp_mflags} install DESTDIR="$RPM_BUILD_ROOT" datadir="%{_datadir}" bindir="%{_bindir}" modules="$modules"
81 #someone out there skips doc installation - we DO want this installed
82 for doc in PLCAPI.html PLCAPI.pdf ; do
83     install -D -m 644 doc/$doc $RPM_BUILD_ROOT/"%{_datadir}"/plc_api/doc/$doc
84 done
85
86 # Install shell symlink
87 mkdir -p $RPM_BUILD_ROOT/%{_bindir}
88 ln -s %{_datadir}/plc_api/plcsh $RPM_BUILD_ROOT/%{_bindir}/plcsh
89
90 mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/php.d
91 cat > $RPM_BUILD_ROOT/%{_sysconfdir}/php.d/xmlrpc.ini <<EOF
92 ; Enable xmlrpc extension module
93 extension=xmlrpc.so
94 EOF
95
96 %clean
97 rm -rf $RPM_BUILD_ROOT
98
99 %define php_extension_dir %(php-config --extension-dir)
100
101 %files
102 %defattr(-,root,root,-)
103 #someone out there skips doc installation - we DO want this installed
104 #%doc doc/PLCAPI.xml doc/PLCAPI.pdf doc/PLCAPI.html
105 %dir %{_datadir}/plc_api
106 %{_datadir}/plc_api/*
107 %{_bindir}/plcsh
108 %{php_extension_dir}/xmlrpc.so
109 %{_sysconfdir}/php.d/xmlrpc.ini
110 %{_bindir}/refresh-peer.py*
111
112 %changelog
113 * Fri Oct 27 2006 Mark Huang <mlhuang@CS.Princeton.EDU> - 
114 - Initial build.