--- /dev/null
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(libsyscommon C)
+
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/src)
+ADD_SUBDIRECTORY(src/libgdbus)
\ No newline at end of file
+++ /dev/null
-AUTOMAKE_OPTIONS = foreign
-SUBDIRS = src
+++ /dev/null
-#!/bin/sh
-
-set -e
-
-opt="$1"
-
-if [ -f .git/hooks/pre-commit.sample ] && [ ! -f .git/hooks/pre-commit ]; then
- # This part is allowed to fail
- cp -p .git/hooks/pre-commit.sample .git/hooks/pre-commit && \
- chmod +x .git/hooks/pre-commit && \
- echo "Activated pre-commit hook." || :
-fi
-
-# README and INSTALL are required by automake, but may be deleted by
-# clean up rules. to get automake to work, simply touch these here,
-# they will be regenerated from their corresponding *.in files by
-# ./configure anyway.
-touch README INSTALL
-
-# make sure m4 dir exist
-mkdir -p m4
-
-autoreconf --force --install --verbose || exit $?
-
-if [ "x$opt" = "xc" ]; then
- set -x
- ./configure $args
- make clean > /dev/null
-elif [ "x$opt" = "xd" ]; then
- set -x
- ./configure CFLAGS='-g -O0 -ftrapv' $args
- make clean > /dev/null
-elif [ "x$opt" = "xg" ]; then
- set -x
- ./configure CFLAGS='-g -Og -ftrapv' $args
- make clean > /dev/null
-elif [ "x$opt" = "xl" ]; then
- set -x
- ./configure CC=clang CFLAGS='-g -O0 -ftrapv' $args
- make clean > /dev/null
-elif [ "x$opt" = "xs" ]; then
- set -x
- scan-build ./configure CFLAGS='-std=gnu99 -g -O0 -ftrapv' $args
- scan-build make
-fi
+++ /dev/null
-# -*- Autoconf -*-
-# Process this file with autoconf to produce a configure script.
-
-AC_PREREQ([2.68])
-AC_INIT([libsystem], [4.1], [walyong.cho@samsung.com])
-
-dnl AC_CONFIG_MACRO_DIRS([m4])
-AC_CONFIG_MACRO_DIR([m4])
-AC_CONFIG_HEADERS([config.h])
-
-AC_USE_SYSTEM_EXTENSIONS
-AC_SYS_LARGEFILE
-AC_PREFIX_DEFAULT([/usr])
-AM_INIT_AUTOMAKE([foreign subdir-objects])
-
-LT_PREREQ(2.2)
-LT_INIT([disable-static])
-
-# Checks for programs.
-AC_PROG_CXX
-AC_PROG_AWK
-AC_PROG_CC
-AC_PROG_CPP
-AC_PROG_INSTALL
-AC_PROG_LN_S
-AC_PROG_MAKE_SET
-AC_PROG_RANLIB
-
-# Checks for libraries.
-# FIXME: Replace `main' with a function in `-lrt':
-AC_CHECK_LIB([rt], [main])
-
-# Checks for header files.
-AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h mntent.h stddef.h stdint.h stdlib.h string.h sys/time.h unistd.h])
-
-# Checks for typedefs, structures, and compiler characteristics.
-AC_CHECK_HEADER_STDBOOL
-AC_C_INLINE
-AC_TYPE_INT32_T
-AC_TYPE_INT64_T
-AC_TYPE_MODE_T
-AC_TYPE_PID_T
-AC_TYPE_SIZE_T
-AC_TYPE_SSIZE_T
-AC_TYPE_UINT32_T
-AC_TYPE_UINT64_T
-
-# Checks for library functions.
-AC_FUNC_FORK
-AC_FUNC_GETMNTENT
-AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
-AC_FUNC_MKTIME
-AC_FUNC_REALLOC
-AC_CHECK_FUNCS([dup2 getmntent gettimeofday localtime_r memset mkdir rmdir strchr strcspn strdup strndup strrchr strspn])
-
-AC_CHECK_TOOL(GPERF, gperf)
-if test -z "$GPERF" ; then
- AC_MSG_ERROR([*** gperf not found])
-fi
-
-# ------------------------------------------------------------------------------
-our_cflags=" \
- -g -O2 \
- -Werror \
- -fpie"
-
-our_ldflags=" \
- -Wl,--as-needed \
- -Wl,--no-undefined \
- -Wl,--gc-sections \
- -Wl,-z,relro \
- -Wl,-z,now \
- -pie"
-
-our_cflags=$(echo $our_cflags |sed 's/\t/ /g' | sed 's/ / /g')
-our_ldflags=$(echo $our_ldflags | sed 's/\t/ /g' | sed 's/ / /g')
-
-AC_SUBST([OUR_CFLAGS], "$our_cflags")
-AC_SUBST([OUR_LDFLAGS], "$our_ldflags")
-
-# ------------------------------------------------------------------------------
-PKG_CHECK_MODULES(GLIB, [glib-2.0])
-PKG_CHECK_MODULES(GIO, [gio-2.0])
-PKG_CHECK_MODULES(GIO_UNIX, [gio-unix-2.0])
-
-# ------------------------------------------------------------------------------
-AC_SUBST([LIBGDBUS_PC_REQUIRES], "libgdbus")
-AC_SUBST([LIBGDBUS_PC_CFLAGS], "")
-AC_SUBST([LIBGDBUS_PC_LIBS], "-L${libdir} -lgdbus")
-
-AC_SUBST([LIBGDBUS_PC_REQUIRES], "${LIBGDBUS_PC_REQUIRES} ${DBUS_REQUIRES}")
-AC_SUBST([LIBGDBUS_PC_CFLAGS], "${LIBGDBUS_PC_CFLAGS} ${DBUS_CFLAGS}")
-AC_SUBST([LIBGDBUS_PC_LIBS], "${LIBGDBUS_PC_LIBS} ${DBUS_LIBS}")
-
-AC_SUBST([LIBGDBUS_PC_REQUIRES], "${LIBGDBUS_PC_REQUIRES} ${GIO_REQUIRES}")
-AC_SUBST([LIBGDBUS_PC_CFLAGS], "${LIBGDBUS_PC_CFLAGS} ${GIO_CFLAGS}")
-AC_SUBST([LIBGDBUS_PC_LIBS], "${LIBGDBUS_PC_LIBS} ${GIO_LIBS}")
-
-AC_SUBST([LIBGDBUS_PC_REQUIRES], "${LIBGDBUS_PC_REQUIRES} ${GIO_UNIX_REQUIRES}")
-AC_SUBST([LIBGDBUS_PC_CFLAGS], "${LIBGDBUS_PC_CFLAGS} ${GIO_UNIX_CFLAGS}")
-AC_SUBST([LIBGDBUS_PC_LIBS], "${LIBGDBUS_PC_LIBS} ${GIO_UNIX_LIBS}")
-
-# ------------------------------------------------------------------------------
-AC_CONFIG_FILES([Makefile
- src/Makefile])
-AC_OUTPUT
-AC_MSG_RESULT([
- $PACKAGE_NAME $VERSION
-
- prefix: ${prefix}
- rootprefix: ${with_rootprefix}
- datarootdir: ${datarootdir}
- lib dir: ${libdir}
- rootlib dir: ${with_rootlibdir}
-
- OUR CFLAGS: ${OUR_CFLAGS}
- CFLAGS: ${CFLAGS}
- OUR LDFLAGS: ${OUR_LDFLAGS}
- LDFLAGS: ${LDFLAGS}
-])
Source1001: %{name}.manifest
%endif
-BuildRequires: autoconf
-BuildRequires: automake
-BuildRequires: libtool
BuildRequires: pkgconfig(glib-2.0) >= 2.44
BuildRequires: pkgconfig(gio-2.0) >= 2.44
BuildRequires: pkgconfig(gio-unix-2.0)
-BuildRequires: gperf
+BuildRequires: cmake
Requires: /bin/cp
System utility libraries.
%package -n libgdbus
-Summary: Dbus library
+Summary: Dbus library
License: Apache-2.0
%description -n libgdbus
Internal dbus library
%package -n libgdbus-devel
-Summary: Header files for dbus library
+Summary: Header files for dbus library
License: Apache-2.0
Requires: libgdbus = %{version}
Requires: pkgconfig(gio-2.0)
%endif
%build
-%if 0%{?debug_enable}
-export CFLAGS=$(echo $CFLAGS | sed -e 's/^-g / /g' | sed -e 's/ -g / /g')
-export CFLAGS=$(echo $CFLAGS | sed -e 's/^-O[0-9] / /g' | sed -e 's/ $-O[0-9] / /g')
-export CFLAGS=$(echo $CFLAGS | sed -e 's/-Wp,-D_FORTIFY_SOURCE=2 / /g')
-export CFLAGS="-O0 -g $CFLAGS"
-%endif
-
-./autogen.sh
-%configure
-
+%cmake .
make %{?_smp_mflags}
%install
%make_install
-rm -f %{buildroot}%{_libdir}/*.la
-
# make sure debugsources.list exist, it used by rpm macro in %file
# section.
touch debugsources.list
-%check
-make check
-
%post
/sbin/ldconfig
--- /dev/null
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(libgdbus C)
+
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+SET(EXEC_PREFIX "${PREFIX}/bin")
+SET(LIBDIR ${LIB_INSTALL_DIR})
+SET(INCLUDEDIR "${PREFIX}/include")
+SET(VERSION 4.1)
+
+SET(libgdbus_SRCS
+ dbus-system.c
+)
+SET(HEADERS
+ dbus-system.h
+)
+
+# CHECK PKG
+INCLUDE(FindPkgConfig)
+pkg_check_modules(gdbus REQUIRED
+ glib-2.0
+ gio-2.0
+ gio-unix-2.0)
+
+FOREACH(flag ${gdbus_CFLAGS})
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
+
+# LIBRARY
+ADD_LIBRARY(${PROJECT_NAME} SHARED ${libgdbus_SRCS})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${gdbus_LDFLAGS} "-ldl" pthread)
+SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-fPIC")
+SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION})
+SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES OUTPUT_NAME gdbus)
+
+# INSTALL
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
+
+# CONGIFURE FILE
+FOREACH(flag ${gdbus_INCLUDE_DIRS})
+ SET(GDBUS_INCLUDEDIR "${GDBUS_INCLUDEDIR} -I${flag}")
+ENDFOREACH(flag)
+
+FOREACH(flag ${gdbus_LIBRARIES})
+ SET(GDBUS_LIBS "${GDBUS_LIBS} -l${flag}")
+ENDFOREACH(flag)
+
+CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
+
+# HEADER
+FOREACH(hfile ${HEADERS})
+ INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${hfile} DESTINATION include/${PROJECT_NAME})
+ENDFOREACH(hfile)
# All rights reserved.
#
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
+prefix=@PREFIX@
+exec_prefix=@EXEC_PREFIX@
+libdir=@LIBDIR@
+includedir=@INCLUDEDIR@
Name: libgdbus
Description: Dbus library
-Version: @PACKAGE_VERSION@
-Requires.private: @LIBGDBUS_PC_REQUIRES@
-Cflags: @LIBGDBUS_PC_CFLAGS@
-Libs: @LIBGDBUS_PC_LIBS@
+Version: @VERSION@
+Requires.private: libgdbus
+Cflags: -I${includedir} @GDBUS_INCLUDEDIR@
+Libs: -L${libdir} -lgdbus @GDBUS_LIBS@