From 0354f34e5a862a56e10183fca8f26f4bd82e74ee Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 11 Jan 2018 13:29:11 +0100 Subject: [PATCH] Remove libdemo and libhello --- CMakeLists.txt | 2 - icinga-app/CMakeLists.txt | 21 ----------- lib/CMakeLists.txt | 8 ---- lib/demo/CMakeLists.txt | 35 ----------------- lib/demo/demo.cpp | 68 ---------------------------------- lib/demo/demo.hpp | 52 -------------------------- lib/demo/demo.ti | 31 ---------------- lib/hello/CMakeLists.txt | 35 ----------------- lib/hello/helloapplication.cpp | 44 ---------------------- lib/hello/helloapplication.hpp | 44 ---------------------- lib/hello/helloapplication.ti | 31 ---------------- 11 files changed, 371 deletions(-) delete mode 100644 lib/demo/CMakeLists.txt delete mode 100644 lib/demo/demo.cpp delete mode 100644 lib/demo/demo.hpp delete mode 100644 lib/demo/demo.ti delete mode 100644 lib/hello/CMakeLists.txt delete mode 100644 lib/hello/helloapplication.cpp delete mode 100644 lib/hello/helloapplication.hpp delete mode 100644 lib/hello/helloapplication.ti diff --git a/CMakeLists.txt b/CMakeLists.txt index 9232ccb3a..ec0fedc18 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,8 +32,6 @@ option(ICINGA2_WITH_MYSQL "Build the MySQL IDO module" ON) option(ICINGA2_WITH_PGSQL "Build the PostgreSQL IDO module" ON) option(ICINGA2_WITH_CHECKER "Build the checker module" ON) option(ICINGA2_WITH_COMPAT "Build the compat module" ON) -option(ICINGA2_WITH_DEMO "Build the demo module" OFF) -option(ICINGA2_WITH_HELLO "Build the hello module" OFF) option(ICINGA2_WITH_LIVESTATUS "Build the Livestatus module" ON) option(ICINGA2_WITH_NOTIFICATION "Build the notification module" ON) option(ICINGA2_WITH_PERFDATA "Build the perfdata module" ON) diff --git a/icinga-app/CMakeLists.txt b/icinga-app/CMakeLists.txt index a6747fb4b..3be2db704 100644 --- a/icinga-app/CMakeLists.txt +++ b/icinga-app/CMakeLists.txt @@ -96,27 +96,6 @@ install( RUNTIME DESTINATION ${InstallPath} ) -if(ICINGA2_WITH_HELLO) - add_executable(hello-app $) - add_whole_static_library(hello-app base) - add_whole_static_library(hello-app config) - add_whole_static_library(hello-app remote) - add_whole_static_library(hello-app cli) - add_whole_static_library(hello-app hello) - - set_target_properties ( - hello-app PROPERTIES - INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2 - FOLDER Bin - OUTPUT_NAME hello - ) - - install( - TARGETS hello-app - RUNTIME DESTINATION ${InstallPath} - ) -endif() - install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/log/icinga2\")") install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/lib/icinga2\")") install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_RUNDIR}/icinga2\")") diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 4da708367..67ad4afee 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -22,10 +22,6 @@ add_subdirectory(remote) add_subdirectory(icinga) add_subdirectory(methods) -if(ICINGA2_WITH_HELLO) - add_subdirectory(hello) -endif() - if(ICINGA2_WITH_CHECKER) add_subdirectory(checker) endif() @@ -60,10 +56,6 @@ if(ICINGA2_WITH_PGSQL) endif() endif() -if(ICINGA2_WITH_DEMO) - add_subdirectory(demo) -endif() - if(ICINGA2_WITH_LIVESTATUS) add_subdirectory(livestatus) endif() diff --git a/lib/demo/CMakeLists.txt b/lib/demo/CMakeLists.txt deleted file mode 100644 index 9882cf2be..000000000 --- a/lib/demo/CMakeLists.txt +++ /dev/null @@ -1,35 +0,0 @@ -# Icinga 2 -# Copyright (C) 2012-2018 Icinga Development Team (https://www.icinga.com/) -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. - -mkclass_target(demo.ti demo.tcpp demo.thpp) - -set(demo_SOURCES - demo.cpp demo.hpp demo.thpp -) - -if(ICINGA2_UNITY_BUILD) - mkunity_target(demo demo demo_SOURCES) -endif() - -add_library(demo STATIC ${demo_SOURCES}) - -target_link_libraries(demo ${Boost_LIBRARIES} base config icinga remote) - -set_target_properties ( - demo PROPERTIES - FOLDER Components -) diff --git a/lib/demo/demo.cpp b/lib/demo/demo.cpp deleted file mode 100644 index bb55046fa..000000000 --- a/lib/demo/demo.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/****************************************************************************** - * Icinga 2 * - * Copyright (C) 2012-2018 Icinga Development Team (https://www.icinga.com/) * - * * - * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software Foundation * - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * - ******************************************************************************/ - -#include "demo/demo.hpp" -#include "demo/demo.tcpp" -#include "remote/apilistener.hpp" -#include "remote/apifunction.hpp" -#include "base/configtype.hpp" -#include "base/logger.hpp" - -using namespace icinga; - -REGISTER_TYPE(Demo); - -REGISTER_APIFUNCTION(HelloWorld, demo, &Demo::DemoMessageHandler); - -/** - * Starts the component. - */ -void Demo::Start(bool runtimeCreated) -{ - ObjectImpl::Start(runtimeCreated); - - m_DemoTimer = new Timer(); - m_DemoTimer->SetInterval(5); - m_DemoTimer->OnTimerExpired.connect(std::bind(&Demo::DemoTimerHandler, this)); - m_DemoTimer->Start(); -} - -/** - * Periodically broadcasts an API message. - */ -void Demo::DemoTimerHandler() -{ - Dictionary::Ptr message = new Dictionary(); - message->Set("method", "demo::HelloWorld"); - - ApiListener::Ptr listener = ApiListener::GetInstance(); - if (listener) { - MessageOrigin::Ptr origin = new MessageOrigin(); - listener->RelayMessage(origin, nullptr, message, true); - Log(LogInformation, "Demo", "Sent demo::HelloWorld message"); - } -} - -Value Demo::DemoMessageHandler(const MessageOrigin::Ptr& origin, const Dictionary::Ptr&) -{ - Log(LogInformation, "Demo") - << "Got demo message from '" << origin->FromClient->GetEndpoint()->GetName() << "'"; - - return Empty; -} diff --git a/lib/demo/demo.hpp b/lib/demo/demo.hpp deleted file mode 100644 index a51c35959..000000000 --- a/lib/demo/demo.hpp +++ /dev/null @@ -1,52 +0,0 @@ -/****************************************************************************** - * Icinga 2 * - * Copyright (C) 2012-2018 Icinga Development Team (https://www.icinga.com/) * - * * - * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software Foundation * - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * - ******************************************************************************/ - -#ifndef DEMO_H -#define DEMO_H - -#include "demo/demo.thpp" -#include "remote/messageorigin.hpp" -#include "base/timer.hpp" - -namespace icinga -{ - -/** - * @ingroup demo - */ -class Demo final : public ObjectImpl -{ -public: - DECLARE_OBJECT(Demo); - DECLARE_OBJECTNAME(Demo); - - void Start(bool runtimeCreated) override; - - static Value DemoMessageHandler(const MessageOrigin::Ptr& origin, const Dictionary::Ptr& params); - - -private: - Timer::Ptr m_DemoTimer; - - void DemoTimerHandler(); -}; - -} - -#endif /* DEMO_H */ diff --git a/lib/demo/demo.ti b/lib/demo/demo.ti deleted file mode 100644 index 912aae2f6..000000000 --- a/lib/demo/demo.ti +++ /dev/null @@ -1,31 +0,0 @@ -/****************************************************************************** - * Icinga 2 * - * Copyright (C) 2012-2018 Icinga Development Team (https://www.icinga.com/) * - * * - * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software Foundation * - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * - ******************************************************************************/ - -#include "base/configobject.hpp" - -library demo; - -namespace icinga -{ - -class Demo : ConfigObject -{ -}; - -} diff --git a/lib/hello/CMakeLists.txt b/lib/hello/CMakeLists.txt deleted file mode 100644 index 707f1ee68..000000000 --- a/lib/hello/CMakeLists.txt +++ /dev/null @@ -1,35 +0,0 @@ -# Icinga 2 -# Copyright (C) 2012-2018 Icinga Development Team (https://www.icinga.com/) -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. - -mkclass_target(helloapplication.ti helloapplication.tcpp helloapplication.thpp) - -set(hello_SOURCES - helloapplication.cpp helloapplication.hpp helloapplication.thpp -) - -if(ICINGA2_UNITY_BUILD) - mkunity_target(hello hello hello_SOURCES) -endif() - -add_library(hello STATIC ${hello_SOURCES}) - -target_link_libraries(hello ${Boost_LIBRARIES} base config) - -set_target_properties ( - hello PROPERTIES - FOLDER Lib -) diff --git a/lib/hello/helloapplication.cpp b/lib/hello/helloapplication.cpp deleted file mode 100644 index 03a119422..000000000 --- a/lib/hello/helloapplication.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/****************************************************************************** - * Icinga 2 * - * Copyright (C) 2012-2018 Icinga Development Team (https://www.icinga.com/) * - * * - * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software Foundation * - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * - ******************************************************************************/ - -#include "hello/helloapplication.hpp" -#include "hello/helloapplication.tcpp" -#include "base/initialize.hpp" -#include "base/logger.hpp" -#include "base/scriptglobal.hpp" - -using namespace icinga; - -REGISTER_TYPE(HelloApplication); - -INITIALIZE_ONCE([]() { - ScriptGlobal::Set("ApplicationType", "HelloApplication"); -}); - -/** - * The entry point for the hello application. - * - * @returns An exit status. - */ -int HelloApplication::Main() -{ - Log(LogInformation, "HelloApplication", "Hello World!"); - - return 0; -} diff --git a/lib/hello/helloapplication.hpp b/lib/hello/helloapplication.hpp deleted file mode 100644 index 9d9bfa806..000000000 --- a/lib/hello/helloapplication.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/****************************************************************************** - * Icinga 2 * - * Copyright (C) 2012-2018 Icinga Development Team (https://www.icinga.com/) * - * * - * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software Foundation * - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * - ******************************************************************************/ - -#ifndef HELLOAPPLICATION_H -#define HELLOAPPLICATION_H - -#include "hello/helloapplication.thpp" - -namespace icinga -{ - -/** - * The hello application. - * - * @ingroup hello - */ -class HelloApplication final : public ObjectImpl -{ -public: - DECLARE_OBJECT(HelloApplication); - DECLARE_OBJECTNAME(HelloApplication); - - int Main() override; -}; - -} - -#endif /* HELLOAPPLICATION_H */ diff --git a/lib/hello/helloapplication.ti b/lib/hello/helloapplication.ti deleted file mode 100644 index ec4616f5c..000000000 --- a/lib/hello/helloapplication.ti +++ /dev/null @@ -1,31 +0,0 @@ -/****************************************************************************** - * Icinga 2 * - * Copyright (C) 2012-2018 Icinga Development Team (https://www.icinga.com/) * - * * - * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software Foundation * - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * - ******************************************************************************/ - -#include "base/application.hpp" - -library hello; - -namespace icinga -{ - -class HelloApplication : Application -{ -}; - -}