pkg_check_modules(common_pkgs REQUIRED glib-2.0 gio-2.0 gio-unix-2.0 dlog bluetooth-api
libssl)
-SET(EXTRA_CFLAGS "-fPIC -Wall -Werror-implicit-function-declaration")
-
FOREACH(flag ${common_pkgs_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
ENDFOREACH(flag)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
-ADD_LIBRARY(${NFC_COMMON} SHARED ${COMMON_SRCS})
-SET_TARGET_PROPERTIES(${NFC_COMMON} PROPERTIES VERSION ${FULLVER} SOVERSION ${MAJORVER})
+ADD_LIBRARY(${NFC_COMMON} STATIC ${COMMON_SRCS})
TARGET_LINK_LIBRARIES(${NFC_COMMON} ${common_pkgs_LDFLAGS})
FILE(GLOB COMMON_HEADER include/*.h)
CONFIGURE_FILE(${NFC_COMMON}.pc.in ${NFC_COMMON}.pc @ONLY)
INSTALL(FILES ${NFC_COMMON}.pc DESTINATION lib/pkgconfig)
-INSTALL(TARGETS ${NFC_COMMON} DESTINATION lib)
-
FOREACH(hfile ${COMMON_HEADER})
INSTALL(FILES ${hfile} DESTINATION include/${NFC_COMMON})
ENDFOREACH(hfile)
static uint8_t *bt_addr = NULL;
/* for log tag */
-#define NET_NFC_MANAGER_NAME "nfc-manager-daemon"
static const char *log_tag = LOG_CLIENT_TAG;
-extern char *__progname;
FILE *nfc_log_file;
const char *net_nfc_get_log_tag()
return log_tag;
}
-void __attribute__ ((constructor)) lib_init()
-{
- if (__progname != NULL && strncmp(__progname, NET_NFC_MANAGER_NAME, strlen(NET_NFC_MANAGER_NAME)) == 0)
- {
- log_tag = LOG_SERVER_TAG;
- }
-}
-
-void __attribute__ ((destructor)) lib_fini()
+void net_nfc_change_log_tag()
{
+ log_tag = LOG_SERVER_TAG;
}
void net_nfc_manager_init_log()
CRC_B,
} CRC_type_e;
+void net_nfc_change_log_tag();
void net_nfc_manager_init_log();
void net_nfc_manager_fini_log();
includedir=@INCLUDE_INSTALL_DIR@/@NFC_COMMON@
Name: @NFC_COMMON@
-Description: NFC Common Library
+Description: NFC Common Headers
Version: @FULLVER@
Requires:
-Libs: -L${libdir} -l@NFC_COMMON@
+Libs:
Cflags: -I${includedir}
GOptionContext *option_context;
GError *error = NULL;
+ net_nfc_change_log_tag();
+
option_context = g_option_context_new("Nfc manager");
g_option_context_add_main_entries(option_context, option_entries, NULL);
Name: nfc-manager
Summary: NFC framework manager
-Version: 0.1.1
+Version: 0.1.2
Release: 0
Group: Network & Connectivity/NFC
License: Flora Software License
Requires(post): /sbin/ldconfig
Requires(post): /usr/bin/vconftool
Requires(postun): /sbin/ldconfig
-Requires: nfc-common-lib = %{version}
Requires: nfc-client-lib = %{version}
%setup -q
cp %{SOURCE1001} .
-%package -n nfc-common-lib
-Summary: NFC common library
-Group: Network & Connectivity/Development
-
-
-%description -n nfc-common-lib
-NFC Common library.
-
-%package -n nfc-common-lib-devel
+%package -n nfc-common-devel
Summary: NFC common library (devel)
Group: Network & Connectivity/Development
-Requires: nfc-common-lib = %{version}
-%description -n nfc-common-lib-devel
-NFC manager common library for internal development.
+%description -n nfc-common-devel
+NFC manager common header for internal development.
%package -n nfc-client-lib
Summary: NFC client library
Group: Network & Connectivity/NFC
-Requires: nfc-common-lib = %{version}
%description -n nfc-client-lib
systemctl restart %{name}.service
fi
-%post -n nfc-common-lib -p /sbin/ldconfig
%post -n nfc-client-lib
/sbin/ldconfig
fi
systemctl daemon-reload
-%postun -n nfc-common-lib -p /sbin/ldconfig
%postun -n nfc-client-lib -p /sbin/ldconfig
%{_includedir}/nfc/*.h
-%files -n nfc-common-lib
-%manifest %{name}.manifest
-%defattr(-,root,root,-)
-%{_libdir}/libnfc-common.so.*
-%license LICENSE.Flora
-
-
-%files -n nfc-common-lib-devel
+%files -n nfc-common-devel
%defattr(-,root,root,-)
-%{_libdir}/libnfc-common.so
%{_libdir}/pkgconfig/nfc-common.pc
%{_includedir}/nfc-common/*.h