+# Do not create provides fro extension-tm1 because the main package
+# should anchor any reverse-dependencies
+%global __provides_exclude_from ^(.*\\.tm1)$
+
%bcond_with wayland
%bcond_with x
%define gst_branch 1.0
Name: gst-plugins-tizen
Version: 1.0.0
Summary: GStreamer tizen plugins (common)
-Release: 22
+Release: 65
Group: Multimedia/Framework
Url: http://gstreamer.freedesktop.org/
License: LGPL-2.1+
Source0: %{name}-%{version}.tar.gz
-#BuildRequires: pkgconfig(camsrcjpegenc)
-BuildRequires: pkgconfig(ecore)
-BuildRequires: pkgconfig(evas)
BuildRequires: pkgconfig(gstreamer-audio-1.0)
BuildRequires: pkgconfig(gstreamer-video-1.0)
BuildRequires: pkgconfig(gstreamer-plugins-base-1.0)
+BuildRequires: pkgconfig(gstreamer-allocators-1.0)
BuildRequires: pkgconfig(gstreamer-1.0)
BuildRequires: pkgconfig(libexif)
%if %{with x}
BuildRequires: libdrm-devel
BuildRequires: pkgconfig(vconf)
BuildRequires: pkgconfig(mm-common)
+BuildRequires: pkgconfig(gles20)
+BuildRequires: pkgconfig(tpl-egl)
+BuildRequires: pkgconfig(tinycompress)
%if %{with wayland}
BuildRequires: pkgconfig(wayland-client) >= 1.0.0
BuildRequires: pkgconfig(wayland-tbm-client)
BuildRequires: pkgconfig(tizen-extension-client)
-BuildRequires: pkgconfig(gstreamer-wayland-1.0)
%endif
+%if 0%{?gtests:1}
+BuildRequires: pkgconfig(gmock)
+%endif
+# for tizencamerasrc
+#BuildRequires: pkgconfig(camera-hal-interface)
+BuildRequires: pkgconfig(capi-media-sound-manager)
+BuildRequires: pkgconfig(alsa)
%description
GStreamer tizen plugins (common)
+%ifarch %{arm}
+# This is for backward-compatibility. This does not deteriorate 4.0 Configurability
+# if mobile || "undefined"
+%if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
+%package extension-TM1
+Summary: Extension for mobile TM1
+Requires: %{name} = %{version}-%{release}
+#!BuildIgnore: kernel-headers
+
+%description extension-TM1
+GStreamer tizen plugins Extension for mobile TM1
+%endif
+%endif
+
%prep
%setup -q
%build
-export CFLAGS+=" -DGST_EXT_TIME_ANALYSIS -DGST_EXT_XV_ENHANCEMENT -DGST_WLSINK_ENHANCEMENT -DEXPORT_API=\"__attribute__((visibility(\\\"default\\\")))\" "
+export CFLAGS+=" -DTIZEN_FEATURE_WLSINK_ENHANCEMENT -DEXPORT_API=\"__attribute__((visibility(\\\"default\\\")))\" \
+ -fstack-protector-strong -Wl,-z,relro -D_FORTIFY_SOURCE=2"
+export CFLAGS_DEFAULT="$CFLAGS"
+
+%ifarch %{arm}
+# This is for backward-compatibility. This does not deteriorate 4.0 Configurability
+# if mobile || "undefined"
+%if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
+# extension-TM1
+export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_PRODUCT_TM1"
./autogen.sh --disable-static
%configure \
-%if %{with x}
- --disable-waylandsrc\
-# --disable-waylandsink\
-%else
- --disable-xvimagesrc\
+%if 0%{?gtests:1}
+ --enable-tests \
+%endif
+%if 0%{?tinycompresstest:1}
+ --enable-tinycompress_test\
+%endif
+ --disable-drmdecryptor\
+ --enable-ext-wfdtizenmanager\
+ --enable-ext-alfec\
+ --disable-tizenipc\
+ --disable-tizencamerasrc\
+ --disable-static\
+ --with-tizen-platform \
+ --with-native-formats \
+ --with-gles2
+
+make %{?jobs:-j%jobs}
+
+mkdir -p tm1
+
+%make_install
+cp -a %{buildroot}%{_libdir}/gstreamer-%{gst_branch}/*.so tm1/
+cp -a %{buildroot}%{_libdir}/libgstwfdbase.so* tm1/
+%endif
+%endif
+
+# common
+export CFLAGS="$CFLAGS_DEFAULT"
+
+./autogen.sh --disable-static
+%configure \
+%if 0%{?gtests:1}
+i --enable-tests \
+%endif
+%if 0%{?tinycompresstest:1}
+ --enable-tinycompress_test\
%endif
--disable-drmdecryptor\
- --disable-static
+ --enable-ext-wfdtizenmanager\
+ --enable-ext-alfec\
+ --disable-tizenipc\
+ --disable-tizencamerasrc\
+ --disable-static\
+ --with-tizen-platform \
+ --with-native-formats \
+ --with-gles2
make %{?jobs:-j%jobs}
%install
rm -rf %{buildroot}
%make_install
-mkdir -p %{buildroot}/%{_datadir}/license
-cp -rf %{_builddir}/%{name}-%{version}/COPYING %{buildroot}%{_datadir}/license/%{name}
+%ifarch %{arm}
+# This is for backward-compatibility. This does not deteriorate 4.0 Configurability
+# if mobile || "undefined"
+%if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
+# extension-TM1
+pushd tm1
+for FILE in libgstwfdbase.so*; do mv "$FILE" "%{buildroot}%{_libdir}/$FILE.tm1"; done
+for FILE in *.so; do mv "$FILE" "%{buildroot}%{_libdir}/gstreamer-%{gst_branch}/$FILE.tm1"; done
+popd
+
+%post extension-TM1
+pushd %{_libdir}
+for FILE in libgstwfdbase.so*.tm1; do mv "$FILE" "${FILE%.tm1}"; done
+popd
+pushd %{_libdir}/gstreamer-%{gst_branch}
+for FILE in *.so.tm1; do mv "$FILE" "${FILE%.tm1}"; done
+popd
+/sbin/ldconfig
+
+%preun extension-TM1
+case "$1" in
+ 0)
+ # This is an un-installation.
+ pushd %{_libdir}
+ for FILE in libgstwfdbase.so*; do mv "$FILE" "${FILE%.tm1}"; done
+ popd
+ pushd %{_libdir}/gstreamer-%{gst_branch}
+ for FILE in *.so; do mv "$FILE" "${FILE%.tm1}"; done
+ popd
+ /sbin/ldconfig
+ ;;
+ 1)
+ # This is an upgrade.
+ # Do nothing.
+ :
+ ;;
+esac
+
+%files extension-TM1
+%manifest gst-plugins-tizen1.0.manifest
+%license COPYING
+%{_libdir}/gstreamer-%{gst_branch}/*.so.tm1
+%{_libdir}/libgstwfdbase.so*.tm1
+%if 0%{?gtests:1}
+%{_bindir}/gtest*
+%endif
+%endif
+%endif
%files
%manifest gst-plugins-tizen1.0.manifest
+%license COPYING
%defattr(-,root,root,-)
%{_libdir}/gstreamer-%{gst_branch}/*.so
%{_libdir}/libgstwfdbase.so*
-%{_datadir}/license/%{name}
+%ifarch %{arm}
+%exclude %{_libdir}/gstreamer-%{gst_branch}/*.so.tm1
+%exclude %{_libdir}/libgstwfdbase.so*.tm1
+%endif
+%if 0%{?gtests:1}
+%{_bindir}/gtest*
+%endif
+%if "%{tinycompresstest}" == "1"
+%{_bindir}/tinycompress_test
+%endif
+