cleanup packaging and building config and fix build error 37/10237/3
authorYoungjae Shin <yj99.shin@samsung.com>
Wed, 25 Sep 2013 08:31:20 +0000 (17:31 +0900)
committerYoungjae Shin <yj99.shin@samsung.com>
Fri, 27 Sep 2013 05:42:08 +0000 (14:42 +0900)
Change-Id: I13d991676703a8c43392bb438a0625274e6aeaa7

12 files changed:
AUTHORS
CMakeLists.txt
debian/changelog [deleted file]
debian/compat [deleted file]
debian/control [deleted file]
debian/libnfc-plugin-emul-0.install.in [deleted file]
debian/libnfc-plugin-emul-0.postinst.in [deleted file]
debian/libnfc-plugin-emul-dbg.install.in [deleted file]
debian/libnfc-plugin-emul-dev.install.in [deleted file]
debian/rules [deleted file]
packaging/nfc-plugin-emul.spec
src/oem/oem_emul.c

diff --git a/AUTHORS b/AUTHORS
index 22aae9a6c2080c57d8a774ac14483c162285e03e..dcaaa07aa09a5c43f3938db62533cecdf432e1ae 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -4,4 +4,4 @@ Wonkyu Kwon <wonkyu.kwon at samsung dot com>
 Sungjae Lim <neueziel.lim at samsung dot com>
 Sechang Sohn <sc.sohn at samsung dot com>
 Jinmin Chung <jinmin at samsung dot com>
-Jaekyun Lee <jkyun.lee at samsung dot com>
+Youngjae Shin <yj99.shin at samsung dot com>
index 5692b881c0c3730ede391fc534b5b2efbd73c989..f3fe9382010faf4bcd7c7d802a3f6e443d5e97e9 100755 (executable)
@@ -3,9 +3,9 @@ PROJECT(nfc-plugin C)
 
 MESSAGE("build nfc-plugin-emul")
 
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src)
 
-AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/src/oem SRCS)
+AUX_SOURCE_DIRECTORY(${CMAKE_SOURCE_DIR}/src/oem SRCS)
 
 IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
        SET(CMAKE_BUILD_TYPE "Release")
@@ -13,29 +13,21 @@ ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
 MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
 
 INCLUDE(FindPkgConfig)
-
-pkg_check_modules(pkgs REQUIRED glib-2.0 gobject-2.0 dlog nfc-common-lib vconf)
+pkg_check_modules(pkgs REQUIRED glib-2.0 gobject-2.0 dlog nfc-common vconf)
 
 FOREACH(flag ${pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
 ENDFOREACH(flag)
 
-# this for NFC flag
-
-SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fno-strict-aliasing -pipe -fomit-frame-pointer -Wall -Wno-trigraphs -Werror-implicit-function-declaration -Wl,-zdefs -fvisibility=hidden")
-SET(ARM_CFLAGS "${ARM_CFLAGS} -mapcs -mno-sched-prolog -mabi=aapcs-linux -Uarm -fno-common -fpic")
-
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror-implicit-function-declaration -Wl,--unresolved-symbols=ignore-in-shared-libs")
+SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Wall -Werror-implicit-function-declaration")
+SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fPIC -fvisibility=hidden")
+#SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fno-strict-aliasing")
 
 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
-SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
-#SET(CMAKE_C_FLAGS_RELEASE "-O2")
 
-ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
 ADD_DEFINITIONS("-DUSE_GLIB_MAIN_LOOP")
 
 ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
-
-TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} "-ldl")
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} dl)
 
 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib/nfc)
diff --git a/debian/changelog b/debian/changelog
deleted file mode 100755 (executable)
index e7e3842..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-nfc-plugin-emul (0.0.1-10) unstable; urgency=low
-
-  * Add the function checking nfc feature.
-  * Git: slp/pkgs/n/nfc-plugin-emul
-  * Tag: nfc-plugin-emul_0.0.1-10
-
- -- Wonkyu Kwon <wonkyu.kwon@samsung.com>  Wed, 30 May 2012 16:35:27 +0900
-
-nfc-plugin-emul (0.0.1-9) unstable; urgency=low
-
-  * fix issues
-  * Git: slp/pkgs/n/nfc-plugin-emul
-  * Tag: nfc-plugin-emul_0.0.1-9
-
- -- Junyong Sim <junyong.sim@samsung.com>  Thu, 24 May 2012 18:44:32 +0900
-
-nfc-plugin-emul (0.0.1-8) unstable; urgency=low
-
-  * fix tag write fail issue
-  * Git: slp/pkgs/n/nfc-plugin-emul
-  * Tag: nfc-plugin-emul_0.0.1-8
-
- -- Junyong Sim <junyong.sim@samsung.com>  Mon, 23 Apr 2012 17:22:48 +0900
-
-nfc-plugin-emul (0.0.1-7) unstable; urgency=low
-
-  * fix tag type issue
-  * Git: slp/pkgs/n/nfc-plugin-emul
-  * Tag: nfc-plugin-emul_0.0.1-7
-
- -- Junyong Sim <junyong.sim@samsung.com>  Sun, 22 Apr 2012 22:57:25 +0900
-
-nfc-plugin-emul (0.0.1-6) unstable; urgency=low
-
-  * change boilerplate from samsung to Apache
-  * Git: slp/pkgs/n/nfc-plugin-emul
-  * Tag: nfc-plugin-emul_0.0.1-6
-
- -- Junyong Sim <junyong.sim@samsung.com>  Fri, 16 Mar 2012 13:17:34 +0900
-
-nfc-plugin-emul (0.0.1-5) unstable; urgency=low
-
-  * change boilerplate
-  * Git: slp/pkgs/n/nfc-plugin-emul
-  * Tag: nfc-plugin-emul_0.0.1-5
-
- -- Junyong Sim <junyong.sim@samsung.com>  Fri, 17 Feb 2012 11:23:10 +0900
-
-nfc-plugin-emul (0.0.1-4) unstable; urgency=low
-
-  * apply the changed message structure of nfc manager
-  * Git: slp/pkgs/n/nfc-plugin-emul
-  * Tag: nfc-plugin-emul_0.0.1-4
-
- -- Junyong Sim <junyong.sim@samsung.com>  Mon, 13 Feb 2012 14:28:58 +0900
-
-nfc-plugin-emul (0.0.1-3) unstable; urgency=low
-
-  * implement p2p feature
-  * Git: slp/pkgs/n/nfc-plugin-emul
-  * Tag: nfc-plugin-emul_0.0.1-3
-
- -- Junyong Sim <junyong.sim@samsung.com>  Fri, 13 Jan 2012 13:12:09 +0900
-
-nfc-plugin-emul (0.0.1-2) unstable; urgency=low
-
-  * update changelog for first upload
-  * Git: slp/pkgs/n/nfc-plugin-emul
-  * Tag: nfc-plugin-emul_0.0.1-2
-
- -- Junyong Sim <junyong.sim@samsung.com>  Tue, 27 Dec 2011 11:22:56 +0900
-
-nfc-plugin-emul (0.0.1-1) unstable; urgency=low
-
-  * first source package for building
-  * Git: slp/pkgs/n/nfc-plugin-emul
-  * Tag: nfc-plugin-emul_0.0.1-1
-
- -- Junyong Sim <junyong.sim@samsung.com>  Wed, 21 Dec 2011 21:11:57 +0900
diff --git a/debian/compat b/debian/compat
deleted file mode 100755 (executable)
index 7ed6ff8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-5
diff --git a/debian/control b/debian/control
deleted file mode 100755 (executable)
index 980d36f..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-Source: nfc-plugin-emul
-Section: libs
-Priority: extra
-Maintainer: Junyong Sim <junyong.sim@samsung.com>
-Build-Depends: debhelper (>= 5), libaul-1-dev, syspopup-caller-dev, libglib2.0-dev, libecore-dev, libvconf-dev, libelm-dev, libmm-common-dev, libmm-sound-dev, libsecurity-server-client-dev, libcontacts-service-dev, libcontacts-service-dev, libbluetooth-frwk-dev,libdbus-glib-1-dev, dlog-dev, libslp-memo-dev, syspopup-caller-dev, libnfc-common-lib-dev
-Standards-Version: 0.0.1
-
-Package: libnfc-plugin-emul-0
-Section: libs
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: NFC Plugin for Emulator
-
-Package: libnfc-plugin-emul-dev
-Section: libs
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, libnfc-plugin-emul-0 (= ${Source-Version})
-Description: NFC Plugin for Emulator (stripped)
-
-Package: libnfc-plugin-emul-dbg
-Section: debug
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, libnfc-plugin-emul-0 (= ${Source-Version}) 
-Description: NFC Plugin for Emulator (unstripped)
diff --git a/debian/libnfc-plugin-emul-0.install.in b/debian/libnfc-plugin-emul-0.install.in
deleted file mode 100755 (executable)
index 941292e..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-@PREFIX@/lib/*.so
-#@PREFIX@/bin/*
-#@PREFIX@/share/dbus-1/services/*
-
diff --git a/debian/libnfc-plugin-emul-0.postinst.in b/debian/libnfc-plugin-emul-0.postinst.in
deleted file mode 100755 (executable)
index 812360e..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh
-
-EMUL_FILE_PATH="/opt/nfc"
-
-if [ ${USER} == "root" ]
-then
-echo "User Is ROOT"
-if [ ! -d $EMUL_FILE_PATH ]; then
-       echo "Creating $EMUL_FILE_PATH directory."
-       mkdir -p $EMUL_FILE_PATH
-fi
-
-chown :0 $EMUL_FILE_PATH
-chmod 775 $EMUL_FILE_PATH
-
-fi
-
diff --git a/debian/libnfc-plugin-emul-dbg.install.in b/debian/libnfc-plugin-emul-dbg.install.in
deleted file mode 100755 (executable)
index 8b13789..0000000
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/debian/libnfc-plugin-emul-dev.install.in b/debian/libnfc-plugin-emul-dev.install.in
deleted file mode 100755 (executable)
index 82131a2..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#@PREFIX@/lib/pkgconfig/*
-#@PREFIX@/include/*
-
diff --git a/debian/rules b/debian/rules
deleted file mode 100755 (executable)
index bae1f88..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-#!/usr/bin/make -f
-# -*- makefile -*-
-# Sample debian/rules that uses debhelper.
-# This file was originally written by Joey Hess and Craig Small.
-# As a special exception, when this file is copied by dh-make into a
-# dh-make output file, you may use that output file without restriction.
-# This special exception was added by Craig Small in version 0.37 of dh-make.
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-CFLAGS ?= -Wall -g
-CXXFLAGS ?=  -Wall -g
-LDFLAGS ?= 
-PREFIX ?= /usr
-DATADIR ?= /opt
-
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
-       CFLAGS += -O0
-       CXXFLAGS += -O0
-else
-       CFLAGS += -O2
-       CXXFLAGS += -O2
-endif
-
-LDFLAGS += -Wl,--rpath=$(PREFIX)/lib -Wl,--as-needed
-
-CMAKE_TMP_DIR = $(CURDIR)/cmake_tmp
-
-
-configure: configure-stamp
-configure-stamp:
-       dh_testdir
-       # Add here commands to configure the package.
-       mkdir -p $(CMAKE_TMP_DIR);
-       cd $(CMAKE_TMP_DIR); CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" cmake .. -DCMAKE_INSTALL_PREFIX=$(PREFIX)
-
-       touch configure-stamp
-
-build: build-stamp
-
-build-stamp: configure-stamp 
-       dh_testdir
-
-       # Add here commands to compile the package.
-       cd $(CMAKE_TMP_DIR) && $(MAKE)
-       #docbook-to-man debian/wavplayer.sgml > wavplayer.1
-
-       for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
-               cat $$f > $${f%.in}; \
-               sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \
-               sed -i -e "s#@DATADIR@#$(DATADIR)#g" $${f%.in}; \
-       done
-
-
-       touch $@
-
-clean:
-       dh_testdir
-       dh_testroot
-       rm -f build-stamp configure-stamp
-
-       # Add here commands to clean up after the build process.
-       -cd $(CMAKE_TMP_DIR) && $(MAKE) clean
-       rm -rf $(CMAKE_TMP_DIR)
-
-       rm -rf CMakeCache.txt
-       rm -rf CMakeFiles
-       rm -rf cmake_install.cmake
-       rm -rf Makefile
-       rm -rf install_manifest.txt
-       rm -rf *.so
-
-       for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
-               rm -f $${f%.in}; \
-       done
-
-       dh_clean 
-
-install: build
-       dh_testdir
-       dh_testroot
-       dh_clean -k 
-       dh_installdirs
-
-
-       # Add here commands to install the package into debian/wavplayer.
-       cd $(CMAKE_TMP_DIR) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
-
-
-# Build architecture-independent files here.
-binary-indep: build install
-# We have nothing to do by default.
-
-# Build architecture-dependent files here.
-binary-arch: build install
-       dh_testdir
-       dh_testroot
-       dh_installchangelogs 
-#      dh_installdocs
-       dh_installexamples
-       dh_install --sourcedir=debian/tmp
-#      dh_installmenu
-#      dh_installdebconf       
-#      dh_installlogrotate
-#      dh_installemacsen
-#      dh_installpam
-#      dh_installmime
-#      dh_python
-#      dh_installinit
-#      dh_installcron
-#      dh_installinfo
-       dh_installman
-       dh_link
-       dh_strip --dbg-package=libnfc-plugin-emul-dbg
-       dh_compress
-       dh_fixperms
-#      dh_perl
-       dh_makeshlibs
-       dh_installdeb
-       dh_shlibdeps
-       dh_gencontrol
-       dh_md5sums
-       dh_builddeb
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install configure
index b0620c2df794cef7d4732adf5cd79ebfec1520e1..a11d3c60af087907fbe0ef6e346beaf11ec9991e 100644 (file)
@@ -1,52 +1,35 @@
 Name:       nfc-plugin-emul
 Summary:    NFC emul plugin
-Version:    0.0.10
+Version:    0.0.11
 Release:    0
-Group:      TO_BE/FILLED_IN
+Group:      Network & Connectivity/NFC
 License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
 BuildRequires: pkgconfig(glib-2.0)
 BuildRequires: pkgconfig(gobject-2.0)
 BuildRequires: pkgconfig(vconf)
 BuildRequires: pkgconfig(dlog)
-BuildRequires: pkgconfig(nfc-common-lib)
+BuildRequires: pkgconfig(nfc-common)
 BuildRequires: cmake
-BuildRequires: gettext-tools
 
 %description
-NFC Plugin Emul
+NFC Plugin for Emulator
 
 %prep
 %setup -q
 
-
 %build
-cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
-
-make %{?jobs:-j%jobs}
+%cmake .
 
 %install
-rm -rf %{buildroot}
+#rm -rf %{buildroot}
 %make_install
 
+%postun -p /sbin/ldconfig
 
-%postun
-/sbin/ldconfig
-rm -f build-stamp configure-stamp
-cd cmake_tmp
-rm -rf $(CMAKE_TMP_DIR)
-rm -rf CMakeCache.txt
-rm -rf CMakeFiles
-rm -rf cmake_install.cmake
-rm -rf Makefile
-rm -rf install_manifest.txt
-rm -rf *.so
-
-%post
-
-
+%post -p /sbin/ldconfig
 
 %files
 %defattr(-,root,root,-)
 %{_libdir}/nfc/libnfc-plugin.so
-
+%license LICENSE.APLv2
index 06d5f85b5a019b6ce6dbecebd90c48be156df9b5..a87add2ecab4edaa8a5c72b27a8ecfa06bcbefc2 100644 (file)
@@ -38,7 +38,6 @@
 #include "net_nfc_oem_controller.h"
 #include "net_nfc_typedef.h"
 #include "nfc_debug_private.h"
-#include "net_nfc_util_private.h"
 #include "net_nfc_util_ndef_message.h"
 #include "net_nfc_util_ndef_record.h"
 
@@ -2283,11 +2282,11 @@ static bool net_nfc_emul_controller_transceive(net_nfc_target_handle_s *handle,
 
                        data_s *temp;
 
-                       _net_nfc_util_alloc_mem(temp, sizeof(data_s));
+                       temp = calloc(1, sizeof(data_s));
                        if (temp != NULL) {
                                temp->length = 9;
 
-                               _net_nfc_util_alloc_mem(temp->buffer, temp->length);
+                               temp->buffer = calloc(1, temp->length);
                                if (temp->buffer != NULL) {
                                        temp->buffer[7] = (uint8_t)0x91;
                                        temp->buffer[8] = (uint8_t)0xAF;
@@ -2296,7 +2295,7 @@ static bool net_nfc_emul_controller_transceive(net_nfc_target_handle_s *handle,
                                        ret = true;
                                } else {
                                        *result = NET_NFC_ALLOC_FAIL;
-                                       _net_nfc_util_free_mem(temp);
+                                       free(temp);
                                }
                        } else {
                                *result = NET_NFC_ALLOC_FAIL;