Skip to content

Commits on Source 12

.vagrant
.idea
*.patch
## Editors
.idea/
*.komodoproject
.*.sw[op]
*~
## C++ and Tools
*.patch
*.playground
.*.swp
.*.swo
.vagrant
tickets.pickle
## Build artifacts
build/
build-debug/
build-release/
......@@ -12,3 +18,7 @@ build32/
build64/
debug/
release/
cmake-build-debug
/Testing/
/install/
/vendor/
......@@ -12,6 +12,10 @@ Jean Flach <jean-marcel.flach@icinga.com> Jean Flach <jean-marcel.flach@icinga.c
Dolf Schimmel <dolf@transip.nl> <dolf@dolfschimmel.nl>
Markus Waldmüller <markus.waldmueller@netways.de>
Claudio Kuenzler <ck@claudiokuenzler.com>
Carsten Köbke <carsten.koebke@gmx.de> Carsten Koebke <carsten.koebke@koebbes.de>
Thomas Gelf <thomas.gelf@icinga.com> <thomas@gelf.net>
Michael Insel <mcktr55@gmail.com> <michael@email.de>
Michael Insel <mcktr55@gmail.com> <michael@insel.email>
<markus.frosch@icinga.com> <markus@lazyfrosch.de>
<markus.frosch@icinga.com> <lazyfrosch@icinga.org>
<bernd.erk@icinga.com> <bernd.erk@icinga.org>
......
......@@ -5,6 +5,15 @@ language: cpp
cache: ccache
env:
global:
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
# via the "travis encrypt" command using the project repo's public key
- secure: "eOnFdiRhB7VUZY7Of4Ff0px93HRWGcD4fXCPiy8V2OC2ER98CYCVw7PKt2Is6i/yTveFTps1kObOo0T03aUT8y/xeBy/wMuJYk1d6mVgmSXOjxcxjQVTUh4J+xB+k/R6FoP2dirNDbvSayCj9Fi9toN9hQHMM8oAZOZfiKmYTJc="
before_install:
- echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-
addons:
apt_packages:
- libboost-all-dev
......@@ -17,15 +26,26 @@ addons:
- libyajl-dev
- libwxbase3.0-dev
- libwxgtk3.0-dev
coverity_scan:
project:
name: "Icinga/icinga2"
notification_email: icinga2@icinga.com
build_command_prepend: "cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/tmp/icinga2 -DICINGA2_PLUGINDIR=/tmp/icinga2/sbin -DICINGA2_UNITY_BUILD=ON"
build_command: "make -j 2"
branch_pattern: coverity_scan
before_script:
- mkdir build
- cd build
- cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/tmp/icinga2 -DICINGA2_PLUGINDIR=/tmp/icinga2/sbin
- if [ "$COVERITY_SCAN_BRANCH" != 1 ]; then
mkdir build;
cd build;
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/tmp/icinga2 -DICINGA2_PLUGINDIR=/tmp/icinga2/sbin;
fi
script:
- make
- make test
- make install
- /tmp/icinga2/sbin/icinga2 --version
- /tmp/icinga2/sbin/icinga2 daemon -C -DRunAsUser=$(id -u -n) -DRunAsGroup=$(id -g -n)
- if [ "$COVERITY_SCAN_BRANCH" != 1 ]; then
make;
make test;
make install;
/tmp/icinga2/sbin/icinga2 --version;
/tmp/icinga2/sbin/icinga2 daemon -C -DRunAsUser=$(id -u -n) -DRunAsGroup=$(id -g -n);
fi
......@@ -4,14 +4,13 @@ Alexander A. Klimov <alexander.klimov@icinga.com>
Alexander Fuhr <alexander.fuhr@netways.de>
Alexander Schomburg <script.acc@alex.schomb.org>
Alexander Wirt <formorer@debian.org>
Andrea Kao <eirinikos@gmail.com>
Andreas Scherbaum <andreas@scherbaum.biz>
Andres Ivanov <andres@andres.wtf>
Andrew Meyer <ameyer+secure@nodnetwork.org>
Andy Grunwald <andygrunwald@gmail.com>
Arnd Hannemann <arnd@arndnet.de>
Assaf Flatto <assaf@aikilinux.com>
Bård Dahlmo-Lerbæk <bard.dahlmo-lerbaek@skatteetaten.no>
bascarsija <bascarsija.dev@gmail.com>
Bastian Guse <bguse@nocopy.de>
Benedikt Heine <bebe@bebehei.de>
Bernd Erk <bernd.erk@icinga.com>
......@@ -21,6 +20,7 @@ Brendan Jurd <direvus@gmail.com>
Brian De Wolf <git@bldewolf.com>
Brian Dockter <specus@gmail.com>
Bruno Lingner <mail@hugo.ro>
Bård Dahlmo-Lerbæk <bard.dahlmo-lerbaek@skatteetaten.no>
Carlos Cesario <carloscesario@gmail.com>
Carsten Köbke <carsten.koebke@gmx.de>
Christian Birk <mail@birkc.de>
......@@ -33,8 +33,6 @@ Christian Schmidt <github@chsc.dk>
Claudio Bilotta <bilottalove@gmail.com>
Claudio Kuenzler <ck@claudiokuenzler.com>
Conrad Clement <cclement@printeron.com>
cstegm <cstegm@users.noreply.github.com>
ctrlaltca <ctrlaltca@gmail.com>
Daniel Helgenberger <daniel.helgenberger@m-box.de>
Daniel Kesselberg <mail@danielkesselberg.de>
Daniil Yaroslavtsev <dyaroslavtsev@confyrm.com>
......@@ -47,11 +45,12 @@ Dolf Schimmel <dolf@transip.nl>
Edgar Fuß <ef@math.uni-bonn.de>
Eduard Güldner <eduard.gueldner@gmail.com>
Edvin Seferovic <edvin@seferovic.net>
Élie Bouttier <elie@bouttier.eu>
Eric Lippmann <eric.lippmann@icinga.com>
Evgeni Golov <evgeni@golov.de>
Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl>
Fabian Röhl <FRoehl@freicon.de>
Federico Cuello <federico.cuello@sociomantic.com>
Federico Pires <federico.pires@upsight.com>
Ferdi Gueran <ferdi.gueran@nextevolution.de>
Francesco Colista <fcolista@alpinelinux.org>
Gaël Beaudoin <gaboo@gaboo.org>
......@@ -59,11 +58,11 @@ Georg Faerber <georg@riseup.net>
Georg Haas <hax404foogit@hax404.de>
Gerd von Egidy <gerd@egidy.de>
Gerhardt Roman <roman.gerhardt@cbc-x.com>
gitmopp <mopp@gmx.net>
Glauco Vinicius <gl4uc0@gmail.com>
Gunnar Beutner <gunnar.beutner@icinga.com>
Hannes Happle <info@h2-it.de>
Hannes Van de Vel <h@nnes.be>
Harald Laabs <github@dasr.de>
Heike Jurzik <icinga@huhnix.org>
Hendrik Röder <hendrik.biz@gmail.com>
Ian Kelling <ian@iankelling.org>
......@@ -78,29 +77,29 @@ Jean Flach <jean-marcel.flach@icinga.com>
Jean-Louis Dupond <jean-louis@dupond.be>
Jens Schanz <mail@jensschanz.de>
Jeremy Armstrong <lepubel@gmail.com>
Jérôme Drouet <jerome.drouet@gmail.com>
Jesse Morgan <morgajel@gmail.com>
Jo Goossens <jo.goossens@hosted-power.com>
Johannes Meyer <johannes.meyer@icinga.com>
Jonas Meurer <jonas@freesources.org>
Joseph L. Casale <jcasale@activenetwerx.com>
Julian Brost <julian@0x4a42.net>
Jérôme Drouet <jerome.drouet@gmail.com>
Kai Goller <kai.goller@netways.de>
Kálmán Szalai - KAMI <kami911@gmail.com>
Konstantin Kelemen <konstantin@kel.mn>
krishna <gskrishna44@gmail.com>
Kálmán Szalai - KAMI <kami911@gmail.com>
Lars Engels <lars.engels@0x20.net>
Lars Krüger <krueger-lars@web.de>
Leah Oswald <mail@leahoswald.de>
Lee Clemens <java@leeclemens.net>
Lennart Betz <lennart.betz@icinga.com>
lihan <tclh123@gmail.com>
Louis Sautier <sautier.louis@gmail.com>
Luca Lesinigo <luca@lm-net.it>
Lucas Fairchild-Madar <lucas.madar@gmail.com>
Magnus Bäck <magnus@noun.se>
Malte Rabenseifner <mail@malte-rabenseifner.de>
Manuel Reiter <reiter@csc.uni-frankfurt.de>
MarcusCaepio <MarcusCaepio@users.noreply.github.com>
Marcus van Dam <marcus@marcusvandam.nl>
MarcusCaepio <MarcusCaepio@users.noreply.github.com>
Marianne Spiller <github@spiller.me>
Marius Bergmann <marius@yeai.de>
Marius Sturm <marius@graylog.com>
......@@ -118,19 +117,17 @@ Mhd Sulhan <ms@kilabit.info>
Micha Ahrweiler <me@schnitzi.net>
Michael Friedrich <michael.friedrich@icinga.com>
Michael Insel <mcktr55@gmail.com>
Michael Insel <michael@insel.email>
Michael Kraus <michael.kraus@consol.de>
Michael Newton <miken32@gmail.com>
Michal Moravec <michal.moravec@macadmin.cz>
Mikesch-mp <mikesch-mp@koebbes.de>
Mirco Bauer <meebey@meebey.net>
Mirko Nardin <mirko.nardin@gmx.net>
mocruz <mocruz@theworkshop.com>
Nicolai <nbuchwitz@users.noreply.github.com>
Nicolas Limage <github@xephon.org>
Nicole Lang <nicole.lang@icinga.com>
Niflou <dubuscyr@gmail.com>
Noah Hilverling <noah.hilverling@icinga.com>
noobahoi <20069422+noobahoi@users.noreply.github.com>
Pall Sigurdsson <palli-github@minor.is>
Paolo Schiro <paolo.schiro@kpnqwest.it>
Patrick Huy <frz@frz.cc>
......@@ -141,7 +138,6 @@ Peter Eckel <pe-icinga2@hindenburgring.com>
Petr Ruzicka <petr.ruzicka@gmail.com>
Phil Hutchinson <phil@volumedia.co.uk>
Philipp Dallig <philipp.dallig@gmail.com>
pv2b <pvz@pvz.pp.se>
Ralph Breier <ralph.breier@roedl.com>
Reto Zeder <reto.zeder@arcade.ch>
Ricardo Bartels <ricardo@bitchbrothers.com>
......@@ -150,7 +146,6 @@ Roland Hopferwieser <rhopfer@ica.jku.at>
Roman Gerhardt <roman.gerhardt@cbc-x.com>
Rudy Gevaert <rudy.gevaert@ugent.be>
Rune Darrud <theflyingcorpse@gmail.com>
ryanohnemus <ryan.ohnemus@tradingtechnologies.com>
Sam Kottler <shk@linux.com>
Sebastian Brückner <mail@invlid.com>
Sebastian Chrostek <sebastian@chrostek.net>
......@@ -166,12 +161,13 @@ Steve McMaster <mcmaster@hurricanelabs.com>
Strajan Sebastian Ioan <strajan.sebastian@yahoo.com>
Strix <660956+MrStrix@users.noreply.github.com>
Sven Nierlein <sven@nierlein.de>
Thomas Gelf <thomas@gelf.net>
T. Mulyana <nothinux@gmail.com>
Thomas Gelf <thomas.gelf@icinga.com>
Thomas Niedermeier <tniedermeier@thomas-krenn.com>
Thomas Widhalm <thomas.widhalm@icinga.com>
Tim Hardeck <thardeck@suse.de>
Timo Buhrmester <van.fstd@gmail.com>
Tim Weippert <weiti@weiti.eu>
Timo Buhrmester <van.fstd@gmail.com>
Tobias Birnbaum <osterd@gmx.de>
Tobias von der Krone <tobias.vonderkrone@profitbricks.com>
Tom Geissler <Tom@d7031.de>
......@@ -185,3 +181,18 @@ Yannick Charton <tontonitch-pro@yahoo.fr>
Yohan Jarosz <yohanjarosz@yahoo.fr>
Zachary McGibbon <zachary.mcgibbon@gmail.com>
Zoltan Nagy <abesto@abesto.net>
akrus <akrus@flygroup.st>
bascarsija <bascarsija.dev@gmail.com>
cstegm <cstegm@users.noreply.github.com>
ctrlaltca <ctrlaltca@gmail.com>
fbachmann <bachmann.f@gmail.com>
gitmopp <mopp@gmx.net>
jre3brg <jorge.rebelo@pt.bosch.com>
krishna <gskrishna44@gmail.com>
lihan <tclh123@gmail.com>
mocruz <mocruz@theworkshop.com>
noobahoi <20069422+noobahoi@users.noreply.github.com>
pv2b <pvz@pvz.pp.se>
ryanohnemus <ryan.ohnemus@tradingtechnologies.com>
sah <sah@mss.secunet.com>
Élie Bouttier <elie@bouttier.eu>
# Build Icinga 2 on Windows
The Icinga Project is providing Windows MSI packages under https://packages.icinga.com/windows/
> **Note:**
> This is a developer documentation on how to build Icinga 2 on Windows!
Also see [INSTALL.md](INSTALL.md) for Linux build instructions.
## Requirements
* 32 or 64-bit system
* Visual Studio >= 14 2015
* CMake >= 2.6
* OpenSSL >= 1.0.1
* Flex and Bison
## Install Requirements
**Visual Studio**
Download from [visualstudio.com](https://www.visualstudio.com/en/downloads/)
The Community Edition is available for free, and is what we use to build.
Workloads to install:
* C++ Desktop
* .NET Desktop
**OpenSSL for Icinga**
See our [openssl-windows GitHub project](https://github.com/Icinga/openssl-windows).
You will need to install a binary dist version to 'C:\\Program Files\\OpenSSL'.
There is a Powershell script to help you downloading: `.\tools\win32\download-openssl.ps1`
**Chocolatey**
A simple package manager for Windows, please see [install instructions](https://chocolatey.org/install).
**Git**
Best to use Chocolatey, see [package details](https://chocolatey.org/packages/git).
```
choco install git
```
**Flex / Bison**
Best to use Chocolatey, see [package details](https://chocolatey.org/packages/winflexbison3).
```
choco install winflexbison3
```
**CMake**
Best to use Chocolatey, see [package details](https://chocolatey.org/packages/cmake)
or download from: [cmake.org](https://cmake.org/download/)
```
choco install cmake
```
**WIX**
Best to use Chocolatey, see [package details](https://chocolatey.org/packages/wixtoolset).
```
choco install wixtoolset
```
**Boost**
Download third party Windows binaries from: [boost.org](http://www.boost.org/users/download/)
For example: `https://dl.bintray.com/boostorg/release/1.65.1/binaries/boost_1_65_1-msvc-14.1-64.exe`
*Warnings:*
* Must match your Visual Studio version!
* CMake might not support the latest Boost version (we used CMake 3.10 and Boost 1_65_1)
Run the installer exe.
## Build Icinga 2
Run with VC Native x64 Command Prompt:
```
powershell .\tools\win32\configure.ps1
powershell .\tools\win32\build.ps1
powershell .\tools\win32\test.ps1
```
See these scripts for details.
## AppVeyor
We are building [Icinga 2 with AppVeyor](https://ci.appveyor.com/project/icinga/icinga2) for testing and CI integration.
Please check `appveyor.yml` for our instructions.
This diff is collapsed.
# Icinga 2
# Copyright (C) 2012-2017 Icinga Development Team (https://www.icinga.com/)
# 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
......@@ -15,8 +15,8 @@
# along with this program; if not, write to the Free Software Foundation
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
cmake_minimum_required(VERSION 2.6)
set(BOOST_MIN_VERSION "1.41.0")
cmake_minimum_required(VERSION 2.8.8)
set(BOOST_MIN_VERSION "1.48.0")
project(icinga2)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
......@@ -32,14 +32,16 @@ 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)
option(ICINGA2_WITH_STUDIO "Build the Icinga Studio application" OFF)
option(ICINGA2_WITH_TESTS "Run unit tests" ON)
option (USE_SYSTEMD
"Configure icinga as native systemd service instead of a SysV initscript" OFF)
set(HAVE_SYSTEMD ${USE_SYSTEMD})
file(STRINGS VERSION VERSION_LINE REGEX "^Version: ")
string(REPLACE "Version: " "" ICINGA2_VERSION ${VERSION_LINE})
......@@ -71,7 +73,6 @@ endif()
set(ICINGA2_BUILD_COMPILER_VERSION "${CMAKE_CXX_COMPILER_VERSION}")
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/COPYING" ICINGA2_LICENSE_GPL)
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/COPYING.Exceptions" ICINGA2_LICENSE_ADDITIONS)
set(ICINGA2_LICENSE "${ICINGA2_LICENSE_GPL}\n\n---\n\n${ICINGA2_LICENSE_ADDITIONS}")
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt" ${ICINGA2_LICENSE})
......@@ -101,7 +102,8 @@ endif()
if(WIN32)
set(Boost_USE_STATIC_LIBS ON)
add_definitions(-DBOOST_ALL_NO_LIB)
add_definitions(/bigobj)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /bigobj")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
endif()
if(NOT DEFINED LOGROTATE_HAS_SU)
......@@ -129,12 +131,17 @@ include_directories(${Boost_INCLUDE_DIRS})
find_package(OpenSSL REQUIRED)
include_directories(${OPENSSL_INCLUDE_DIR})
set(base_DEPS ${CMAKE_DL_LIBS} ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES})
set(base_OBJS $<TARGET_OBJECTS:mmatch> $<TARGET_OBJECTS:socketpair> $<TARGET_OBJECTS:base>)
find_package(YAJL)
if(NOT YAJL_FOUND)
include_directories(${icinga2_BINARY_DIR}/third-party/yajl/include)
link_directories(${icinga2_BINARY_DIR}/third-party/yajl)
set(YAJL_LIBRARIES "yajl")
list(APPEND base_OBJS $<TARGET_OBJECTS:yajl>)
else()
list(APPEND base_DEPS ${YAJL_LIBRARIES})
endif()
find_package(Editline)
......@@ -148,11 +155,38 @@ include_directories(
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/lib
)
if(HAVE_LIBEXECINFO)
list(APPEND base_DEPS execinfo)
endif()
if(UNIX OR CYGWIN)
list(APPEND base_OBJS $<TARGET_OBJECTS:execvpe>)
endif()
if(HAVE_SYSTEMD)
list(APPEND base_DEPS systemd)
endif()
if(EDITLINE_FOUND)
list(APPEND base_DEPS ${EDITLINE_LIBRARIES})
include_directories(${EDITLINE_INCLUDE_DIR})
endif()
if(TERMCAP_FOUND)
list(APPEND base_DEPS ${TERMCAP_LIBRARIES})
include_directories(${TERMCAP_INCLUDE_DIR})
endif()
if(WIN32)
list(APPEND base_DEPS ws2_32 dbghelp shlwapi msi)
endif()
set(CMAKE_MACOSX_RPATH 1)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Qunused-arguments -g")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qunused-arguments -g")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Qunused-arguments -fcolor-diagnostics")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qunused-arguments -fcolor-diagnostics")
# Clang on Fedora requires -pthread, Apple Clang does not
# AppleClang is available since CMake 3.0.0
......@@ -176,18 +210,63 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -pthread")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lpthread")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -lpthread")
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} -lpthread")
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -pthread")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -pthread")
endif()
endif()
include(CheckCXXCompilerFlag)
function(check_cxx_linker_flag flag var)
set(CMAKE_REQUIRED_FLAGS ${flag})
set(result 0)
check_cxx_compiler_flag(${flag} result)
set(${var} ${result} PARENT_SCOPE)
endfunction()
check_cxx_linker_flag("-Wl,--gc-sections" LD_GC_SECTIONS)
if(NOT CMAKE_SYSTEM_NAME MATCHES AIX AND NOT CMAKE_SYSTEM_NAME MATCHES OpenBSD AND NOT CMAKE_SYSTEM_NAME MATCHES SunOS)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections -Wl,--no-export-dynamic -Bsymbolic-functions -Wl,--dynamic-list-cpp-typeinfo -Wl,--dynamic-list-data")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--gc-sections -Wl,--no-export-dynamic -Bsymbolic-functions -Wl,--dynamic-list-cpp-typeinfo -Wl,--dynamic-list-data")
if(LD_GC_SECTIONS)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--gc-sections")
endif()
check_cxx_linker_flag("-Wl,--no-export-dynamic" LD_NO_EXPORT_DYNAMIC)
if(LD_NO_EXPORT_DYNAMIC)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-export-dynamic")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-export-dynamic")
endif()
include(CheckCXXCompilerFlag)
check_cxx_linker_flag("-Bsymbolic-functions" LD_SYMBOLIC_FUNCTIONS)
if(LD_SYMBOLIC_FUNCTIONS)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Bsymbolic-functions")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Bsymbolic-functions")
endif()
check_cxx_linker_flag("-Wl,--dynamic-list-cpp-typeinfo" LD_DYNAMIC_LIST_CPP_TYPEINFO)
if(LD_DYNAMIC_LIST_CPP_TYPEINFO)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--dynamic-list-cpp-typeinfo")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--dynamic-list-cpp-typeinfo")
endif()
check_cxx_linker_flag("-Wl,--dynamic-list-data" LD_DYNAMIC_LIST_DATA)
if(LD_DYNAMIC_LIST_DATA)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--dynamic-list-data")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--dynamic-list-data")
endif()
check_cxx_compiler_flag("-Winvalid-pch" CXX_INVALID_PCH)
if(CXX_INVALID_PCH)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Winvalid-pch")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Winvalid-pch")
endif()
if(ICINGA2_LTO_BUILD)
check_cxx_compiler_flag("-flto" CXX_FLAG_LTO)
......@@ -198,24 +277,13 @@ if(ICINGA2_LTO_BUILD)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -flto")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -flto")
endif()
endif()
include(CheckCCompilerFlag)
check_c_compiler_flag(-fvisibility-inlines-hidden HAVE_VISIBILITY_INLINES_HIDDEN)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto")
if(HAVE_VISIBILITY_INLINES_HIDDEN)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility-inlines-hidden")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9.0) AND NOT OPENBSD)
set(CMAKE_AR "gcc-ar")
set(CMAKE_RANLIB "gcc-ranlib")
endif()
endif()
check_c_compiler_flag(-fvisibility=hidden HAVE_VISIBILITY_HIDDEN)
if(HAVE_VISIBILITY_HIDDEN)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
endif()
if(MSVC)
......@@ -275,7 +343,7 @@ endif()
configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h ESCAPE_QUOTES)
install(
FILES README.md COPYING COPYING.Exceptions AUTHORS CHANGELOG.md NEWS
FILES README.md COPYING AUTHORS CHANGELOG.md NEWS
DESTINATION ${CMAKE_INSTALL_DOCDIR}
)
......@@ -299,10 +367,6 @@ if(MSVC)
add_subdirectory(icinga-installer)
endif()
if(ICINGA2_WITH_STUDIO)
add_subdirectory(icinga-studio)
endif()
if(ICINGA2_WITH_TESTS)
add_subdirectory(test)
endif()
......@@ -314,7 +378,7 @@ set(CPACK_PACKAGE_INSTALL_DIRECTORY "ICINGA2")
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/icinga-app\\\\icinga.ico")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt")
set(CPACK_PACKAGE_EXECUTABLES "Icinga2SetupAgent;Icinga 2 Agent Wizard;icinga-studio;Icinga Studio")
set(CPACK_PACKAGE_EXECUTABLES "Icinga2SetupAgent;Icinga 2 Agent Wizard")
set(CPACK_WIX_PRODUCT_ICON "${CMAKE_CURRENT_SOURCE_DIR}/icinga-app\\\\icinga.ico")
set(CPACK_WIX_UPGRADE_GUID "52F2BEAA-4DF0-4C3E-ABDC-C0F61DE4DF8A")
set(CPACK_WIX_EXTENSIONS "WixUtilExtension")
......
In addition, as a special exception, the copyright holders give
permission to link the code of portions of this program with the
OpenSSL library under certain conditions as described in each
individual source file, and distribute linked combinations including
the two.
You must obey the GNU General Public License in all respects for all
of the code used other than OpenSSL. If you modify file(s) with this
exception, you may extend this exception to your version of the
file(s), but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. If you delete
this exception statement from all source files in the program, then
also delete it here.
......@@ -7,7 +7,7 @@ of operating systems.
Please check the documentation in the [doc/](doc/) directory for a current list
of available packages and detailed installation instructions.
The online documentation is available at [docs.icinga.com](https://docs.icinga.com)
The online documentation is available on [icinga.com/docs](https://www.icinga.com/docs/)
and will guide you step by step.
There are a number of known caveats when installing from source such as
......@@ -15,107 +15,145 @@ incorrect directory and file permissions. So even if you're planning to
not use the official packages it is advisable to build your own Debian
or RPM packages.
# Builds
**Disclaimer**
This information is intended for developers and packagers.
This information is intended for developers and packagers. It might be incomplete or unclear
in some cases. Make also sure to check our [packaging scripts on GitHub](https://github.com/Icinga/icinga-packaging)!
## Build Requirements
# Build Requirements
The following requirements need to be fulfilled in order to build the
application using a dist tarball (package names for RHEL and Debian in
parentheses):
application using a dist tarball (including notes for distributions):
* cmake >= 2.6
* GNU make (make)
* C++ compiler which supports C++11 (gcc-c++ >= 4.7 on RHEL/SUSE, build-essential on Debian, alternatively clang++, build-base on Alpine)
* RedHat Developer Tools on RHEL5/6 (details on building below)
* GNU make (make) or ninja-build
* C++ compiler which supports C++11
- RHEL/Fedora/SUSE: gcc-c++ >= 4.7 (extra Developer Tools on RHEL5/6 see below)
- Debian/Ubuntu: build-essential
- Alpine: build-base
- you can also use clang++
* pkg-config
* OpenSSL library and header files >= 0.9.8 (openssl-devel on RHEL, libopenssl1-devel on SLES11,
libopenssl-devel on SLES12, libssl-dev on Debian, libressl-dev on Alpine)
* Boost library and header files >= 1.48.0 (boost148-devel on EPEL for RHEL / CentOS, libboost-all-dev on Debian, boost-dev on Alpine)
* OpenSSL library and header files >= 1.0.1
- RHEL/Fedora: openssl-devel
- SUSE: libopenssl-devel (for SLES 11: libopenssl1-devel)
- Debian/Ubuntu: libssl-dev
- Alpine: libressl-dev
* Boost library and header files >= 1.48.0
- RHEL/Fedora: boost148-devel
- Debian/Ubuntu: libboost-all-dev
- Alpine: boost-dev
* GNU bison (bison)
* GNU flex (flex) >= 2.5.35
* recommended: libexecinfo on FreeBSD (automatically used when Icinga 2 is
installed via port or package)
* optional: MySQL (mysql-devel on RHEL, libmysqlclient-devel on SUSE, libmysqlclient-dev until Debian 8 jessie / default-libmysqlclient-dev from Debian 9 stretch, mariadb-dev on Alpine);
set CMake variable `ICINGA2_WITH_MYSQL` to `OFF` to disable this module
* optional: PostgreSQL (postgresql-devel on RHEL, libpq-dev on Debian, postgresql-dev on Alpine); set CMake
variable `ICINGA2_WITH_PGSQL` to `OFF` to disable this module
* optional: YAJL (yajl-devel on RHEL, libyajl-dev on Debian, yajl-dev on Alpine)
* optional: libedit (libedit-devel on CentOS (RHEL requires rhel-7-server-optional-rpms
repository for el7 e.g.), libedit-dev on Debian and Alpine)
* optional: Termcap (libtermcap-devel on RHEL, not necessary on Debian) - only
required if libedit doesn't already link against termcap/ncurses
* optional: libwxgtk2.8-dev or newer (wxGTK-devel and wxBase) - only required when building the Icinga 2 Studio
Note: RHEL5 ships an ancient flex version. Updated packages are available for
* Systemd headers
- Only required when using Systemd
- Debian/Ubuntu: libsystemd-dev
- RHEL/Fedora: systemd-devel
## Optional features
* MySQL (disable with CMake variable `ICINGA2_WITH_MYSQL` to `OFF`)
- RHEL/Fedora: mysql-devel
- SUSE: libmysqlclient-devel
- Debian/Ubuntu: default-libmysqlclient-dev | libmysqlclient-dev
- Alpine: mariadb-dev
* PostgreSQL (disable with CMake variable `ICINGA2_WITH_PGSQL` to `OFF`)
- RHEL/Fedora: postgresql-devel
- Debian/Ubuntu: libpq-dev
- postgresql-dev on Alpine
* YAJL (Faster JSON library)
- RHEL/Fedora: yajl-devel
- Debian: libyajl-dev
- Alpine: yajl-dev
* libedit (CLI console)
- RHEL/Fedora: libedit-devel on CentOS (RHEL requires rhel-7-server-optional-rpms)
- Debian/Ubuntu/Alpine: libedit-dev
* Termcap (only required if libedit doesn't already link against termcap/ncurses)
- RHEL/Fedora: libtermcap-devel
- Debian/Ubuntu: (not necessary)
## Special requirements
**FreeBSD**: libexecinfo (automatically used when Icinga 2 is installed via port or package)
**RHEL5** ships an ancient flex version. Updated packages are available for
example from the repoforge buildtools repository.
* x86: https://mirror.hs-esslingen.de/repoforge/redhat/el5/en/i386/buildtools/
* x86\_64: https://mirror.hs-esslingen.de/repoforge/redhat/el5/en/x86\_64/buildtools/
### User Requirements
## Runtime user environment
By default Icinga will run as user 'icinga' and group 'icinga'. Additionally the
external command pipe and livestatus features require a dedicated command group
'icingacmd'. You can choose your own user/group names and pass them to CMake
using the `ICINGA2_USER`, `ICINGA2_GROUP` and `ICINGA2_COMMAND_GROUP` variables.
```
# groupadd icinga
# groupadd icingacmd
# useradd -c "icinga" -s /sbin/nologin -G icingacmd -g icinga icinga
```
On Alpine (which uses ash busybox) you can run:
```
# addgroup -S icinga
# addgroup -S icingacmd
# adduser -S -D -H -h /var/spool/icinga2 -s /sbin/nologin -G icinga -g icinga icinga
# adduser icinga icingacmd
```
Add the web server user to the icingacmd group in order to grant it write
permissions to the external command pipe and livestatus socket:
```
# usermod -a -G icingacmd www-data
```
Make sure to replace "www-data" with the name of the user your web server
is running as.
## Building Icinga 2
# Building Icinga 2
Once you have installed all the necessary build requirements you can build
Icinga 2 using the following commands:
```
$ mkdir build && cd build
$ cmake ..
$ make
$ make install
```
You can specify an alternative installation prefix using `-DCMAKE_INSTALL_PREFIX`:
```
$ cmake .. -DCMAKE_INSTALL_PREFIX=/tmp/icinga2
```
In addition to `CMAKE_INSTALL_PREFIX` the following Icinga-specific cmake
variables are supported:
## CMake Variables
In addition to `CMAKE_INSTALL_PREFIX` here are most of the supported Icinga-specific cmake variables.
**System Environment**
- `ICINGA2_GIT_VERSION_INFO`: Whether to use Git to determine the version number; defaults to `ON`
- `ICINGA2_USER`: The user Icinga 2 should run as; defaults to `icinga`
- `ICINGA2_GROUP`: The group Icinga 2 should run as; defaults to `icinga`
- `ICINGA2_GIT_VERSION_INFO`: Whether to use Git to determine the version number; defaults to `ON`
- `ICINGA2_COMMAND_GROUP`: The command group Icinga 2 should use; defaults to `icingacmd`
- `ICINGA2_UNITY_BUILD`: Whether to perform a unity build; defaults to `ON`
- `ICINGA2_LTO_BUILD`: Whether to use link time optimization (LTO); defaults to `OFF`
- `ICINGA2_PLUGINDIR`: The path for the Monitoring Plugins project binaries; defaults to `/usr/lib/nagios/plugins`
- `ICINGA2_RUNDIR`: The location of the "run" directory; defaults to `CMAKE_INSTALL_LOCALSTATEDIR/run`
- `CMAKE_INSTALL_SYSCONFDIR`: The configuration directory; defaults to `CMAKE_INSTALL_PREFIX/etc`
- `ICINGA2_SYSCONFIGFILE`: Where to put the config file the initscript/systemd pulls it's dirs from;
defaults to `CMAKE_INSTALL_PREFIX/etc/sysconfig/icinga2`
- `CMAKE_INSTALL_LOCALSTATEDIR`: The state directory; defaults to `CMAKE_INSTALL_PREFIX/var`
- `ICINGA2_PLUGINDIR`: The path for the Monitoring Plugins project binaries; defaults to `/usr/lib/nagios/plugins`
**Build Optimization**
- `ICINGA2_UNITY_BUILD`: Whether to perform a unity build; defaults to `ON`
- `ICINGA2_LTO_BUILD`: Whether to use link time optimization (LTO); defaults to `OFF`
**Init System**
- `USE_SYSTEMD=ON|OFF`: Use systemd or a classic SysV initscript; defaults to `OFF`
- `INSTALL_SYSTEMD_SERVICE_AND_INITSCRIPT=ON|OFF` Force install both the systemd service definition file
and the SysV initscript in parallel, regardless of how `USE_SYSTEMD` is set.
Only use this for special packaging purposes and if you know what you are doing.
Defaults to `OFF`.
- `ICINGA2_WITH_MYSQL`: Determines whether the MySQL IDO module is built; defaults to `ON`
- `ICINGA2_WITH_PGSQL`: Determines whether the PostgreSQL IDO module is built; defaults to `ON`
**Features:**
- `ICINGA2_WITH_CHECKER`: Determines whether the checker module is built; defaults to `ON`
- `ICINGA2_WITH_COMPAT`: Determines whether the compat module is built; defaults to `ON`
- `ICINGA2_WITH_DEMO`: Determines whether the demo module is built; defaults to `OFF`
......@@ -123,9 +161,31 @@ Defaults to `OFF`.
- `ICINGA2_WITH_LIVESTATUS`: Determines whether the Livestatus module is built; defaults to `ON`
- `ICINGA2_WITH_NOTIFICATION`: Determines whether the notification module is built; defaults to `ON`
- `ICINGA2_WITH_PERFDATA`: Determines whether the perfdata module is built; defaults to `ON`
- `ICINGA2_WITH_STUDIO`: Determines whether the Icinga Studio application is built; defaults to `OFF`
- `ICINGA2_WITH_TESTS`: Determines whether the unit tests are built; defaults to `ON`
**MySQL or MariaDB:**
The following settings can be tuned for the MySQL / MariaDB IDO feature.
- `ICINGA2_WITH_MYSQL`: Determines whether the MySQL IDO module is built; defaults to `ON`
- `MYSQL_CLIENT_LIBS`: Client implementation used (mysqlclient / mariadbclient); defaults searches for `mysqlclient` and `mariadbclient`
- `MYSQL_INCLUDE_DIR`: Directory containing include files for the mysqlclient; default empty -
checking multiple paths like `/usr/include/mysql`
See [FindMySQL.cmake](third-party/cmake/FindMySQL.cmake) for the implementation.
**PostgreSQL:**
The following settings can be tuned for the PostgreSQL IDO feature.
- `ICINGA2_WITH_PGSQL`: Determines whether the PostgreSQL IDO module is built; defaults to `ON`
- `PostgreSQL_INCLUDE_DIR`: Top-level directory containing the PostgreSQL include directories
- `PostgreSQL_LIBRARY_DIR`: Top-level directory containing the PostgreSQL libraries
See [FindMySQL.cmake](third-party/cmake/FindPostgreSQL.cmake) for the implementation.
**Version detection:**
CMake determines the Icinga 2 version number using `git describe` if the
source directory is contained in a Git repository. Otherwise the version number
is extracted from the [VERSION](VERSION) file. This behavior can be
......@@ -133,64 +193,75 @@ overridden by creating a file called `icinga-version.h.force` in the source
directory. Alternatively the `-DICINGA2_GIT_VERSION_INFO=OFF` option for CMake
can be used to disable the usage of `git describe`.
## Build Icinga 2 RPMs
# Building packages
> **WARNING:** Some of this information is outdated!
## Building RPMs
### Build Environment on RHEL, CentOS, Fedora, Amazon Linux
Setup your build environment:
```
yum -y install rpmdevtools
```
### Build Environment on SuSE/SLES
SLES:
```
zypper addrepo http://download.opensuse.org/repositories/devel:tools/SLE_12_SP2/devel:tools.repo
zypper refresh
zypper install rpmdevtools spectool
```
OpenSuSE:
```
zypper addrepo http://download.opensuse.org/repositories/devel:tools/openSUSE_Leap_42.3/devel:tools.repo
zypper refresh
zypper install rpmdevtools spectool
```
### Package Builds
Prepare the rpmbuild directory tree:
```
cd $HOME
rpmdev-setuptree
```
Copy the icinga2.spec file to `rpmbuild/SPEC` or fetch the latest version:
```
curl https://raw.githubusercontent.com/Icinga/rpm-icinga2/master/icinga2.spec -o $HOME/rpmbuild/SPECS/icinga2.spec
```
Copy the tarball to `rpmbuild/SOURCES` e.g. by using the `spectool` binary
provided with `rpmdevtools`:
```
cd $HOME/rpmbuild/SOURCES
spectool -g ../SPECS/icinga2.spec
cd $HOME/rpmbuild
```
Install the build dependencies. Example for CentOS 7:
```
yum -y install libedit-devel ncurses-devel gcc-c++ libstdc++-devel openssl-devel \
cmake flex bison boost-devel systemd mysql-devel postgresql-devel httpd \
selinux-policy-devel checkpolicy selinux-policy selinux-policy-doc
```
Note: If you are using Amazon Linux, systemd is not required.
A shorter way is available using the `yum-builddep` command on RHEL based systems:
```
yum-builddep SPECS/icinga2.spec
```
Build the RPM:
```
rpmbuild -ba SPECS/icinga2.spec
```
### Additional Hints
......@@ -207,23 +278,25 @@ The following packages are required to build the SELinux policy module:
The RedHat Developer Toolset is required for building Icinga 2 beforehand.
This contains a modern version of flex and a C++ compiler which supports
C++11 features.
```
cat >/etc/yum.repos.d/devtools-2.repo <<REPO
[testing-devtools-2-centos-\$releasever]
name=testing 2 devtools for CentOS $releasever
baseurl=https://people.centos.org/tru/devtools-2/\$releasever/\$basearch/RPMS
gpgcheck=0
REPO
```
Dependencies to devtools-2 are used in the RPM SPEC, so the correct tools
should be used for building.
As an alternative, you can use newer Boost packages provided on
[packages.icinga.com](https://packages.icinga.com/epel).
```
cat >$HOME/.rpmmacros <<MACROS
%build_icinga_org 1
MACROS
```
#### Amazon Linux
......@@ -235,14 +308,16 @@ If you prefer to build packages offline, a suitable Vagrant box is located
The Icinga repository provides the required boost package version and must be
added before building.
## Build Icinga 2 Debian/Ubuntu packages
## Build Debian/Ubuntu packages
> **WARNING:** This information is outdated!
Setup your build environment on Debian/Ubuntu, copy the 'debian' directory from
the Debian packaging Git repository (https://github.com/Icinga/pkg-icinga2-debian)
into your source tree and run the following command:
```
$ dpkg-buildpackage -uc -us
```
## Build Alpine Linux packages
......@@ -255,7 +330,7 @@ can be found [here](https://github.com/alpinelinux/alpine-chroot-install).
Once the build environment is installed, you can setup the system to build
the packages by following [this document](https://wiki.alpinelinux.org/wiki/Creating_an_Alpine_package).
## Build Post Install Tasks
# Build Post Install Tasks
After building Icinga 2 yourself, your package build system should at least run the following post
install requirements:
......@@ -267,25 +342,28 @@ install requirements:
Icinga 2 comes with a binary that takes care of loading all the relevant
components (e.g. for check execution, notifications, etc.):
```
# icinga2 daemon
[2016-12-08 16:44:24 +0100] information/cli: Icinga application loader (version: v2.5.4-231-gb10a6b7; debug)
[2016-12-08 16:44:24 +0100] information/cli: Loading configuration file(s).
[2016-12-08 16:44:25 +0100] information/ConfigItem: Committing config item(s).
...
```
### Init Script
Icinga 2 can be started as a daemon using the provided init script:
```
# /etc/init.d/icinga2
Usage: /etc/init.d/icinga2 {start|stop|restart|reload|checkconfig|status}
```
### Systemd
If your distribution uses Systemd:
```
# systemctl {start|stop|reload|status|enable|disable} icinga2
```
In case the distribution is running Systemd >227, you'll also
need to package and install the `etc/initsystem/icinga2.service.limits.conf`
......@@ -294,17 +372,19 @@ file into `/etc/systemd/system/icinga2.service.d`.
### openrc
Or if your distribution uses openrc (like Alpine):
```
# rc-service icinga2
Usage: /etc/init.d/icinga2 {start|stop|restart|reload|checkconfig|status}
```
Note: the openrc's init.d is not shipped by default.
A working init.d with openrc can be found here: (https://git.alpinelinux.org/cgit/aports/plain/community/icinga2/icinga2.initd). If you have customized some path, edit the file and adjust it according with your setup.
Those few steps can be followed:
```
# wget https://git.alpinelinux.org/cgit/aports/plain/community/icinga2/icinga2.initd
# mv icinga2.initd /etc/init.d/icinga2
# chmod +x /etc/init.d/icinga2
```
Icinga 2 reads a single configuration file which is used to specify all
configuration settings (global settings, hosts, services, etc.). The
......
......@@ -27,12 +27,26 @@ as web interface.
More information can be found at [www.icinga.com](https://www.icinga.com/products/icinga-2/)
and inside the [documentation](https://www.icinga.com/docs/icinga2/latest/).
## License
## Licensing
Icinga 2 and the Icinga 2 documentation are licensed under the terms of the GNU
General Public License Version 2, you will find a copy of this license in the
COPYING file included in the source package.
In addition, as a special exception, the copyright holders give
permission to link the code of portions of this program with the
OpenSSL library under certain conditions as described in each
individual source file, and distribute linked combinations including
the two.
You must obey the GNU General Public License in all respects for all
of the code used other than OpenSSL. If you modify file(s) with this
exception, you may extend this exception to your version of the
file(s), but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. If you delete
this exception statement from all source files in the program, then
also delete it here.
## Installation
Read the [INSTALL.md](INSTALL.md) file for more information about how to install it.
......@@ -45,7 +59,7 @@ is also available on https://docs.icinga.com
## Support
Check the project website at https://www.icinga.com for status updates. Join the
[community channels](https://www.icinga.com/community/get-involved/) for questions
[community channels](https://www.icinga.com/community) for questions
or ask an Icinga partner for [professional support](https://www.icinga.com/services/support/).
## Contributing
......
# Release Workflow
# Release Workflow <a id="release-workflow"></a>
#### Table of Content
- [1. Preparations](#preparations)
- [1.1. Issues](#issues)
- [1.2. Backport Commits](#backport-commits)
- [1.3. Authors](#authors)
- [2. Version](#version)
- [3. Changelog](#changelog)
- [4. Git Tag](#git-tag)
- [5. Package Builds](#package-builds)
- [5.1. RPM Packages](#rpm-packages)
- [5.2. DEB Packages](#deb-packages)
- [6. Build Server](#build-server)
- [7. Release Tests](#release-tests)
- [8. GitHub Release](#github-release)
- [9. Chocolatey](#chocolatey)
- [10. Post Release](#post-release)
- [10.1. Online Documentation](#online-documentation)
- [10.2. Announcement](#announcement)
- [10.3. Project Management](#project-management)
## Preparations <a id="preparations"></a>
Specify the release version.
```
VERSION=2.7.2
VERSION=2.9.0
```
## Issues
Add your signing key to your Git configuration file, if not already there.
```
vim $HOME/.gitconfig
[user]
email = michael.friedrich@icinga.com
name = Michael Friedrich
signingkey = D14A1F16
```
### Issues <a id="issues"></a>
Check issues at https://github.com/Icinga/icinga2
## Backport Commits
### Backport Commits <a id="backport-commits"></a>
For minor versions you need to manually backports any and all commits from the
master branch which should be part of this release.
## Authors
### Authors <a id="authors"></a>
Update the [.mailmap](.mailmap) and [AUTHORS](AUTHORS) files:
......@@ -24,15 +58,15 @@ git checkout master
git log --use-mailmap | grep '^Author:' | cut -f2- -d' ' | sort | uniq > AUTHORS
```
## Version
## Version <a id="version"></a>
Update the version in the spec file:
Update the version in the version file:
```
gsed -i "s/Version: .*/Version: $VERSION/g" VERSION
sed -i "s/Version: .*/Version: $VERSION/g" VERSION
```
## Changelog
## Changelog <a id="changelog"></a>
Update the [CHANGELOG.md](CHANGELOG.md) file.
......@@ -51,82 +85,168 @@ Run the script which updates the [CHANGELOG.md](CHANGELOG.md) file.
git diff
```
## Git Tag
## Git Tag <a id="git-tag"></a>
Commit these changes to the "master" branch:
> **Major Releases**: Commit these changes to the `master` branch.
>
> **Minor Releases**: Commit changes to the `support` branch.
```
git commit -v -a -m "Release version $VERSION"
```
For minor releases: Cherry-pick this commit into the "support" branch:
Create a signed tag (tags/v<VERSION>) on the `master` branch (for major
releases) or the `support` branch (for minor releases).
```
git checkout support/2.7
git cherry-pick master
git tag -s -m "Version $VERSION" v$VERSION
```
Create a signed tag (tags/v<VERSION>) on the "master" branch (for major
releases) or the "support" branch (for minor releases).
Push the tag:
GB:
```
git push --tags
```
**For major releases:** Create a new `support` branch:
```
git tag -u EE8E0720 -m "Version $VERSION" v$VERSION
git checkout master
git checkout -b support/2.9
git push -u origin support/2.9
```
MF:
**For minor releases:** Push the support branch, cherry-pick the release commit
into master and merge the support branch:
```
git tag -u D14A1F16 -m "Version $VERSION" v$VERSION
git push -u origin support/2.8
git checkout master
git cherry-pick support/2.8
git merge --strategy=ours support/2.8
git push origin master
```
NH:
## Package Builds <a id="package-builds"></a>
### RPM Packages <a id="rpm-packages"></a>
```
git tag -u 630F89D9 -m "Version $VERSION" v$VERSION
git clone git@github.com:icinga/rpm-icinga2.git && cd rpm-icinga2
```
Push the tag:
#### Branch Workflow
**Major releases** are branched off `master`.
```
git push --tags
git checkout master && git pull
```
For major releases: Create a new "support" branch:
**Bugfix releases** are created in the `release` branch and later merged to master.
```
git checkout master
git checkout -b support/2.7
git push -u origin support/2.7
git checkout release && git pull
```
For minor releases: Push the support branch, cherry-pick the release commit
into master and merge the support branch:
#### Release Commit
Set the `Version`, `Revision` and `changelog` inside the spec file.
```
git push -u origin support/2.7
git checkout master
git cherry-pick support/2.7
git merge --strategy=ours support/2.7
git push origin master
sed -i "s/Version: .*/Version: $VERSION/g" icinga2.spec
vim icinga2.spec
%changelog
* Tue Jul 17 2018 Michael Friedrich <michael.friedrich@icinga.com> 2.9.0-1
- Update to 2.9.0
```
# External Dependencies
```
git commit -av -m "Release 2.9.0-1"
git push
```
**Note for major releases**: Update release branch to latest.
`git checkout release && git pull && git merge master && git push`
**Note for minor releases**: Cherry-pick the release commit into master.
`git checkout master && git pull && git cherry-pick release && git push`
### DEB Packages <a id="deb-packages"></a>
```
git clone git@github.com:icinga/deb-icinga2.git && cd deb-icinga2
```
## Build Server
#### Branch Workflow
**Major releases** are branched off `master`.
```
git checkout master && git pull
```
**Bugfix releases** are created in the `release` branch and later merged to master.
```
git checkout release && git pull
```
#### Release Commit
Set the `Version`, `Revision` and `changelog` inside the spec file.
```
./dch 2.9.0-1 "Update to 2.9.0"
```
```
git commit -av -m "Release 2.9.0-1"
git push
```
```
git commit -av -m "Release 2.9.0-1"
```
**Note for major releases**: Update release branch to latest.
`git checkout release && git pull && git merge master && git push`
**Note for minor releases**: Cherry-pick the release commit into master.
`git checkout master && git pull && git cherry-pick release && git push`
#### DEB with dch on macOS
```
docker run -v `pwd`:/mnt/packaging -ti ubuntu:xenial bash
apt-get update
apt-get install git ubuntu-dev-tools vim
cd /mnt/packaging
git config --global user.name "Michael Friedrich"
git config --global user.email "michael.friedrich@icinga.com"
./dch 2.9.0-1 "Update to 2.9.0"
```
## Build Server <a id="build-server"></a>
* Verify package build changes for this version.
* Test the snapshot packages for all distributions beforehand.
* Build the newly created Git tag for Debian/RHEL/SuSE.
* Build the newly created Git tag for Windows.
## Release Tests
## Release Tests <a id="release-tests"></a>
* Test DB IDO with MySQL and PostgreSQL.
* Provision the vagrant boxes and test the release packages.
* Test the [setup wizard](https://packages.icinga.com/windows/) inside a Windows VM.
* Start a new docker container and install/run icinga2.
Example for CentOS7:
......@@ -139,12 +259,11 @@ yum -y install icinga2
icinga2 daemon -C
```
## GitHub Release
## GitHub Release <a id="github-release"></a>
Create a new release for the newly created Git tag.
https://github.com/Icinga/icinga2/releases
Create a new release for the newly created Git tag: https://github.com/Icinga/icinga2/releases
## Chocolatey
## Chocolatey <a id="chocolatey"></a>
Navigate to the git repository on your Windows box which
already has chocolatey installed. Pull/checkout the release.
......@@ -158,22 +277,24 @@ cpack
Install the created icinga2 package locally:
```
choco install icinga2 -version 2.7.0 -fdv "%cd%" -source "'%cd%;https://chocolatey.org/api/v2/'"
choco install icinga2 -version 2.9.0 -fdv "%cd%" -source "'%cd%;https://chocolatey.org/api/v2/'"
```
Upload the package to [chocolatey](https://chocolatey.org/packages/upload).
## Online Documentation
## Post Release <a id="post-release"></a>
### Online Documentation <a id="online-documentation"></a>
Ask @bobapple to update the documentation at docs.icinga.com.
## Announcement
### Announcement <a id="announcement"></a>
* Create a new blog post on www.icinga.com/blog
* Social media: [Twitter](https://twitter.com/icinga), [Facebook](https://www.facebook.com/icinga), [G+](https://plus.google.com/+icinga), [Xing](https://www.xing.com/communities/groups/icinga-da4b-1060043), [LinkedIn](https://www.linkedin.com/groups/Icinga-1921830/about)
* Update IRC channel topic
# After the release
### Project Management <a id="project-management"></a>
* Add new minor version on [GitHub](https://github.com/Icinga/icinga2/milestones).
* Close the released version on [GitHub](https://github.com/Icinga/icinga2/milestones).
Version: 2.8.4
Version: 2.9.0
Revision: 1
# Icinga 2
# Copyright (C) 2012-2017 Icinga Development Team (https://www.icinga.com/)
# 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
......
namespace Icinga
{
partial class GlobalZonesInputBox
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.btnOK = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.lblGlobalZoneName = new System.Windows.Forms.Label();
this.txtGlobalZoneName = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// btnOK
//
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnOK.Location = new System.Drawing.Point(191, 76);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(75, 23);
this.btnOK.TabIndex = 0;
this.btnOK.Text = "OK";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(272, 76);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 23);
this.btnCancel.TabIndex = 1;
this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(13, 13);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(231, 13);
this.label1.TabIndex = 2;
this.label1.Text = "Please enter the name for the new global Zone:";
//
// lblGlobalZoneName
//
this.lblGlobalZoneName.AutoSize = true;
this.lblGlobalZoneName.Location = new System.Drawing.Point(16, 46);
this.lblGlobalZoneName.Name = "lblGlobalZoneName";
this.lblGlobalZoneName.Size = new System.Drawing.Size(68, 13);
this.lblGlobalZoneName.TabIndex = 3;
this.lblGlobalZoneName.Text = "Global Zone:";
//
// txtGlobalZoneName
//
this.txtGlobalZoneName.Location = new System.Drawing.Point(90, 43);
this.txtGlobalZoneName.Name = "txtGlobalZoneName";
this.txtGlobalZoneName.Size = new System.Drawing.Size(257, 20);
this.txtGlobalZoneName.TabIndex = 0;
//
// GlobalZonesInputBox
//
this.AcceptButton = this.btnOK;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnCancel;
this.ClientSize = new System.Drawing.Size(359, 111);
this.Controls.Add(this.txtGlobalZoneName);
this.Controls.Add(this.lblGlobalZoneName);
this.Controls.Add(this.label1);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOK);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "GlobalZonesInputBox";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Add Global Zones";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label lblGlobalZoneName;
public System.Windows.Forms.TextBox txtGlobalZoneName;
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Icinga
{
public partial class GlobalZonesInputBox : Form
{
private ListView.ListViewItemCollection globalZonesItems;
public GlobalZonesInputBox(ListView.ListViewItemCollection globalZonesItems)
{
InitializeComponent();
this.globalZonesItems = globalZonesItems;
}
private void Warning(string message)
{
MessageBox.Show(this, message, Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
private void btnOK_Click(object sender, EventArgs e)
{
if (txtGlobalZoneName.Text == "global-templates" || txtGlobalZoneName.Text == "director-global") {
Warning("This global zone is configured by default.");
return;
}
foreach (ListViewItem lvw in globalZonesItems) {
if (txtGlobalZoneName.Text == lvw.Text) {
Warning("This global zone is already defined.");
return;
}
}
DialogResult = DialogResult.OK;
Close();
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
......@@ -117,6 +117,12 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="GlobalZonesInputBox.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="GlobalZonesInputBox.Designer.cs">
<DependentUpon>GlobalZonesInputBox.cs</DependentUpon>
</Compile>
<Compile Include="ServiceStatus.cs">
<SubType>Form</SubType>
</Compile>
......@@ -137,6 +143,9 @@
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="GlobalZonesInputBox.resx">
<DependentUpon>GlobalZonesInputBox.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ServiceStatus.resx">
<DependentUpon>ServiceStatus.cs</DependentUpon>
</EmbeddedResource>
......
......@@ -7,14 +7,17 @@ using System.Text;
namespace Icinga
{
static class Program
internal static class NativeMethods
{
[DllImport("msi.dll", SetLastError = true)]
static extern int MsiEnumProducts(int iProductIndex, StringBuilder lpProductBuf);
[DllImport("msi.dll", CharSet = CharSet.Unicode)]
internal static extern int MsiEnumProducts(int iProductIndex, StringBuilder lpProductBuf);
[DllImport("msi.dll", CharSet = CharSet.Unicode)]
static extern Int32 MsiGetProductInfo(string product, string property, [Out] StringBuilder valueBuf, ref Int32 len);
internal static extern Int32 MsiGetProductInfo(string product, string property, [Out] StringBuilder valueBuf, ref Int32 len);
}
static class Program
{
public static string Icinga2InstallDir
{
get
......@@ -23,13 +26,13 @@ namespace Icinga
for (int index = 0; ; index++) {
szProduct = new StringBuilder(39);
if (MsiEnumProducts(index, szProduct) != 0)
if (NativeMethods.MsiEnumProducts(index, szProduct) != 0)
break;
int cbName = 128;
StringBuilder szName = new StringBuilder(cbName);
if (MsiGetProductInfo(szProduct.ToString(), "ProductName", szName, ref cbName) != 0)
if (NativeMethods.MsiGetProductInfo(szProduct.ToString(), "ProductName", szName, ref cbName) != 0)
continue;
if (szName.ToString() != "Icinga 2")
......@@ -37,7 +40,7 @@ namespace Icinga
int cbLocation = 1024;
StringBuilder szLocation = new StringBuilder(cbLocation);
if (MsiGetProductInfo(szProduct.ToString(), "InstallLocation", szLocation, ref cbLocation) == 0)
if (NativeMethods.MsiGetProductInfo(szProduct.ToString(), "InstallLocation", szLocation, ref cbLocation) == 0)
return szLocation.ToString();
}
......
......@@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Icinga Development Team")]
[assembly: AssemblyProduct("Icinga 2")]
[assembly: AssemblyCopyright("Copyright © 2014-2015 Icinga Development Team")]
[assembly: AssemblyCopyright("Copyright © 2014-2018 Icinga Development Team")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
......