Support rpm build with signing as platform level 72/197972/4
authorJihoon Kim <jihoon48.kim@samsung.com>
Thu, 17 Jan 2019 10:27:49 +0000 (19:27 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Thu, 17 Jan 2019 10:37:50 +0000 (19:37 +0900)
Change-Id: I6ce44ddcd23e5721d8daaa3efd03d986c7d70dd6
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
CMakeLists.txt [new file with mode: 0644]
org.tizen.autofilld.manifest [new file with mode: 0644]
org.tizen.autofilld.xml [new file with mode: 0644]
packaging/org.tizen.autofilld.spec [new file with mode: 0644]
src/autofill_daemon_dlog.h

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644 (file)
index 0000000..7eca8bf
--- /dev/null
@@ -0,0 +1,47 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(autofilld C)
+
+SET(SRCS
+    src/autofill-daemon.c
+    src/autofill_config.c
+    src/autofill_stub.c
+    src/autofill_manager_stub.c
+    src/autofill_service_proxy.c
+)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(pkgs_test REQUIRED
+    dlog
+    rpc-port
+    glib-2.0
+    eina
+    capi-appfw-service-application
+    capi-appfw-app-manager
+    capi-appfw-preference
+)
+
+INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/include)
+
+FOREACH(flag ${pkgs_test_CFLAGS})
+       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+ADD_DEFINITIONS("-DEXPORTED=__attribute__((visibility(\"default\")))")
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIE")
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
+
+FIND_PROGRAM(UNAME NAMES uname)
+EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
+IF("${ARCH}" STREQUAL "arm")
+       ADD_DEFINITIONS("-DTARGET")
+       MESSAGE("add -DTARGET")
+ENDIF("${ARCH}" STREQUAL "arm")
+
+ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_test_LDFLAGS})
+
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${TZ_SYS_RO_APP}/org.tizen.${PROJECT_NAME}/bin)
+INSTALL(FILES ${CMAKE_BINARY_DIR}/org.tizen.autofilld.xml DESTINATION ${TZ_SYS_RO_PACKAGES})
+#INSTALL(FILES ${CMAKE_BINARY_DIR}/autofilld.manifest DESTINATION ${TZ_SYS_RO_PACKAGES})
diff --git a/org.tizen.autofilld.manifest b/org.tizen.autofilld.manifest
new file mode 100644 (file)
index 0000000..017d22d
--- /dev/null
@@ -0,0 +1,5 @@
+<manifest>
+ <request>
+    <domain name="_"/>
+ </request>
+</manifest>
diff --git a/org.tizen.autofilld.xml b/org.tizen.autofilld.xml
new file mode 100644 (file)
index 0000000..dcd9018
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" api-version="5.0" package="org.tizen.autofilld" version="1.0.6">
+       <label>autofilld</label>
+       <author email="jihoon48.kim@samsung.com" href="www.samsung.com">Jihoon Kim</author>
+       <description>autofilld</description>
+       <service-application appid="org.tizen.autofilld" auto-restart="true" exec="autofilld" multiple="false" nodisplay="true" on-boot="true" taskmanage="false" type="capp">
+               <label>autofill daemon</label>
+               <metadata key="http://tizen.org/rpc-port/privilege-check-bypass" value="AutofillAppPort|AutofillManagerPort"/>
+       </service-application>
+       <privileges>
+               <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
+               <privilege>http://tizen.org/privilege/datasharing</privilege>
+       </privileges>
+</manifest>
diff --git a/packaging/org.tizen.autofilld.spec b/packaging/org.tizen.autofilld.spec
new file mode 100644 (file)
index 0000000..f5b0f62
--- /dev/null
@@ -0,0 +1,71 @@
+Name:       org.tizen.autofilld
+Summary:    Autofill Daemon
+Version:    1.0.6
+Release:    1
+Group:      Graphics & UI Framework/Input
+License:    Apache-2.0
+Source0:    %{name}-%{version}.tar.gz
+BuildRequires:  cmake
+BuildRequires:  tidl
+BuildRequires:  hash-signer
+BuildRequires:  pkgconfig(libtzplatform-config)
+BuildRequires:  pkgconfig(dlog)
+BuildRequires:  pkgconfig(efl)
+BuildRequires:  pkgconfig(eina)
+BuildRequires:  pkgconfig(rpc-port)
+BuildRequires:  pkgconfig(glib-2.0)
+BuildRequires:  pkgconfig(capi-appfw-service-application)
+BuildRequires:  pkgconfig(capi-appfw-preference)
+BuildRequires:  pkgconfig(capi-appfw-app-manager)
+
+
+%description
+Autofill Daemon
+
+
+%prep
+%setup -q
+
+tidlc -s -l C -i tidl/autofill.tidl -o autofill_stub
+mv autofill_stub.h ./src/
+mv autofill_stub.c ./src/
+
+tidlc -p -l C -i tidl/autofill_service.tidl -o autofill_service_proxy
+mv autofill_service_proxy.h ./src/
+mv autofill_service_proxy.c ./src/
+
+tidlc -s -l C -i tidl/autofill_manager.tidl -o autofill_manager_stub
+mv autofill_manager_stub.h ./src/
+mv autofill_manager_stub.c ./src/
+
+
+%build
+export CFLAGS+=" -DTIZEN_DEBUG_ENABLE -fvisibility=hidden -Werror"
+export CXXFLAGS+=" -DTIZEN_DEBUG_ENABLE -fvisibility=hidden -Werror"
+export FFLAGS+=" -DTIZEN_DEBUG_ENABLE -fvisibility=hidden"
+
+rm -rf CMakeFiles
+rm -rf CMakeCache.txt
+MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
+cmake . -DCMAKE_INSTALL_PREFIX=/usr -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DLIB_INSTALL_DIR:PATH=%{_libdir} \
+        -DTZ_SYS_RO_APP=%TZ_SYS_RO_APP -DTZ_SYS_RO_PACKAGES=%TZ_SYS_RO_PACKAGES
+
+make %{?jobs:-j%jobs}
+
+%install
+rm -rf %{buildroot}
+%make_install
+
+%define tizen_sign 1
+%define tizen_sign_base /usr/apps/%{name}
+%define tizen_sign_level platform
+%define tizen_author_sign 1
+%define tizen_dist_sign 1
+
+
+%post
+
+%files
+%manifest %{name}.manifest
+%{TZ_SYS_RO_PACKAGES}/%{name}.xml
+%{TZ_SYS_RO_APP}/%{name}/*
index 454e14e..b6d9372 100644 (file)
 #define COLOR_LIGHTBLUE "\033[0;37m"
 #define COLOR_END       "\033[0;m"
 
+#ifndef LOGI
 #define LOGI(fmt, arg...) dlog_print(DLOG_INFO, LOG_TAG, "%s (%d) %s : " fmt, __FILE__, __LINE__, __FUNCTION__, ##arg)
+#endif
+
+#ifndef LOGD
 #define LOGD(fmt, arg...) dlog_print(DLOG_DEBUG, LOG_TAG, "%s (%d) %s : " fmt, __FILE__, __LINE__, __FUNCTION__, ##arg)
+#endif
+
+#ifndef LOGW
 #define LOGW(fmt, arg...) dlog_print(DLOG_WARN, LOG_TAG, "%s (%d) %s : " fmt, __FILE__, __LINE__, __FUNCTION__, ##arg)
+#endif
+
+#ifndef LOGE
 #define LOGE(fmt, arg...) dlog_print(DLOG_ERROR, LOG_TAG, "%s (%d) %s : " fmt, __FILE__, __LINE__, __FUNCTION__, ##arg)
+#endif
 
 #define PLOG(fmt, args...) LOGD(fmt, ##args)
 #define PINFO(fmt, args...) LOGI(COLOR_PURPLE "* Info * " fmt COLOR_END, ##args)