*.swp
cscope.*
tags
+*.xml
--- /dev/null
+#!/bin/bash
+
+exec /usr/bin/tizen-extensions-crosswalk /usr/share/tizen-extensions-crosswalk/demos/tizen/bluetooth.html
--- /dev/null
+#!/bin/bash
+
+exec /usr/bin/tizen-extensions-crosswalk /usr/share/tizen-extensions-crosswalk/examples/index.html
+%define _manifestdir /opt/share/packages
+%define _desktop_icondir /opt/share/icons/default/small
+%define _bluetooth_demo_package tizen-extensions-crosswalk-bluetooth-demo
+%define _examples_package tizen-extensions-crosswalk-examples
+
Name: tizen-extensions-crosswalk
Version: 0.2
Release: 0
URL: https://github.com/otcshare/tizen-extensions-crosswalk
Source0: %{name}-%{version}.tar.gz
Source1: %{name}
+Source2: %{name}.png
+Source3: %{_bluetooth_demo_package}
+Source4: %{_examples_package}
Source1001: %{name}.manifest
BuildRequires: python
%description
Tizen Web APIs implemented using Crosswalk.
+%package -n %{_bluetooth_demo_package}
+Summary: Tizen Web APIs using Crosswalk demo
+Group: Development/Libraries
+Requires: %{name}
+
+%description -n %{_bluetooth_demo_package}
+Tizen Web APIs bluetooth demo implementation using Crosswalk.
+
+%package -n %{_examples_package}
+Summary: Tizen Web APIs using Crosswalk examples
+Group: Development/Libraries
+Requires: %{name}
+
+%description -n %{_examples_package}
+Tizen Web APIs examples using Crosswalk.
+
%prep
%setup -q
cp %{SOURCE1001} .
+cp %{SOURCE2} .
+cp %{SOURCE3} .
+cp %{SOURCE4} .
%build
# Binary wrapper.
install -m 755 -D %{SOURCE1} %{buildroot}%{_bindir}/%{name}
+install -m 755 -D %{SOURCE3} %{buildroot}%{_bindir}/%{_bluetooth_demo_package}
+install -m 755 -D %{SOURCE4} %{buildroot}%{_bindir}/%{_examples_package}
# Extensions.
mkdir -p %{buildroot}%{_libdir}/%{name}
install -p -m 644 demos/tizen/css/*.css %{buildroot}%{_datarootdir}/%{name}/demos/tizen/css
install -p -m 644 demos/tizen/js/*.js %{buildroot}%{_datarootdir}/%{name}/demos/tizen/js
+# register to the package manager
+install -m 644 -D %{_examples_package}.xml %{buildroot}%{_manifestdir}/%{_examples_package}.xml
+install -m 644 -D %{_bluetooth_demo_package}.xml %{buildroot}%{_manifestdir}/%{_bluetooth_demo_package}.xml
+install -p -D %{name}.png %{buildroot}%{_desktop_icondir}/%{_examples_package}.png
+install -p -D %{name}.png %{buildroot}%{_desktop_icondir}/%{_bluetooth_demo_package}.png
+
%files
# TODO(rakuco): This causes problems on 2.1 when creating the package.
# %license LICENSE
%{_bindir}/%{name}
%{_libdir}/%{name}/libtizen*.so
-%{_datarootdir}/%{name}/examples/*.html
-%{_datarootdir}/%{name}/examples/js/*.js
+%files -n %{_bluetooth_demo_package}
+%{_bindir}/%{_bluetooth_demo_package}
+%{_manifestdir}/%{_bluetooth_demo_package}.xml
+%{_desktop_icondir}/%{_bluetooth_demo_package}.png
%{_datarootdir}/%{name}/demos/tizen/*.html
%{_datarootdir}/%{name}/demos/tizen/css/*.css
%{_datarootdir}/%{name}/demos/tizen/js/*.js
+
+%files -n %{_examples_package}
+%{_bindir}/%{_examples_package}
+%{_manifestdir}/%{_examples_package}.xml
+%{_desktop_icondir}/%{_examples_package}.png
+%{_datarootdir}/%{name}/examples/*.html
+%{_datarootdir}/%{name}/examples/js/*.js
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" package="@PACKAGE_NAME@" version="@PACKAGE_VERSION@" install-location="internal-only">
+ <label>@PACKAGE_LABEL@</label>
+ <author email="cameo-dev@linux.intel.com" href="www.intel.com">XWalkDev</author>
+ <description>@PACKAGE_LABEL@</description>
+ <ui-application appid="@APP_ID@" exec="@PACKAGE_EXEC@" nodisplay="false" multiple="false" type="capp" taskmanage="true">
+ <label>@PACKAGE_LABEL@</label>
+ <icon>@PACKAGE_NAME@.png</icon>
+ </ui-application>
+</manifest>
{
+ 'includes':[
+ 'common/common.gypi',
+ ],
+
'targets': [
{
'target_name': 'build_all_tizen_extensions',
'download/download.gyp:*',
],
},
+ {
+ 'target_name': 'generate_manifest',
+ 'type': 'none',
+
+ 'conditions': [
+ [ 'extension_host_os == "mobile"', {
+ 'actions': [
+ {
+ 'variables': {
+ 'generate_args': [
+ '_examples_package',
+ 'crosswalk-examples',
+ '/usr/bin/tizen-extensions-crosswalk-examples',
+ 'Crosswalk Examples',
+ ],
+ },
+ 'action_name': 'examples',
+ 'inputs': [
+ 'tools/generate_manifest.py',
+ 'packaging/tizen-extensions-crosswalk.spec',
+ 'tizen-extensions-crosswalk.xml.in',
+ ],
+ 'outputs': [
+ 'tizen-extensions-crosswalk-examples.xml',
+ ],
+ 'action': [
+ 'python',
+ '<@(_inputs)',
+ '<@(generate_args)',
+ '<@(_outputs)',
+ ],
+ },
+ {
+ 'variables': {
+ 'generate_args': [
+ '_bluetooth_demo_package',
+ 'crosswalk-bluetooth-demo',
+ '/usr/bin/tizen-extensions-crosswalk-bluetooth-demo',
+ 'Crosswalk Bluetooth Demo',
+ ],
+ },
+ 'action_name': 'demo',
+ 'inputs': [
+ 'tools/generate_manifest.py',
+ 'packaging/tizen-extensions-crosswalk.spec',
+ 'tizen-extensions-crosswalk.xml.in',
+ ],
+ 'outputs': [
+ 'tizen-extensions-crosswalk-bluetooth-demo.xml',
+ ],
+ 'action': [
+ 'python',
+ '<@(_inputs)',
+ '<@(generate_args)',
+ '<@(_outputs)',
+ ],
+ },
+ ],
+ }],
+ ],
+ },
],
}
--- /dev/null
+# Copyright (c) 2013 Intel Corporation. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import sys, os, re, errno
+
+spec = sys.argv[1]
+origin = sys.argv[2]
+
+if len(sys.argv) != 8:
+ print 'Invalid arguments'
+ sys.exit(errno.EINVAL)
+
+if not os.path.isfile(spec) or not os.path.isfile(origin):
+ print 'No such spec(%s) or input xml(%s) file' % (spec, origin)
+ sys.exit(errno.ENOENT)
+
+spec = file(spec).read()
+version = re.search('(?<=Version:).*', spec).group(0).strip()
+package_name = re.search('(?<=%define '+sys.argv[3]+').*', spec).group(0).strip()
+
+template = file(origin).read().replace('@PACKAGE_VERSION@', version)
+template = template.replace('@PACKAGE_NAME@', package_name)
+template = template.replace('@APP_ID@', sys.argv[4])
+template = template.replace('@PACKAGE_EXEC@', sys.argv[5])
+template = template.replace('@PACKAGE_LABEL@', sys.argv[6])
+
+output = open(sys.argv[7], 'w')
+output.write(template)
+output.close()