blob: e05fb5475f56a4cce3013b2b9fa97db0feaaf274 [file] [log] [blame]
Name: com.youtube.cobalt
Summary: Cobalt for Tizen
Version: 0.1
Release: 1
License: MPL or BSD-3-clause
Source0: %{name}-%{version}.tar.gz
Requires: /usr/bin/systemctl
Requires(post): /sbin/ldconfig
Requires(post): xkeyboard-config
Requires(postun): /sbin/ldconfig
#####################
# rpm require package
#####################
BuildRequires: cmake, bison, python, gperf, ninja
BuildRequires: libasound-devel
BuildRequires: pkgconfig(aul)
BuildRequires: pkgconfig(capi-appfw-application)
BuildRequires: pkgconfig(capi-media-audio-io)
BuildRequires: pkgconfig(capi-network-connection)
BuildRequires: pkgconfig(capi-system-info)
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(edbus)
BuildRequires: pkgconfig(elementary)
BuildRequires: pkgconfig(evas)
BuildRequires: pkgconfig(gles20)
BuildRequires: pkgconfig(icu-i18n)
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(openssl)
BuildRequires: pkgconfig(tizen-extension-client)
BuildRequires: pkgconfig(wayland-client)
BuildRequires: pkgconfig(wayland-egl)
BuildRequires: pkgconfig(libavcodec)
BuildRequires: pkgconfig(libavformat)
BuildRequires: pkgconfig(libavutil)
BuildRequires: pkgconfig(libpulse)
%description
Youtube Engine based on Cobalt
%prep
%setup -q
#define specific parameters
%if "%{?bin_name}"
%define _name %{bin_name}
%else
%define _name cobalt
%endif
%if "%{?build_type}"
%define _build_type %{build_type}
%else
%define _build_type devel
%endif
%if "%{?target}"
%define _target %{target}
%else
%define _target tizen
%endif
%if "%{?chipset}"
%define _chipset %{chipset}
%else
%define _chipset armv7l
%endif
%define _pkgname com.youtube.cobalt
%define _outdir src/out/%{_target}-%{_chipset}_%{_build_type}
%define _manifestdir /usr/share/packages
%define _pkgdir /usr/apps/%{_pkgname}
%define _bindir %{_pkgdir}/bin
%define _contentdir %{_pkgdir}/content
%define _build_create_debug 0
echo "Name: %{_name} / Target: %{_target} / Chipset: %{_chipset} / Build Type: %{_build_type}"
#####################
# rpm build
#####################
%build
# export depot_tools to provide download_from_google_storage command.
# download_from_google_storage will be used when gyp_cobalt.
# depot_tools should be placed under src/cobalt/build before gbs build.
# Remove .git in depot_tools if existed.
export PATH=${PATH}:%{_builddir}/%{name}-%{version}/src/cobalt/build/depot_tools
#gyp generate
%if 0%{?nogyp}
echo "Skip GYP"
%else
./src/cobalt/build/gyp_cobalt -v -C %{_build_type} %{_target}-%{_chipset}
%endif
#ninja build
ninja -C %{_outdir} %{_name}
%clean
#Don't delete src/out
#rm -rf src/out
#####################
# rpm install
#####################
%install
# directory
rm -rf %{buildroot}
install -d %{buildroot}%{_bindir}
install -d %{buildroot}%{_manifestdir}
install -d %{buildroot}%{_contentdir}/data/fonts/
# binary
%if "%{_name}" == "all"
install -m 0755 %{_outdir}/accessibility_test %{_outdir}/audio_test %{_outdir}/base_test \
%{_outdir}/base_unittests %{_outdir}/bindings_sandbox %{_outdir}/bindings_test \
%{_outdir}/browser_test %{_outdir}/cobalt %{_outdir}/crypto_unittests %{_outdir}/csp_test \
%{_outdir}/cssom_test %{_outdir}/css_parser_test %{_outdir}/dom_parser_test \
%{_outdir}/dom_test %{_outdir}/eztime_test %{_outdir}/image_decoder_sandbox \
%{_outdir}/layout_benchmarks %{_outdir}/layout_test %{_outdir}/layout_tests \
%{_outdir}/loader_test %{_outdir}/math_test %{_outdir}/media2_sandbox \
%{_outdir}/media_source_sandbox %{_outdir}/mozjs %{_outdir}/mozjs_engine_test \
%{_outdir}/mozjs_keyword_header_gen %{_outdir}/mozjs_opcode_length_header_gen \
%{_outdir}/nb_test %{_outdir}/network_test %{_outdir}/nplb %{_outdir}/nplb_blitter_pixel_tests \
%{_outdir}/poem_unittests %{_outdir}/renderer_benchmark %{_outdir}/renderer_sandbox \
%{_outdir}/renderer_test %{_outdir}/render_tree_test %{_outdir}/reuse_allocator_benchmark \
%{_outdir}/sample_benchmark %{_outdir}/scaling_text_sandbox %{_outdir}/simple_example \
%{_outdir}/simple_example_test %{_outdir}/snapshot_app_stats %{_outdir}/speech_sandbox \
%{_outdir}/sql_unittests %{_outdir}/starboard_blitter_example %{_outdir}/starboard_glclear_example \
%{_outdir}/starboard_window_example %{_outdir}/storage_test %{_outdir}/trace_event_test \
%{_outdir}/web_animations_test %{_outdir}/webdriver_test %{_outdir}/web_media_player_sandbox \
%{_outdir}/web_platform_tests %{_outdir}/websocket_test %{_outdir}/xhr_test \
%{buildroot}%{_bindir}
%else
install -m 0755 %{_outdir}/%{_name} %{buildroot}%{_bindir}
%endif
# font
cp -rd %{_outdir}/content/data/fonts %{buildroot}%{_contentdir}/data/
# ssl
cp -rd %{_outdir}/content/data/ssl %{buildroot}%{_contentdir}/data/
# debug resources
%if %{_build_type} != "gold"
cp -rd %{_outdir}/content/data/web %{buildroot}%{_contentdir}/data/
%endif
# test contents
%if %{_name} != "cobalt"
cp -rd %{_outdir}/content/dir_source_root %{buildroot}%{_contentdir}/
%endif
# package xml
cp src/starboard/contrib/tizen/packaging/%{_pkgname}.xml %{buildroot}%{_manifestdir}
%post
%postun
#####################
# rpm files
#####################
%files
%manifest src/starboard/contrib/tizen/packaging/%{_pkgname}.manifest
%defattr(-,root,root,-)
%{_bindir}/*
%{_contentdir}/*
%{_manifestdir}/*