Modify the code about pkgconfig and remove trailing whitespace
authorso.yu <so.yu@samsung.com>
Fri, 5 Apr 2013 08:37:58 +0000 (17:37 +0900)
committerso.yu <so.yu@samsung.com>
Fri, 5 Apr 2013 08:42:15 +0000 (17:42 +0900)
Change-Id: I150d539f93243681fa7aad6d6a6a4320b8a65ee1
Signed-off-by: so.yu <so.yu@samsung.com>
CMakeLists.txt
LICENSE.APLv2
dukgenerator.pc.in
inc/dukgen.h
packaging/dukgenerator.spec
src/dukgen.c

index 0cd17a8..2c2ad84 100644 (file)
@@ -8,8 +8,10 @@ SET(INCLUDEDIR "\${prefix}/include")
 
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/inc)
 
-#INCLUDE(FindPkgConfig)
-#pkg_check_modules(pkgs REQUIRED openssl libcryptsvc-devel)
+SET(pc_requires " cryptsvc ")
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(pkgs REQUIRED ${pc_requires})
 
 FOREACH(flag ${pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
@@ -33,12 +35,12 @@ SET(libcryptsvc_CPPFLAGS " -DPIC ")
 
 #ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
 ADD_LIBRARY(${PROJECT_NAME} ${SRCS})
-TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} -ldl -lssl -lcrypto -lcryptsvc)
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
 SET_TARGET_PROPERTIES(
        ${PROJECT_NAME}
        PROPERTIES
-       SOVERSION 0
-       VERSION 0.0.0
+       VERSION ${FULLVER}
+       SOVERSION ${MAJORVER}
 )
 ##################################################################################################################
 
@@ -49,7 +51,12 @@ IF("${ARCH}" STREQUAL "arm")
        MESSAGE("add -DTARGET")
 ENDIF("${ARCH}" STREQUAL "arm")
 
-CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc)
+SET(PC_NAME ${PROJECT_NAME})
+SET(PC_DESCRIPTION ${DESCRIPTION})
+SET(PC_LDFLAGS -l${PROJECT_NAME})
+SET(PC_REQUIRED ${pc_requires})
+CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
+
 INSTALL(FILES ${PROJECT_NAME}.pc DESTINATION lib/pkgconfig)
 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib)
 INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/inc/ DESTINATION /usr/include)
index a795f06..1b461a0 100644 (file)
@@ -188,7 +188,7 @@ Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
       same "printed page" as the copyright notice for easier
       identification within third-party archives.
 
-   Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved 
+   Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
 
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
index 3ca3790..2cd5754 100755 (executable)
@@ -1,11 +1,13 @@
-prefix=/usr
-libdir=/usr/lib
-includedir=/usr/include
+# Package Information for pkg-config
 
-Name:dukgenerator 
-Description:nothing 
-Version: 1.0.0
-Requires: openssl libcryptsvc
-Libs: -L${libdir} -lcryptsvc
+prefix=@PREFIX@
+libdir=@PREFIX@/lib
+includedir=@PREFIX@/include
+
+Name: @PC_NAME@
+Description: @DESCRIPTION@
+Version: @FULLVER@
+Requires: @PC_REQUIRED@
+Libs: -L${libdir} @PC_LDFLAGS@
 Cflags: -I${includedir}
+
index ad0fe02..1317176 100644 (file)
@@ -1,17 +1,17 @@
-// 
-// Copyright (c) 2013 Samsung Electronics Co., Ltd. 
-// 
-// Licensed under the Apache License, Version 2.0 (the License); 
-// you may not use this file except in compliance with the License. 
-// You may obtain a copy of the License at 
-// 
-//     http://www.apache.org/licenses/LICENSE-2.0 
-// 
-// Unless required by applicable law or agreed to in writing, software 
-// distributed under the License is distributed on an "AS IS" BASIS, 
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
-// See the License for the specific language governing permissions and 
-// limitations under the License. 
+//
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
 //
 
 #ifndef _DUK_GENERATOR_H_
index 9f27d56..d577f96 100644 (file)
@@ -1,14 +1,14 @@
-Name:      dukgenerator 
+Name:      dukgenerator
 Summary:   nothing
 Version:    1.0.0
-Release:    5
+Release:    6
 Group:      security
 License:    Apache License, Version 2.0
 Source0:    %{name}-%{version}.tar.gz
 BuildRequires: cmake
 
 BuildRequires: pkgconfig(openssl)
-BuildRequires: libcryptsvc-devel
+BuildRequires: pkgconfig(cryptsvc)
 
 %description
 
@@ -23,7 +23,8 @@ Requires: %{name} = %{version}-%{release}
 %setup -q
 
 %build
-cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
+MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
+cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DDESCRIPTION=%{summary}
 make %{?jobs:-j%jobs}
 
 
@@ -46,5 +47,3 @@ cp LICENSE.APLv2 %{buildroot}/usr/share/license/%{name}
 %files devel
 %{_includedir}/*
 %{_libdir}/pkgconfig/dukgenerator.pc
-%{_datadir}/license/%{name}
-
index 24d125b..db8c049 100755 (executable)
@@ -1,17 +1,17 @@
-// 
-// Copyright (c) 2013 Samsung Electronics Co., Ltd. 
-// 
-// Licensed under the Apache License, Version 2.0 (the License); 
-// you may not use this file except in compliance with the License. 
-// You may obtain a copy of the License at 
-// 
-//     http://www.apache.org/licenses/LICENSE-2.0 
-// 
-// Unless required by applicable law or agreed to in writing, software 
-// distributed under the License is distributed on an "AS IS" BASIS, 
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
-// See the License for the specific language governing permissions and 
-// limitations under the License. 
+//
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
 //
 //