Prepare dynamicbox_viewer.spec
authorjongwon lee <gogosing.lee@samsung.com>
Thu, 14 Aug 2014 15:09:52 +0000 (00:09 +0900)
committerGerrit Code Review <gerrit2@localhost>
Tue, 19 Aug 2014 13:01:08 +0000 (22:01 +0900)
[model] Redwood
[binary_type] AP
[customer] N/A
[issue#]
[problem]
[cause]
[solution]
[team] Home TF
[horizontal_expansion] N/A

CMakeLists.txt
packaging/libdynamicbox_viewer.manifest [new file with mode: 0644]
packaging/libdynamicbox_viewer.spec_ [new file with mode: 0644]
src/desc_parser.c
src/fb.c
src/livebox.c
src/master_rpc.c

index 333d2c0..e8a4056 100644 (file)
@@ -1,5 +1,9 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+IF (DYNAMICBOX_ENABLED)
+PROJECT(dynamicbox_viewer C)
+ELSE (DYNAMICBOX_ENABLED)
 PROJECT(livebox-viewer C)
+ENDIF (DYNAMICBOX_ENABLED)
 
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 SET(EXEC_PREFIX "\${prefix}")
@@ -14,29 +18,33 @@ SET(CMAKE_SKIP_BUILD_RPATH true)
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
 
 INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED
-       dlog
-       aul
-       glib-2.0
-       gio-2.0
-       com-core
-       sqlite3
-       db-util
-       livebox-service
-       vconf
-)
+IF (DYNAMICBOX_ENABLED)
+       pkg_check_modules(pkgs REQUIRED
+               dlog
+               aul
+               glib-2.0
+               gio-2.0
+               com-core
+               sqlite3
+               db-util
+               dynamicbox_service
+               vconf
+       )
+ELSE (DYNAMICBOX_ENABLED)
+       pkg_check_modules(pkgs REQUIRED
+               dlog
+               aul
+               glib-2.0
+               gio-2.0
+               com-core
+               sqlite3
+               db-util
+               livebox-service
+               vconf
+       )
+ENDIF (DYNAMICBOX_ENABLED)
+
 
-SET(BUILD_SOURCE
-       src/dlist.c
-       src/livebox.c
-       src/util.c
-       src/desc_parser.c
-       src/master_rpc.c
-       src/client.c
-       src/file_service.c
-       src/conf.c
-       src/dynamicbox.c
-)
 
 IF (X11_SUPPORT)
 pkg_check_modules(pkgs_extra REQUIRED
@@ -92,7 +100,12 @@ SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${PROJECT_NAME}
 
 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib)
 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION lib/pkgconfig)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/livebox.h DESTINATION include/${PROJECT_NAME})
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/dynamicbox.h DESTINATION include/dynamicbox_viewer)
+               
+IF (DYNAMICBOX_ENABLED)
+       INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/dynamicbox.h DESTINATION include/dynamicbox_viewer)
+ELSE (DYNAMICBOX_ENABLED)
+       INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/livebox.h DESTINATION include/${PROJECT_NAME})
+       INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/dynamicbox.h DESTINATION include/dynamicbox_viewer)
+ENDIF (DYNAMICBOX_ENABLED)
+
 INSTALL(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION /usr/share/license RENAME "lib${PROJECT_NAME}")
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION /usr/share/license RENAME "libdynamicbox_viewer")
diff --git a/packaging/libdynamicbox_viewer.manifest b/packaging/libdynamicbox_viewer.manifest
new file mode 100644 (file)
index 0000000..a76fdba
--- /dev/null
@@ -0,0 +1,5 @@
+<manifest>
+       <request>
+               <domain name="_" />
+       </request>
+</manifest>
diff --git a/packaging/libdynamicbox_viewer.spec_ b/packaging/libdynamicbox_viewer.spec_
new file mode 100644 (file)
index 0000000..c55e919
--- /dev/null
@@ -0,0 +1,90 @@
+%bcond_with wayland
+
+Name: libdynamicbox_viewer
+Summary: Library for developing the application
+Version: 0.31.5
+Release: 1
+Group: HomeTF/Livebox
+License: Flora
+Source0: %{name}-%{version}.tar.gz
+Source1001: %{name}.manifest
+BuildRequires: cmake, gettext-tools, coreutils
+BuildRequires: pkgconfig(dlog)
+BuildRequires: pkgconfig(aul)
+BuildRequires: pkgconfig(glib-2.0)
+BuildRequires: pkgconfig(gio-2.0)
+BuildRequires: pkgconfig(com-core)
+BuildRequires: pkgconfig(sqlite3)
+BuildRequires: pkgconfig(db-util)
+BuildRequires: pkgconfig(dynamicbox_service)
+BuildRequires: pkgconfig(vconf)
+
+%if %{with wayland}
+%else
+BuildRequires: pkgconfig(x11)
+BuildRequires: pkgconfig(xext)
+%endif
+
+%if "%{sec_product_feature_livebox}" == "0"
+ExclusiveArch:
+%endif
+
+%description
+API for creating a new instance of the dynamicbox and managing its life-cycle.
+
+%package devel
+Summary: Livebox viewer development library (dev)
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description devel
+Header and package configuration files for the dynamicbox viewer development
+
+%prep
+%setup -q
+cp %{SOURCE1001} .
+
+%build
+%if 0%{?sec_build_binary_debug_enable}
+export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
+export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
+export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
+%endif
+
+%if 0%{?tizen_build_binary_release_type_eng}
+export CFLAGS="${CFLAGS} -DTIZEN_ENGINEER_MODE"
+export CXXFLAGS="${CXXFLAGS} -DTIZEN_ENGINEER_MODE"
+export FFLAGS="${FFLAGS} -DTIZEN_ENGINEER_MODE"
+%endif
+
+%if %{with wayland}
+export WAYLAND_SUPPORT=On
+export X11_SUPPORT=Off
+%else
+export WAYLAND_SUPPORT=Off
+export X11_SUPPORT=On
+%endif
+
+%cmake . -DWAYLAND_SUPPORT=${WAYLAND_SUPPORT} -DX11_SUPPORT=${X11_SUPPORT} -DDYNAMICBOX_ENABLED=On
+make %{?jobs:-j%jobs}
+
+%install
+rm -rf %{buildroot}
+%make_install
+
+%post -n libdynamicbox_viewer -p /sbin/ldconfig
+%postun -n libdynamicbox_viewer -p /sbin/ldconfig
+
+%files -n libdynamicbox_viewer
+%manifest %{name}.manifest
+%defattr(-,root,root,-)
+%{_libdir}/*.so*
+%{_datarootdir}/license/*
+
+%files devel
+%manifest %{name}.manifest
+%defattr(-,root,root,-)
+%{_includedir}/dynamicbox_viewer/dynamicbox.h
+%{_libdir}/pkgconfig/*.pc
+
+# End of a file
index ac056ac..686e9c3 100644 (file)
@@ -26,8 +26,8 @@
 
 #include <gio/gio.h>
 #include <dlog.h>
-#include <livebox-errno.h>
-#include <livebox-service.h>
+#include <dynamicbox_errno.h>
+#include <dynamicbox_service.h>
 
 #include "debug.h"
 #include "livebox.h"
index c05aa8c..54b3707 100644 (file)
--- a/src/fb.c
+++ b/src/fb.c
@@ -32,7 +32,7 @@
 #include <X11/Xutil.h>
 
 #include <dlog.h>
-#include <livebox-errno.h> /* For error code */
+#include <dynamicbox_errno.h> /* For error code */
 
 #include "debug.h"
 #include "util.h"
@@ -86,7 +86,7 @@ int fb_init(void *disp)
                s_info.visual = DefaultVisualOfScreen(screen);
        }
 
-       return LB_STATUS_SUCCESS;
+       return DBOX_STATUS_ERROR_NONE;
 }
 
 int fb_fini(void)
@@ -115,17 +115,17 @@ static int sync_for_file(struct fb_info *info)
        buffer = info->buffer;
 
        if (!buffer) { /* Ignore this sync request */
-               return LB_STATUS_SUCCESS;
+               return DBOX_STATUS_ERROR_NONE;
        }
 
        if (buffer->state != CREATED) {
                ErrPrint("Invalid state of a FB\n");
-               return LB_STATUS_ERROR_INVALID;
+               return DBOX_STATUS_ERROR_INVALID_PARAMETER;
        }
 
        if (buffer->type != BUFFER_TYPE_FILE) {
                ErrPrint("Invalid buffer\n");
-               return LB_STATUS_SUCCESS;
+               return DBOX_STATUS_ERROR_NONE;
        }
 
        fd = open(util_uri_to_path(info->id), O_RDONLY);
@@ -140,7 +140,7 @@ static int sync_for_file(struct fb_info *info)
                 *
                 * and then update it after it gots update events
                 */
-               return LB_STATUS_SUCCESS;
+               return DBOX_STATUS_ERROR_NONE;
        }
 
        if (read(fd, buffer->data, info->bufsz) != info->bufsz) {
@@ -156,13 +156,13 @@ static int sync_for_file(struct fb_info *info)
                 *
                 * and then update it after it gots update events
                 */
-               return LB_STATUS_SUCCESS;
+               return DBOX_STATUS_ERROR_NONE;
        }
 
        if (close(fd) < 0) {
                ErrPrint("close: %s\n", strerror(errno));
        }
-       return LB_STATUS_SUCCESS;
+       return DBOX_STATUS_ERROR_NONE;
 }
 
 static int sync_for_pixmap(struct fb_info *info)
@@ -173,17 +173,17 @@ static int sync_for_pixmap(struct fb_info *info)
 
        buffer = info->buffer;
        if (!buffer) { /*!< Ignore this sync request */
-               return LB_STATUS_SUCCESS;
+               return DBOX_STATUS_ERROR_NONE;
        }
 
        if (buffer->state != CREATED) {
                ErrPrint("Invalid state of a FB\n");
-               return LB_STATUS_ERROR_INVALID;
+               return DBOX_STATUS_ERROR_INVALID_PARAMETER;
        }
 
        if (buffer->type != BUFFER_TYPE_PIXMAP) {
                ErrPrint("Invalid buffer\n");
-               return LB_STATUS_SUCCESS;
+               return DBOX_STATUS_ERROR_NONE;
        }
 
        if (!s_info.disp) {
@@ -199,13 +199,13 @@ static int sync_for_pixmap(struct fb_info *info)
                        s_info.visual = DefaultVisualOfScreen(screen);
                } else {
                        ErrPrint("Failed to open a display\n");
-                       return LB_STATUS_ERROR_FAULT;
+                       return DBOX_STATUS_ERROR_FAULT;
                }
        }
 
        if (info->handle == 0) {
                ErrPrint("Pixmap ID is not valid\n");
-               return LB_STATUS_ERROR_INVALID;
+               return DBOX_STATUS_ERROR_INVALID_PARAMETER;
        }
 
        if (info->bufsz == 0) {
@@ -216,13 +216,13 @@ static int sync_for_pixmap(struct fb_info *info)
                 * To sync its contents.
                 */
                DbgPrint("Nothing can be sync\n");
-               return LB_STATUS_SUCCESS;
+               return DBOX_STATUS_ERROR_NONE;
        }
 
        si.shmid = shmget(IPC_PRIVATE, info->bufsz, IPC_CREAT | 0666);
        if (si.shmid < 0) {
                ErrPrint("shmget: %s\n", strerror(errno));
-               return LB_STATUS_ERROR_FAULT;
+               return DBOX_STATUS_ERROR_FAULT;
        }
 
        si.readOnly = False;
@@ -232,7 +232,7 @@ static int sync_for_pixmap(struct fb_info *info)
                        ErrPrint("shmctl: %s\n", strerror(errno));
                }
 
-               return LB_STATUS_ERROR_FAULT;
+               return DBOX_STATUS_ERROR_FAULT;
        }
 
        /*!
@@ -252,7 +252,7 @@ static int sync_for_pixmap(struct fb_info *info)
                        ErrPrint("shmctl: %s\n", strerror(errno));
                }
 
-               return LB_STATUS_ERROR_FAULT;
+               return DBOX_STATUS_ERROR_FAULT;
        }
 
        xim->data = si.shmaddr;
@@ -274,19 +274,19 @@ static int sync_for_pixmap(struct fb_info *info)
                ErrPrint("shmctl: %s\n", strerror(errno));
        }
 
-       return LB_STATUS_SUCCESS;
+       return DBOX_STATUS_ERROR_NONE;
 }
 
 int fb_sync(struct fb_info *info)
 {
        if (!info) {
                ErrPrint("FB Handle is not valid\n");
-               return LB_STATUS_ERROR_INVALID;
+               return DBOX_STATUS_ERROR_INVALID_PARAMETER;
        }
 
        if (!info->id || info->id[0] == '\0') {
                DbgPrint("Ingore sync\n");
-               return LB_STATUS_SUCCESS;
+               return DBOX_STATUS_ERROR_NONE;
        }
 
        if (!strncasecmp(info->id, SCHEMA_FILE, strlen(SCHEMA_FILE))) {
@@ -295,10 +295,10 @@ int fb_sync(struct fb_info *info)
                return sync_for_pixmap(info);
        } else if (!strncasecmp(info->id, SCHEMA_SHM, strlen(SCHEMA_SHM))) {
                /* No need to do sync */ 
-               return LB_STATUS_SUCCESS;
+               return DBOX_STATUS_ERROR_NONE;
        }
 
-       return LB_STATUS_ERROR_INVALID;
+       return DBOX_STATUS_ERROR_INVALID_PARAMETER;
 }
 
 struct fb_info *fb_create(const char *id, int w, int h)
@@ -330,7 +330,7 @@ struct fb_info *fb_create(const char *id, int w, int h)
        } else if (sscanf(info->id, SCHEMA_PIXMAP "%d:%d", &info->handle, &info->pixels) == 2) {
                DbgPrint("PIXMAP-SHMID: %d is gotten (%d)\n", info->handle, info->pixels);
        } else {
-               info->handle = LB_STATUS_ERROR_INVALID;
+               info->handle = DBOX_STATUS_ERROR_INVALID_PARAMETER;
        }
 
        info->bufsz = 0;
@@ -345,7 +345,7 @@ int fb_destroy(struct fb_info *info)
 {
        if (!info) {
                ErrPrint("Handle is not valid\n");
-               return LB_STATUS_ERROR_INVALID;
+               return DBOX_STATUS_ERROR_INVALID_PARAMETER;
        }
 
        if (info->buffer) {
@@ -357,7 +357,7 @@ int fb_destroy(struct fb_info *info)
 
        free(info->id);
        free(info);
-       return LB_STATUS_SUCCESS;
+       return DBOX_STATUS_ERROR_NONE;
 }
 
 int fb_is_created(struct fb_info *info)
@@ -469,14 +469,14 @@ int fb_release_buffer(void *data)
 
        if (!data) {
                ErrPrint("buffer data == NIL\n");
-               return LB_STATUS_ERROR_INVALID;
+               return DBOX_STATUS_ERROR_INVALID_PARAMETER;
        }
 
        buffer = container_of(data, struct buffer, data);
 
        if (buffer->state != CREATED) {
                ErrPrint("Invalid handle\n");
-               return LB_STATUS_ERROR_INVALID;
+               return DBOX_STATUS_ERROR_INVALID_PARAMETER;
        }
 
        switch (buffer->type) {
@@ -518,7 +518,7 @@ int fb_release_buffer(void *data)
                break;
        }
 
-       return LB_STATUS_SUCCESS;
+       return DBOX_STATUS_ERROR_NONE;
 }
 
 int fb_refcnt(void *data)
@@ -528,21 +528,21 @@ int fb_refcnt(void *data)
        int ret;
 
        if (!data) {
-               return LB_STATUS_ERROR_INVALID;
+               return DBOX_STATUS_ERROR_INVALID_PARAMETER;
        }
 
        buffer = container_of(data, struct buffer, data);
 
        if (buffer->state != CREATED) {
                ErrPrint("Invalid handle\n");
-               return LB_STATUS_ERROR_INVALID;
+               return DBOX_STATUS_ERROR_INVALID_PARAMETER;
        }
 
        switch (buffer->type) {
        case BUFFER_TYPE_SHM:
                if (shmctl(buffer->refcnt, IPC_STAT, &buf) < 0) {
                        ErrPrint("Error: %s\n", strerror(errno));
-                       return LB_STATUS_ERROR_FAULT;
+                       return DBOX_STATUS_ERROR_FAULT;
                }
 
                ret = buf.shm_nattch;
@@ -554,7 +554,7 @@ int fb_refcnt(void *data)
                ret = buffer->refcnt;
                break;
        default:
-               ret = LB_STATUS_ERROR_INVALID;
+               ret = DBOX_STATUS_ERROR_INVALID_PARAMETER;
                break;
        }
 
@@ -570,12 +570,12 @@ int fb_get_size(struct fb_info *info, int *w, int *h)
 {
        if (!info) {
                ErrPrint("Handle is not valid\n");
-               return LB_STATUS_ERROR_INVALID;
+               return DBOX_STATUS_ERROR_INVALID_PARAMETER;
        }
 
        *w = info->w;
        *h = info->h;
-       return LB_STATUS_SUCCESS;
+       return DBOX_STATUS_ERROR_NONE;
 }
 
 int fb_size(struct fb_info *info)
index d913fee..df76ead 100644 (file)
@@ -30,8 +30,8 @@
 
 #include <com-core_packet.h>
 #include <packet.h>
-#include <livebox-service.h>
-#include <livebox-errno.h>
+#include <dynamicbox_service.h>
+#include <dynamicbox_errno.h>
 
 #include "debug.h"
 #include "fb.h"
index ec3b4cb..2b5cd15 100644 (file)
@@ -24,8 +24,8 @@
 
 #include <packet.h>
 #include <com-core_packet.h>
-#include <livebox-errno.h>
-#include <livebox-service.h>
+#include <dynamicbox_errno.h>
+#include <dynamicbox_service.h>
 
 #include "debug.h"
 #include "dlist.h"