initial packaging of 0.6.1
[contrib/cloudeebus.git] / packaging / cloudeebus.spec
1 Name: cloudeebus
2 Summary: JavaScript bindings for D-Bus services
3 Version: 0.6.1
4 Release: 1
5 Group: Web Framework/Web Run Time
6 License: Apache-2.0
7 URL: https://01.org/cloudeebus
8 Source0: %{name}-%{version}.tar.gz
9 BuildRequires: python
10 Requires: pycrosswalk
11
12 # We only install noarch files, but have to use an arch directory for
13 # them because we need to link to an arch-specific .so file.
14 # Specifying this leads to only one warning, while adding it leads to
15 # one warning per file:
16 # BuildArch: noarch
17
18 %description
19 The %{name} package contains a Crosswalk extension implemented
20 in Python which dynamically creates JavaScript bindings for
21 D-Bus services.
22
23 %package examples
24 Summary: Example .html and run scripts for %{name}
25 Group: Web Framework/Web Run Time
26 Requires: %{name}
27
28 %description examples
29 The %{name} package contains .html files demonstrating how to use Cloudeebus
30 and shell scripts to run them under Crosswalk.
31
32 %prep
33 %setup -q -n %{name}-%{version}
34
35 %build
36 # regenerate bundled .js
37 make -C src/js clean all
38
39 %install
40 mkdir -p %{buildroot}%{_libdir}/tizen-extensions-crosswalk
41 for i in cloudeebusengine.py cloudeebus.js xwalkcloudeebus.py; do
42     install -p -m 644 cloudeebus/$i %{buildroot}%{_libdir}/tizen-extensions-crosswalk/$i
43 done
44 # The Crosswalk extension .so must be named like the corresponding .py
45 # file, to inform libpycrosswalk.so which Python file it needs to
46 # load.
47 ln -s %{_libdir}/pycrosswalk/libpycrosswalk.so %{buildroot}%{_libdir}/tizen-extensions-crosswalk/libxwalkcloudeebus.so
48
49 mkdir -p %{buildroot}%{_datadir}/doc/cloudeebus/agent
50 for i in client server; do
51     install -p -m 644 doc/agent/$i.html %{buildroot}%{_datadir}/doc/cloudeebus/agent/$i.html
52     cat >%{buildroot}%{_datadir}/doc/cloudeebus/agent/$i.sh <<EOF
53 #! /bin/sh
54 xwalk-launcher file://%{_datadir}/doc/cloudeebus/agent/$i.html
55 EOF
56     chmod 755 %{buildroot}%{_datadir}/doc/cloudeebus/agent/$i.sh
57 done
58
59 %files
60 %license LICENSE
61 %{_libdir}/tizen-extensions-crosswalk/cloudeebusengine.py
62 %{_libdir}/tizen-extensions-crosswalk/cloudeebus.js
63 %{_libdir}/tizen-extensions-crosswalk/xwalkcloudeebus.py
64 %{_libdir}/tizen-extensions-crosswalk/libxwalkcloudeebus.so
65
66 %files examples
67 %{_datadir}/doc/cloudeebus