From 4a25496c7ee3ac832b92f24000bdef3dffc0ee39 Mon Sep 17 00:00:00 2001 From: "so.yu" Date: Fri, 5 Apr 2013 17:37:58 +0900 Subject: [PATCH] Modify the code about pkgconfig and remove trailing whitespace Change-Id: I150d539f93243681fa7aad6d6a6a4320b8a65ee1 Signed-off-by: so.yu --- CMakeLists.txt | 19 +++++++++++++------ LICENSE.APLv2 | 2 +- dukgenerator.pc.in | 20 +++++++++++--------- inc/dukgen.h | 28 ++++++++++++++-------------- packaging/dukgenerator.spec | 11 +++++------ src/dukgen.c | 28 ++++++++++++++-------------- 6 files changed, 58 insertions(+), 50 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0cd17a8..2c2ad84 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/LICENSE.APLv2 b/LICENSE.APLv2 index a795f06..1b461a0 100644 --- a/LICENSE.APLv2 +++ b/LICENSE.APLv2 @@ -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. diff --git a/dukgenerator.pc.in b/dukgenerator.pc.in index 3ca3790..2cd5754 100755 --- a/dukgenerator.pc.in +++ b/dukgenerator.pc.in @@ -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} - + diff --git a/inc/dukgen.h b/inc/dukgen.h index ad0fe02..1317176 100644 --- a/inc/dukgen.h +++ b/inc/dukgen.h @@ -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_ diff --git a/packaging/dukgenerator.spec b/packaging/dukgenerator.spec index 9f27d56..d577f96 100644 --- a/packaging/dukgenerator.spec +++ b/packaging/dukgenerator.spec @@ -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} - diff --git a/src/dukgen.c b/src/dukgen.c index 24d125b..db8c049 100755 --- a/src/dukgen.c +++ b/src/dukgen.c @@ -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. // // -- 2.7.4