[capi-network-wifi-direct]Modify the spec file to add version 04/42004/1 submit/tizen/20150619.123909
authorYu Jiung <jiung.yu@samsung.com>
Sat, 20 Jun 2015 05:16:38 +0000 (14:16 +0900)
committerYu Jiung <jiung.yu@samsung.com>
Sat, 20 Jun 2015 06:10:49 +0000 (15:10 +0900)
Change-Id: Iebafd9f560189851ea8bbda5e9eca4ffd139a373
Signed-off-by: Yu jiung <jiung.yu@samsung.com>
CMakeLists.txt
packaging/capi-network-wifi-direct.spec
src/CMakeLists.txt

index 33b4ef5..7c13548 100644 (file)
@@ -11,4 +11,4 @@ SET(dependents "capi-base-common")
 SET(pc_dependents "capi-base-common")
 
 ADD_SUBDIRECTORY(src)
-ADD_SUBDIRECTORY(test)
+#ADD_SUBDIRECTORY(test)
index 6ece0ea..d8511cf 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-network-wifi-direct
 Summary:    Network WiFi-Direct library in Tizen CAPI
-Version:    1.2.33
+Version:    1.2.34
 Release:    1
 Group:      Network & Connectivity/Wireless
 License:    Apache-2.0
@@ -26,15 +26,15 @@ Requires: capi-base-common-devel
 %description devel
 wifi direct library (Shared Library) (Development)
 
-%description
-
-%package -n test-wifi-direct
-Summary:    Test Application for Wi-Fi Direct
-Group:      TO_BE_FILLED
-Requires:   %{name} = %{version}-%{release}
+#%description
+#
+#%package -n test-wifi-direct
+#Summary:    Test Application for Wi-Fi Direct
+#Group:      TO_BE_FILLED
+#Requires:   %{name} = %{version}-%{release}
 
-%description -n test-wifi-direct
-Test Application for Wi-Fi Direct
+#%description -n test-wifi-direct
+#Test Application for Wi-Fi Direct
 
 %prep
 %setup -q
@@ -51,6 +51,9 @@ export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
 
+MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
+
+
 cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
 %if "%{?tizen_profile_name}" == "wearable"
        -DTIZEN_FEATURE_SERVICE_DISCOVERY=0 \
@@ -65,8 +68,7 @@ cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
 %endif
 %endif
 %endif
-       .
-
+       . -DVERSION=%{version} -DMAJORVERSION=${MAJORVER} -DCMAKE_LIB_DIR=%{_libdir}
 make %{?jobs:-j%jobs}
 %install
 rm -rf %{buildroot}
@@ -84,17 +86,16 @@ cp %{_builddir}/%{buildsubdir}/LICENSE.APLv2 %{buildroot}/usr/share/license/%{na
 %files
 %manifest capi-network-wifi-direct.manifest
 %defattr(-,root,root,-)
-%{_libdir}/libwifi-direct.so
-%{_libdir}/libwifi-direct.so.0
-%{_libdir}/libwifi-direct.so.0.0
+%{_libdir}/libwifi-direct.so*
 /usr/share/license/%{name}
 
 %files devel
 %defattr(-,root,root,-)
 %{_libdir}/pkgconfig/capi-network-wifi-direct.pc
 %{_includedir}/wifi-direct/wifi-direct.h
+%{_libdir}/libwifi-direct.so
 
-%files -n test-wifi-direct
-%manifest test-wifi-direct.manifest
-%defattr(4755,app,app,4755)
-%{_bindir}/test-wifi-direct
+#%files -n test-wifi-direct
+#%manifest test-wifi-direct.manifest
+#%defattr(4755,app,app,4755)
+#%{_bindir}/test-wifi-direct
index 08b315d..c47ba5f 100644 (file)
@@ -2,7 +2,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 PROJECT(wifi-direct C)
 
 # Global setting
-SET(VERSION 0.0)
+#SET(VERSION 0.0)
 
 MACRO(GET_TARGET_PROPERTY_WITH_DEFAULT _variable _target _property _default_value)
         GET_TARGET_PROPERTY (${_variable} ${_target} ${_property})
@@ -52,7 +52,7 @@ MACRO(CREATE_LIBTOOL_FILE _target _install_DIR)
         FILE(APPEND ${_laname} "dlpreopen='${_target_dlpreopen}'\n\n")
         FILE(APPEND ${_laname} "# Directory that this library needs to be installed in:\n")
         FILE(APPEND ${_laname} "libdir='${CMAKE_INSTALL_PREFIX}${_install_DIR}'\n")
-        INSTALL( FILES ${_laname} DESTINATION ${CMAKE_INSTALL_PREFIX}${_install_DIR})
+        INSTALL( FILES ${_laname} DESTINATION ${_install_DIR})
 ENDMACRO(CREATE_LIBTOOL_FILE)
 
 # Build type : Release
@@ -69,6 +69,8 @@ FOREACH(flag ${pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
 ENDFOREACH(flag)
 
+SET(LIBDIR ${CMAKE_LIB_DIR})
+
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
                ${CMAKE_SOURCE_DIR}/src/include)
 
@@ -99,7 +101,7 @@ IF(TIZEN_TV)
 ENDIF(TIZEN_TV)
 
 # Linker flags
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed, --rpath=${LIBDIR}")
 
 # Build
 SET(SRCS
@@ -108,14 +110,19 @@ SET(SRCS
 
 ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
-SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION} SOVERSION 0)
-CREATE_LIBTOOL_FILE(${PROJECT_NAME} /lib)
+SET_TARGET_PROPERTIES(${PROJECT_NAME}
+     PROPERTIES
+     VERSION ${VERSION}
+     SOVERSION ${MAJORVERSION}
+     CLEAN_DIRECT_OUTPUT 1
+)
+CREATE_LIBTOOL_FILE(${PROJECT_NAME} ${LIBDIR})
 
 # pkgconfig file
 CONFIGURE_FILE(capi-network-wifi-direct.pc.in capi-network-wifi-direct.pc @ONLY)
 
 # Install
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib COMPONENT Runtime)
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIBDIR} COMPONENT Runtime)
 INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/wifi-direct.h DESTINATION include/wifi-direct)
-INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/capi-network-wifi-direct.pc DESTINATION lib/pkgconfig)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/capi-network-wifi-direct.pc DESTINATION ${LIBDIR}/pkgconfig)