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