Split packages 09/107309/5
authorInkyun Kil <inkyun.kil@samsung.com>
Tue, 27 Dec 2016 11:13:30 +0000 (20:13 +0900)
committerInkyun Kil <inkyun.kil@samsung.com>
Mon, 23 Jan 2017 10:42:20 +0000 (19:42 +0900)
- An application without 'UI' may want to use the API.
  If the package does not split, the application is UI-dependent.
  Therefore, UI-dependent package need to be separated.

Change-Id: I4bad93b88889695a90d0ccb98b78a6af80c955b1
Signed-off-by: Inkyun Kil <inkyun.kil@samsung.com>
CMakeLists.txt
event/CMakeLists.txt
packaging/capi-appfw-application.spec
preference/CMakeLists.txt
src/CMakeLists.txt [new file with mode: 0644]

index fed3abf..fee558f 100644 (file)
@@ -1,53 +1,13 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-SET(fw_name "capi-appfw-application")
-
-PROJECT(${fw_name})
-
-SET(CMAKE_INSTALL_PREFIX /usr)
-SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 
 SET(INC_DIR include)
-INCLUDE_DIRECTORIES(${INC_DIR})
-
-SET(requires "dlog bundle appcore-common appcore-efl aul appsvc elementary capi-base-common sqlite3 libtzplatform-config pkgmgr-info glib-2.0")
-SET(pc_requires "capi-base-common vconf-internal-keys capi-appfw-app-control capi-appfw-app-common capi-appfw-preference capi-appfw-event appcore-common libtzplatform-config")
-
-INCLUDE(FindPkgConfig)
-pkg_check_modules(${fw_name} REQUIRED ${requires})
-FOREACH(flag ${${fw_name}_CFLAGS})
-       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag} -Werror")
-ENDFOREACH(flag)
-
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC ")
-SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -Wall -Werror")
-
-IF("${ARCH}" STREQUAL "arm")
-    ADD_DEFINITIONS("-DTARGET")
-ENDIF("${ARCH}" STREQUAL "arm")
-
-ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
-ADD_DEFINITIONS("-DSLP_DEBUG")
-
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}")
-
-aux_source_directory(src SOURCES)
-ADD_LIBRARY(${fw_name} SHARED ${SOURCES})
 
 ADD_SUBDIRECTORY(app_control)
 ADD_SUBDIRECTORY(app_common)
 ADD_SUBDIRECTORY(preference)
 ADD_SUBDIRECTORY(event)
+ADD_SUBDIRECTORY(src)
 
-TARGET_LINK_LIBRARIES(${fw_name} capi-appfw-app-control capi-appfw-app-common capi-appfw-preference capi-appfw-event ${${fw_name}_LDFLAGS})
-
-SET_TARGET_PROPERTIES(${fw_name}
-     PROPERTIES
-     VERSION ${FULLVER}
-     SOVERSION ${MAJORVER}
-     CLEAN_DIRECT_OUTPUT 1
-)
-
-INSTALL(TARGETS ${fw_name} DESTINATION ${LIB_INSTALL_DIR})
 INSTALL(
         DIRECTORY ${INC_DIR}/ DESTINATION include/appfw
         FILES_MATCHING
@@ -55,17 +15,6 @@ INSTALL(
         PATTERN "${INC_DIR}/*.h"
         )
 
-SET(PC_NAME ${fw_name})
-SET(PC_REQUIRED ${pc_requires})
-SET(PC_LDFLAGS -l${fw_name})
-
-CONFIGURE_FILE(
-    capi-appfw-module.pc.in
-    ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc
-    @ONLY
-)
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
-
 IF(UNIX)
 
 ADD_CUSTOM_TARGET (distclean @echo cleaning for source distribution)
index f4ae553..da32ca0 100644 (file)
@@ -9,7 +9,7 @@ SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 SET(INC_DIR ${CMAKE_SOURCE_DIR}/include)
 INCLUDE_DIRECTORIES(${INC_DIR})
 
-SET(requires "glib-2.0 dlog bundle eventsystem capi-base-common")
+SET(requires "glib-2.0 dlog bundle eventsystem capi-base-common appcore-common")
 SET(pc_requires "capi-base-common")
 
 INCLUDE(FindPkgConfig)
index d58f574..f031b8d 100644 (file)
@@ -25,6 +25,34 @@ BuildRequires:  pkgconfig(glib-2.0)
 %description
 An Application library in SLP C API package.
 
+%package -n capi-appfw-app-control
+Summary:  An Application Control library in Tizen C API
+Group:    System/API
+
+%description -n capi-appfw-app-control
+An Application Control library in Tizen C API package.
+
+%package -n capi-appfw-app-common
+Summary:  An Application Common library in Tizen C API
+Group:    System/API
+
+%description -n capi-appfw-app-common
+An Application Common library in Tizen C API package.
+
+%package -n capi-appfw-preference
+Summary:  An Application Preference library in Tizen C API
+Group:    System/API
+
+%description -n capi-appfw-preference
+An Application Preference library in Tizen C API package.
+
+%package -n capi-appfw-event
+Summary:  An Application Event library in Tizen C API
+Group:    System/API
+
+%description -n capi-appfw-event
+An Application Event library in Tizen C API package.
+
 %package devel
 Summary:  An Application library in SLP C API (Development)
 Group:    System/API
@@ -33,6 +61,39 @@ Requires: %{name} = %{version}-%{release}
 %description devel
 An Application library in SLP C API (Development) package.
 
+%package -n capi-appfw-app-control-devel
+Summary:  An Application Control library in Tizen C API (Development)
+Group:    System/API
+Requires: capi-appfw-app-control = %{version}-%{release}
+
+%description -n capi-appfw-app-control-devel
+An Application Control library in Tizen C API (Development) package.
+
+%package -n capi-appfw-app-common-devel
+Summary:  An Application Common library in Tizen C API (Development)
+Group:    System/API
+Requires: capi-appfw-app-common = %{version}-%{release}
+
+%description -n capi-appfw-app-common-devel
+An Application Common library in Tizen C API (Development) package.
+
+%package -n capi-appfw-preference-devel
+Summary:  An Application Preference library in Tizen C API (Development)
+Group:    System/API
+Requires: capi-appfw-preference = %{version}-%{release}
+
+%description -n capi-appfw-preference-devel
+An Application Preference library in Tizen C API (Development) package.
+
+%package -n capi-appfw-event-devel
+Summary:  An Application Event library in Tizen C API (Development)
+Group:    System/API
+Requires: capi-appfw-event = %{version}-%{release}
+
+%description -n capi-appfw-event-devel
+An Application Event library in Tizen C API (Development) package.
+
+
 %prep
 %setup -q
 cp %{SOURCE1001} .
@@ -49,26 +110,79 @@ mkdir -p %{buildroot}%{_datadir}/license
 cp LICENSE %{buildroot}%{_datadir}/license/%{name}
 
 %post -p /sbin/ldconfig
-
 %postun -p /sbin/ldconfig
 
+%post -n capi-appfw-app-control -p /sbin/ldconfig
+%postun -n capi-appfw-app-control -p /sbin/ldconfig
+
+%post -n capi-appfw-app-common -p /sbin/ldconfig
+%postun -n capi-appfw-app-common -p /sbin/ldconfig
+
+%post -n capi-appfw-preference -p /sbin/ldconfig
+%postun -n capi-appfw-preference -p /sbin/ldconfig
+
+%post -n capi-appfw-event -p /sbin/ldconfig
+%postun -n capi-appfw-event -p /sbin/ldconfig
+
 %files
 %manifest %{name}.manifest
 %{_libdir}/libcapi-appfw-application.so.*
+%{_datadir}/license/%{name}
+
+%files -n capi-appfw-app-control
+%manifest %{name}.manifest
 %{_libdir}/libcapi-appfw-app-control.so.*
+%{_datadir}/license/%{name}
+
+%files -n capi-appfw-app-common
+%manifest %{name}.manifest
 %{_libdir}/libcapi-appfw-app-common.so.*
+%{_datadir}/license/%{name}
+
+%files -n capi-appfw-preference
+%manifest %{name}.manifest
 %{_libdir}/libcapi-appfw-preference.so.*
-%{_libdir}/libcapi-appfw-event.so.*
+%{_datadir}/license/%{name}
 
+%files -n capi-appfw-event
+%manifest %{name}.manifest
+%{_libdir}/libcapi-appfw-event.so.*
 %{_datadir}/license/%{name}
 
 %files devel
 %manifest %{name}.manifest
-%{_includedir}/appfw/*.h
-%{_libdir}/pkgconfig/*.pc
+%{_includedir}/appfw/app.h
+%{_includedir}/appfw/app_internal.h
+%{_includedir}/appfw/app_extension.h
+%{_includedir}/appfw/app_resource_manager.h
+%{_includedir}/appfw/app_i18n.h
+%{_libdir}/pkgconfig/capi-appfw-application.pc
 %{_libdir}/libcapi-appfw-application.so
+
+%files -n capi-appfw-app-control-devel
+%manifest %{name}.manifest
+%{_includedir}/appfw/app_control.h
+%{_includedir}/appfw/app_control_internal.h
+%{_libdir}/pkgconfig/capi-appfw-app-control.pc
 %{_libdir}/libcapi-appfw-app-control.so
+
+%files -n capi-appfw-app-common-devel
+%manifest %{name}.manifest
+%{_includedir}/appfw/app_common.h
+%{_includedir}/appfw/app_types.h
+%{_libdir}/pkgconfig/capi-appfw-app-common.pc
 %{_libdir}/libcapi-appfw-app-common.so
+
+%files -n capi-appfw-preference-devel
+%manifest %{name}.manifest
+%{_includedir}/appfw/app_preference.h
+%{_includedir}/appfw/app_preference_internal.h
+%{_includedir}/appfw/app_preference_log.h
+%{_libdir}/pkgconfig/capi-appfw-preference.pc
 %{_libdir}/libcapi-appfw-preference.so
-%{_libdir}/libcapi-appfw-event.so
 
+%files -n capi-appfw-event-devel
+%manifest %{name}.manifest
+%{_includedir}/appfw/app_event.h
+%{_libdir}/pkgconfig/capi-appfw-event.pc
+%{_libdir}/libcapi-appfw-event.so
index 21da809..ef5c08b 100644 (file)
@@ -9,7 +9,7 @@ SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 SET(INC_DIR ${CMAKE_SOURCE_DIR}/include)
 INCLUDE_DIRECTORIES(${INC_DIR})
 
-SET(requires "dlog capi-base-common sqlite3")
+SET(requires "dlog capi-base-common sqlite3 glib-2.0")
 SET(pc_requires "capi-base-common capi-appfw-app-common")
 
 INCLUDE(FindPkgConfig)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644 (file)
index 0000000..f79aaae
--- /dev/null
@@ -0,0 +1,67 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+SET(fw_name "capi-appfw-application")
+
+PROJECT(${fw_name})
+
+SET(CMAKE_INSTALL_PREFIX /usr)
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+
+SET(INC_DIR ${CMAKE_SOURCE_DIR}/include)
+INCLUDE_DIRECTORIES(${INC_DIR})
+
+SET(requires "dlog bundle appcore-common appcore-efl aul appsvc elementary capi-base-common sqlite3 libtzplatform-config pkgmgr-info glib-2.0")
+SET(pc_requires "capi-base-common vconf-internal-keys capi-appfw-app-control capi-appfw-app-common appcore-common libtzplatform-config")
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(${fw_name} REQUIRED ${requires})
+FOREACH(flag ${${fw_name}_CFLAGS})
+       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag} -Werror")
+ENDFOREACH(flag)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC ")
+SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -Wall -Werror")
+
+IF("${ARCH}" STREQUAL "arm")
+    ADD_DEFINITIONS("-DTARGET")
+ENDIF("${ARCH}" STREQUAL "arm")
+
+ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
+ADD_DEFINITIONS("-DSLP_DEBUG")
+
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}")
+
+ADD_LIBRARY(${fw_name} SHARED
+       app_device.c
+       app_main.c
+       app_resource.c
+       app_resource_manager.c
+       i18n.c
+       )
+
+TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS})
+
+SET_TARGET_PROPERTIES(${fw_name}
+     PROPERTIES
+     VERSION ${FULLVER}
+     SOVERSION ${MAJORVER}
+     CLEAN_DIRECT_OUTPUT 1
+)
+
+INSTALL(TARGETS ${fw_name} DESTINATION ${LIB_INSTALL_DIR})
+INSTALL(
+        DIRECTORY ${INC_DIR}/ DESTINATION include/appfw
+        FILES_MATCHING
+        PATTERN "*_private.h" EXCLUDE
+        PATTERN "${INC_DIR}/*.h"
+        )
+
+SET(PC_NAME ${fw_name})
+SET(PC_REQUIRED ${pc_requires})
+SET(PC_LDFLAGS -l${fw_name})
+
+CONFIGURE_FILE(
+    ${CMAKE_SOURCE_DIR}/capi-appfw-module.pc.in
+    ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc
+    @ONLY
+)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)