tc: Add tpl-test build option on spec file 31/152731/1
authorHoyub Lee <hoyub.lee@samsung.com>
Mon, 25 Sep 2017 08:26:39 +0000 (17:26 +0900)
committerjoonbum.ko <joonbum.ko@samsung.com>
Wed, 27 Sep 2017 03:57:37 +0000 (12:57 +0900)
tpl-test can be built with either ways:
 - Build with [--with-utest=yes]
 - Change the value of 'ENABLE_TPL_TEST' to '1' of spec file

Change-Id: I8b2a3e14ef25bbf21697a3c8da5cfd50eb9c175b
Signed-off-by: Hoyub Lee <hoyub.lee@samsung.com>
packaging/libtpl-egl.spec

index f263b90..21d321c 100644 (file)
@@ -1,3 +1,5 @@
+%bcond_with utest
+
 #TPL VERSION MACROS
 %define TPL_VERSION_MAJOR      1
 %define TPL_VERSION_MINOR      4
@@ -121,6 +123,15 @@ Requires:  libwayland-egl
 Development header files for use with Wayland protocol
 %endif
 
+%if %{with utest} || "%{ENABLE_TPL_TEST}" == "1"
+%package    utest
+Summary:    Unit test module of libtpl-egl
+BuildRequires:  gtest-devel
+
+%description utest
+Unit test module of libtpl-egl (previously known as tpl-test)
+%endif
+
 %prep
 %setup -q
 
@@ -141,6 +152,9 @@ export WL_EGL_VERSION_PATCH=%{WL_EGL_VERSION_PATCH}
        --with-wayland=yes      \
        --enable-wayland-thread=%{ENABLE_DEFAULT_WL_THREAD}     \
 %endif
+%if %{with utest} || "%{ENABLE_TPL_TEST}" == "1"
+       --with-utest=yes        \
+%endif
        --enable-dlog=%{ENABLE_DLOG}                                                    \
        --enable-dlog-default=%{ENABLE_DEFAULT_LOG}                             \
        --enable-dump=%{ENABLE_DEFAULT_DUMP}                                    \
@@ -190,3 +204,9 @@ rm -rf %{buildroot}
 %{_libdir}/libwayland-egl.so
 %{_libdir}/pkgconfig/wayland-egl.pc
 %endif
+
+%if %{with utest} || "%{ENABLE_TPL_TEST}" == "1"
+%files utest
+%defattr(-,root,root,-)
+%{_bindir}/tpl-test
+%endif