Permalink
Browse files

First prototype of debian packages

  • Loading branch information...
1 parent 578c55d commit e2477459324f5f651d4fbd015c4ddc77a1a0f478 @mickem committed Dec 3, 2016
@@ -1,4 +1,4 @@
-#!/bin/python
+#!/usr/bin/python
import re
import sys
import os
@@ -42,4 +42,4 @@
if options.display:
version.print_version()
-
+
View
@@ -0,0 +1,26 @@
+Source: nsclient++
+Section: unknown
+Priority: extra
+Maintainer: Michael Medin <michael@medin.name>
+Build-Depends: debhelper (>= 8.0.0)
+Standards-Version: 3.9.2
+Homepage: https://nsclient.org
+Vcs-Git: https://github.com/mickem/nscp.git
+Vcs-Browser: https://github.com/mickem/nscp
+
+Package: nsclient++-server
+Architecture: all
+Description: NSClient++ (nscp) aims to be a simple yet powerful and secure monitoring daemon. It was built for Naemon/Nagios/Icinga, but nothing in the daemon is Naemon/Nagios/Icinga specific and it can be used in many other scenarios where you want to receive/distribute check metrics.
+
+Package: nsclient++-client
+Architecture: all
+Description: Client for checking status from remote NSClient++ servers.
+
+Package: nsclient++-nsca
+Architecture: all
+Description: NSCA Modules to allow NSClient++ to communicate with NSCA servers or clients.
+
+Package: nsclient++-bin
+Architecture: all
+Description: Shared libraries used by both NSClient++ server and client.
+
@@ -0,0 +1,31 @@
+/usr/lib/libnscp*
+/usr/lib/libplugin_api*
+/usr/lib/libwhere_filter*
+/usr/lib/nsclient/modules/libCauseCrashes.so
+/usr/lib/nsclient/modules/libCheckExternalScripts.so
+/usr/lib/nsclient/modules/libCheckHelpers.so
+/usr/lib/nsclient/modules/libCheckLogFile.so
+/usr/lib/nsclient/modules/libCheckMKClient.so
+/usr/lib/nsclient/modules/libCheckMKServer.so
+/usr/lib/nsclient/modules/libCheckNSCP.so
+/usr/lib/nsclient/modules/libCheckNet.so
+/usr/lib/nsclient/modules/libCheckSystemUnix.so
+/usr/lib/nsclient/modules/libCollectdClient.so
+/usr/lib/nsclient/modules/libCommandClient.so
+/usr/lib/nsclient/modules/libGraphiteClient.so
+/usr/lib/nsclient/modules/libLUAScript.so
+/usr/lib/nsclient/modules/libNRDPClient.so
+/usr/lib/nsclient/modules/libNRPEClient.so
+/usr/lib/nsclient/modules/libNRPEServer.so
+/usr/lib/nsclient/modules/libNSCPClient.so
+/usr/lib/nsclient/modules/libNSClientServer.so
+/usr/lib/nsclient/modules/libPythonScript.so
+/usr/lib/nsclient/modules/libSMTPClient.so
+/usr/lib/nsclient/modules/libSamplePluginSimple.so
+/usr/lib/nsclient/modules/libScheduler.so
+/usr/lib/nsclient/modules/libSimpleCache.so
+/usr/lib/nsclient/modules/libSimpleFileWriter.so
+/usr/lib/nsclient/modules/libSyslogClient.so
+/usr/lib/nsclient/modules/libWEBServer.so
+/usr/bin/check_nscp_nrpe
+/usr/bin/check_nscp
@@ -0,0 +1,2 @@
+/usr/lib/nsclient/modules/libNSCAClient.so
+/usr/lib/nsclient/modules/libNSCAServer.so
@@ -0,0 +1 @@
+/etc/nsclient
View
@@ -0,0 +1,32 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+#
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+#
+# Modified to make a template file for a multi-binary package with separated
+# build-arch and build-indep targets by Bill Allombert 2001
+
+# Uncomment this to turn on verbose mode.
+export DH_VERBOSE=1
+
+# This has to be exported to make some magic below work.
+export DH_OPTIONS
+
+
+%:
+ dh $@
+
+override_dh_auto_clean:
+ dh_auto_clean
+ test ! -f ext/docs/tools/sphinxext/nscp.pyc || rm ext/docs/tools/sphinxext/nscp.pyc
+ test ! -f ext/lua-protobuf/lua_protobuf/__init__.pyc || rm ext/lua-protobuf/lua_protobuf/__init__.pyc
+ test ! -f ext/lua-protobuf/lua_protobuf/generator.pyc || rm ext/lua-protobuf/lua_protobuf/generator.pyc
+ test ! -f ext/json-protobuf/json_protobuf/generator.pyc || rm ext/json-protobuf/json_protobuf/generator.pyc
+ test ! -f ext/json-protobuf/json_protobuf/__init__.pyc || rm ext/json-protobuf/json_protobuf/__init__.pyc
+ test ! -f deb/build/python/VersionHandler.pyc || rm deb/build/python/VersionHandler.pyc
+ test ! -f build/python/VersionHandler.pyc || rm build/python/VersionHandler.pyc
+ test ! -f nsclient.log || rm nsclient.log
@@ -19,8 +19,8 @@ Vagrant.configure(2) do |config|
# Provision build script
- config.vm.provision "shell", inline: "cp /etc/puppet/files/build.sh /home/vagrant/build.sh"
- config.vm.provision "shell", inline: "chmod 755 /home/vagrant/build.sh"
+ config.vm.provision "shell", inline: "cp /etc/puppet/files/build-debian.sh /home/vagrant/build-debian.sh"
+ config.vm.provision "shell", inline: "chmod 755 /home/vagrant/build-debian.sh"
# Build NSClient++
config.vm.provision "shell", inline: "su - vagrant -c ./build.sh"
@@ -0,0 +1,16 @@
+#/bin/bash
+mkdir build
+mkdir deb
+pushd build
+cmake $* /source/nscp || exit 1
+make package_source || exit 1
+VERSION=`/source/nscp/build/python/version.py -f /source/nscp/version.txt -d`
+mv nscp-$VERSION-Source.tar.gz ../nsclient++_$VERSION.orig.tar.gz
+popd
+pushd deb
+tar zxvf ../nsclient++_$VERSION.orig.tar.gz || exit 1
+mv nscp-$VERSION-Source/* .
+rm -rf nscp-$VERSION-Source
+dpkg-buildpackage || exit 1
+popd
+mv nsclient++*_$VERSION_*.deb /source/nscp/packages
@@ -12,20 +12,27 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provider :virtualbox do |vb|
- # Don't boot with headless mode
vb.gui = false
- vb.customize ["modifyvm", :id, "--memory", "1024"]
+ vb.customize ["modifyvm", :id, "--memory", "2048"]
end
- config.vm.provision :puppet do |puppet|
- puppet.manifests_path = "../../debian/manifests"
- puppet.manifest_file = "base.pp"
- end
+ config.vm.provision "shell", inline: "sudo apt-get update -y"
+ config.vm.provision "shell", inline: "sudo apt-get install -y git build-essential debhelper cmake"
+ config.vm.provision "shell", inline: "sudo apt-get install -y python-dev libssl-dev libboost-all-dev libprotobuf-dev libcrypto++-dev libgtest-dev liblua5.1-0-dev"
+ config.vm.provision "shell", inline: "sudo apt-get install -y protobuf-compiler python-protobuf"
+ config.vm.provision "shell", inline: "sudo apt-get install -y python-sphinx"
+ config.vm.provision "shell", inline: "test -f /usr/lib/python2.7/dist-packages/google/protobuf/compiler/__init__.py || sudo touch /usr/lib/python2.7/dist-packages/google/protobuf/compiler/__init__.py"
- config.vm.provision "shell", inline: "su - vagrant -c ./build.sh"
+ # Provision build script
+ config.vm.provision "shell", inline: "cp /etc/puppet/files/build-debian.sh /home/vagrant/build-debian.sh"
+ config.vm.provision "shell", inline: "chmod 755 /home/vagrant/build-debian.sh"
+ # Build NSClient++
+ config.vm.provision "shell", inline: "su - vagrant -c ./build-debian.sh"
config.vm.synced_folder "../../files", "/etc/puppet/files"
config.vm.synced_folder "../../../", "/source/nscp"
config.ssh.forward_agent = true
+ config.ssh.private_key_path = ['~/.vagrant.d/insecure_private_key', '~/.ssh/id_rsa']
+ config.ssh.insert_key = false
end

0 comments on commit e247745

Please sign in to comment.