%define libsystemd on
-%define test off
Name: argos_watchdog
Summary: ARGOS library to detect application malfunctions
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DFULLVER=%{version} \
-DMAJORVER=${MAJORVER} \
- -DLIBSYSTEMD=%{libsystemd} \
- -DTEST=%{test}
+ -DLIBSYSTEMD=%{libsystemd}
make
%{_libdir}/pkgconfig/%{name}.pc
%{_libdir}/lib%{name}.so
%manifest %{name}.manifest
-%if %{?test} == on
-%{_bindir}/argos-test
-/usr/lib/systemd/system/argos-test.service
-%endif
+++ /dev/null
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-PROJECT(argos-test C)
-
-SET(SRCS
- argos-test.c
-)
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
-
-INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED argos_watchdog)
-
-FOREACH(flag ${pkgs_CFLAGS})
- SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
-ENDFOREACH(flag)
-
-SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -g -fno-omit-frame-pointer")
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIE")
-SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed -pie")
-
-ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
-
-ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
-TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} argos_watchdog)
-
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
-INSTALL(FILES
- ${CMAKE_CURRENT_SOURCE_DIR}/argos-test.service
- DESTINATION lib/systemd/system)
+++ /dev/null
-/*
- * argos-test
- *
- * Copyright (c) 2015 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.
- * 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.
- *
- */
-
-#include <stdio.h>
-#include <unistd.h>
-#include <argos.h>
-
-#define NOTIFY_PEROID 10
-
-int main (void) {
- int r;
-
- while (1) {
- r = aw_notify();
- printf("aw_notify returns %d\n", r);
- sleep(10);
- }
-
- return 0;
-}
+++ /dev/null
-[Unit]
-Description=aw_notify test
-
-[Service]
-ExecStart=/usr/bin/argos-test
-WatchdogSec=30
-Restart=always