summaryrefslogtreecommitdiff
path: root/rhnop-client
diff options
context:
space:
mode:
Diffstat (limited to 'rhnop-client')
-rw-r--r--rhnop-client/Makefile77
-rw-r--r--rhnop-client/conf.lua33
-rwxr-xr-xrhnop-client/configure106
-rw-r--r--rhnop-client/db.lua160
-rw-r--r--rhnop-client/debian/changelog23
-rw-r--r--rhnop-client/debian/compat1
-rw-r--r--rhnop-client/debian/control15
-rw-r--r--rhnop-client/debian/copyright28
-rwxr-xr-xrhnop-client/debian/postinst10
-rwxr-xr-xrhnop-client/debian/postrm13
-rw-r--r--rhnop-client/debian/rhnop-client.master.runit5
-rw-r--r--rhnop-client/debian/rhnop-client.master.runit.log9
-rw-r--r--rhnop-client/debian/rhnop-client.standby.runit5
-rw-r--r--rhnop-client/debian/rhnop-client.standby.runit.log9
-rw-r--r--rhnop-client/debian/rhnop-client.state.runit5
-rw-r--r--rhnop-client/debian/rhnop-client.state.runit.log9
-rwxr-xr-xrhnop-client/debian/rules83
-rwxr-xr-xrhnop-client/nopcollectd75
-rw-r--r--rhnop-client/nopcollectd.master.conf16
-rw-r--r--rhnop-client/nopcollectd.standby.conf16
-rwxr-xr-xrhnop-client/nopsysstated71
-rw-r--r--rhnop-client/nopsysstated.conf9
22 files changed, 0 insertions, 778 deletions
diff --git a/rhnop-client/Makefile b/rhnop-client/Makefile
deleted file mode 100644
index 8eb3860..0000000
--- a/rhnop-client/Makefile
+++ /dev/null
@@ -1,77 +0,0 @@
-##
-## rhnop
-##
-## Copyright (C) 2011-2014 Christian Pointner <equinox@helsinki.at>
-##
-## This file is part of rhnop.
-##
-## rhnop 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 3 of the License, or
-## any later version.
-##
-## rhnop 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 rhnop. If not, see <http://www.gnu.org/licenses/>.
-##
-
-ifneq ($(MAKECMDGOALS),distclean)
-include include.mk
-endif
-
-EXECUTABLE := nopcollectd
-
-.PHONY: clean distclean install install-bin install-etc uninstall remove purge
-
-all: $(EXECUTABLE)
-
-distclean: clean
- find . -name *.o -exec rm -f {} \;
- find . -name "*.\~*" -exec rm -rf {} \;
- rm -f include.mk
-
-clean:
-
-INSTALL_TARGETS := install-bin install-lib install-etc
-REMOVE_TARGETS := remove-bin remove-lib remove-etc
-
-install: all $(INSTALL_TARGETS)
-
-install-bin: $(EXECUTABLE)
- $(INSTALL) -d $(DESTDIR)$(BINDIR)
- $(INSTALL) -m 755 $(EXECUTABLE) $(DESTDIR)$(BINDIR)
- $(SED) -e 's#^conffile = "nopcollectd#conffile = "$(ETCDIR)/rhnop/nopcollectd#' -i $(DESTDIR)$(BINDIR)/$(EXECUTABLE)
- $(SED) -e 's#_rhnoplibdir_/?.lua#$(LIBDIR)/?.lua#' -i $(DESTDIR)$(BINDIR)/$(EXECUTABLE)
- $(INSTALL) -m 755 nopsysstated $(DESTDIR)$(BINDIR)
- $(SED) -e 's#^conffile = "nopsysstated#conffile = "$(ETCDIR)/rhnop/nopsysstated#' -i $(DESTDIR)$(BINDIR)/nopsysstated
- $(SED) -e 's#_rhnoplibdir_/?.lua#$(LIBDIR)/?.lua#' -i $(DESTDIR)$(BINDIR)/nopsysstated
-
-install-lib:
- $(INSTALL) -d $(DESTDIR)$(LIBDIR)
- $(INSTALL) -m 644 conf.lua $(DESTDIR)$(LIBDIR)
- $(INSTALL) -m 644 db.lua $(DESTDIR)$(LIBDIR)
-
-install-etc:
- $(INSTALL) -d $(DESTDIR)$(ETCDIR)/rhnop
- $(INSTALL) -m 640 nopcollectd.*.conf $(DESTDIR)$(ETCDIR)/rhnop
- $(INSTALL) -m 640 nopsysstated.conf $(DESTDIR)$(ETCDIR)/rhnop
-
-uninstall: remove
-
-remove: $(REMOVE_TARGETS)
-
-remove-bin:
- rm -f $(DESTDIR)$(BINDIR)/$(EXECUTABLE)
-
-remove-lib:
- rm -f $(DESTDIR)$(LIBDIR)/conf.lua
- rm -f $(DESTDIR)$(LIBDIR)/db.lua
-
-remove-etc:
-
-purge: remove
- rm -rf $(DESTDIR)$(ETCDIR)/rhnop
diff --git a/rhnop-client/conf.lua b/rhnop-client/conf.lua
deleted file mode 100644
index a3adda6..0000000
--- a/rhnop-client/conf.lua
+++ /dev/null
@@ -1,33 +0,0 @@
---
--- rhnop
---
--- Copyright (C) 2011-2014 Christian Pointner <equinox@helsinki.at>
---
--- This file is part of rhnop.
---
--- rhnop 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 3 of the License, or
--- any later version.
---
--- rhnop 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 rhnop. If not, see <http://www.gnu.org/licenses/>.
---
-
-local conf = {}
-
-local file = assert(io.open(conffile, "r"))
-for line in file:lines() do
- local k,v = string.match(line, "^([^=#]+)=(.*)$")
- if k and v and v ~= "" then
- conf[k] = v
- end
-end
-file:close()
-
-return conf
diff --git a/rhnop-client/configure b/rhnop-client/configure
deleted file mode 100755
index e64de0d..0000000
--- a/rhnop-client/configure
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/bin/sh
-#
-# rhnop
-#
-# Copyright (C) 2011-2014 Christian Pointner <equinox@helsinki.at>
-#
-# This file is part of rhnop.
-#
-# rhnop 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 3 of the License, or
-# any later version.
-#
-# rhnop 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 rhnop. If not, see <http://www.gnu.org/licenses/>.
-#
-
-EBUILD_COMPAT=0
-
-PREFIX='/usr/local'
-BINDIR=''
-ETCDIR=''
-LIBDIR=''
-
-print_usage() {
- echo "configure --help print this"
- echo " --prefix=<PREFIX> the installation prefix (default: /usr/local)"
- echo " --bindir=<DIR> the path to the bin directory (default: $PREFIX/bin)"
- echo " --sysconfdir=<DIR> the path to the system configuration directory (default: $PREFIX/etc)"
- echo " --libdir=<DIR> the path to the lua library directory (default: $PREFIX/lib/rhnop-client)"
-}
-
-for arg
-do
- case $arg in
- --target=*)
- TARGET=${arg#--target=}
- ;;
- --prefix=*)
- PREFIX=${arg#--prefix=}
- ;;
- --bindir=*)
- BINDIR=${arg#--bindir=}
- ;;
- --sysconfdir=*)
- ETCDIR=${arg#--sysconfdir=}
- ;;
- --libdir=*)
- LIBDIR=${arg#--libdir=}
- ;;
- --ebuild-compat)
- EBUILD_COMPAT=1
- ;;
- --help)
- print_usage
- exit 0
- ;;
- *)
- ERRORS="$ERRORS $arg"
- ;;
- esac
-done
-
-if [ -n "$ERRORS" ] && [ $EBUILD_COMPAT -ne 1 ]; then
- for error in $ERRORS; do
- echo "Unknown argument: $error"
- done
-
- print_usage
- exit 1
-fi
-
-rm -f include.mk
-
-if [ -z "$BINDIR" ]; then
- BINDIR=$PREFIX/bin
-fi
-
-if [ -z "$ETCDIR" ]; then
- ETCDIR=$PREFIX/etc
-fi
-
-if [ -z "$LIBDIR" ]; then
- LIBDIR=$PREFIX/lib/rhnop-client
-fi
-
-cat > include.mk <<EOF
-# this file was created automatically
-# do not edit this file directly
-# use ./configure instead
-
-INSTALL := install
-SED := sed
-
-PREFIX := '$PREFIX'
-BINDIR := '$BINDIR'
-ETCDIR := '$ETCDIR'
-LIBDIR := '$LIBDIR'
-EOF
-
-exit 0
diff --git a/rhnop-client/db.lua b/rhnop-client/db.lua
deleted file mode 100644
index 29e77fb..0000000
--- a/rhnop-client/db.lua
+++ /dev/null
@@ -1,160 +0,0 @@
---
--- rhnop
---
--- Copyright (C) 2011-2014 Christian Pointner <equinox@helsinki.at>
---
--- This file is part of rhnop.
---
--- rhnop 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 3 of the License, or
--- any later version.
---
--- rhnop 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 rhnop. If not, see <http://www.gnu.org/licenses/>.
---
-
-luasql = require "luasql.mysql"
-
--- for destination database
--- CREATE DATABASE nop CHARACTER SET utf8 COLLATE utf8_unicode_ci;
--- GRANT select,insert,update,delete ON nop.master TO 'nopcollectd'@'localhost' IDENTIFIED BY '<password>';
--- GRANT select,insert,update,delete ON nop.standby TO 'nopcollectd'@'localhost';
--- GRANT select,insert,update ON nop.state TO 'nopsysstated'@'localhost' IDENTIFIED BY '<password>';
--- GRANT select ON nop.* TO 'nop'@'localhost' IDENTIFIED BY '<password>';
--- USE nop
--- CREATE TABLE IF NOT EXISTS master (timestamp BIGINT UNSIGNED PRIMARY KEY NOT NULL, cart INT NOT NULL, len INT, showtitle VARCHAR(255), title VARCHAR(255), artist VARCHAR(255), album VARCHAR(255), ismusic BOOLEAN);
--- ALTER TABLE master CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
--- CREATE TABLE IF NOT EXISTS standby (timestamp BIGINT UNSIGNED PRIMARY KEY NOT NULL, cart INT NOT NULL, len INT, showtitle VARCHAR(255), title VARCHAR(255), artist VARCHAR(255), album VARCHAR(255), ismusic BOOLEAN);
--- ALTER TABLE standby CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
--- CREATE TABLE IF NOT EXISTS state (timestamp BIGINT UNSIGNED PRIMARY KEY NOT NULL, state VARCHAR(32));
--- ALTER TABLE state CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
-
-local db = {}
-
-function db.init(db, user, pwd, host, port, table)
- local mydb = {}
-
- mydb.table = table
-
- local err
-
- mydb.env, err = luasql.mysql()
- if mydb.env == nil then
- return nil, err
- end
-
- mydb.con, err = mydb.env:connect(db, user, pwd, host, port)
- if mydb.con == nil then
- return nil, err
- end
-
- local ret, err = mydb.con:execute("SET CHARACTER SET utf8")
- if ret == nil then
- return nil, err
- end
-
- ret, err = mydb.con:setautocommit(true)
- if ret == nil then
- return nil, err
- end
-
- function mydb:getLastEntry()
- local cur, err = self.con:execute("SELECT MAX(timestamp) FROM " .. self.table)
- if cur == nil then
- return nil, err
- end
-
- local timestamp = cur:fetch()
- if timestamp == nil then timestamp = 0 end
- return timestamp
- end
-
- function mydb:findMissingEntries(lasttimestamp)
- local lastts = self.con:escape(lasttimestamp)
- return self.con:execute("SELECT * FROM " .. self.table .. " WHERE timestamp > " .. lastts)
- end
-
- function mydb:getNextMissingEntry(cur)
- local data = {}
- data = cur:fetch(data, "a")
- if data == nil then
- return nil, "that's all folks"
- end
- return data
- end
-
- function mydb:getEntry(timestamp)
- local ts = self.con:escape(timestamp)
- local cur, err = self.con:execute("SELECT * FROM " .. self.table .. " WHERE timestamp = " .. ts)
- if cur == nil then
- return nil, err
- end
-
- local data = {}
- data = cur:fetch(data, "a")
- if data == nil then
- return nil, "nothing found"
- end
- return data
- end
-
- function mydb:addEntry(data)
- local timestamp = self.con:escape(data.timestamp)
- local cart = self.con:escape(data.cart)
- local len = self.con:escape(data.len)
- local showtitle = self.con:escape(data.showtitle)
- local title = self.con:escape(data.title)
- local artist = self.con:escape(data.artist)
- local album = self.con:escape(data.album)
- local ismusic = self.con:escape(data.ismusic)
-
- local cur, err = self.con:execute("REPLACE INTO " .. self.table .. " VALUES('" .. timestamp .. "', '" .. cart .. "', '" .. len .. "', '" .. showtitle .. "', '" .. title .. "', '" .. artist .."', '" .. album .. "', '" .. ismusic .. "')")
- if cur == nil then
- return nil, err
- end
-
- return true
- end
-
- function mydb:getLastSysState()
- local cur, err = self.con:execute("SELECT state FROM " .. self.table .. " WHERE timestamp = (SELECT MAX(timestamp) FROM " .. self.table .. ")")
- if cur == nil then
- return nil, err
- end
-
- local state = cur:fetch()
- if state == nil then state = "unknown" end
- return state
- end
-
- function mydb:updateSysState(timestamp, state)
- local t = self.con:escape(timestamp)
- local s = self.con:escape(state)
-
- local cur, err = self.con:execute("INSERT INTO " .. self.table .. " VALUES('" .. t .. "', '" .. s .. "')")
- if cur == nil then
- return nil, err
- end
- return true
- end
-
- function mydb:close()
- if self.con then
- self.con:close()
- end
-
- if self.env then
- self.env:close()
- end
- end
-
- return mydb
-end
-
-return db
diff --git a/rhnop-client/debian/changelog b/rhnop-client/debian/changelog
deleted file mode 100644
index 19e9bb3..0000000
--- a/rhnop-client/debian/changelog
+++ /dev/null
@@ -1,23 +0,0 @@
-rhnop-client (0.4) UNRELEASED; urgency=low
-
- * forcing utf-8
-
- -- Christian Pointner <equinox@helsinki.at> Tue, 11 Mar 2014 16:01:08 +0100
-
-rhnop-client (0.3) unstable; urgency=low
-
- * fixed error due to new luasql library version
-
- -- Christian Pointner <equinox@helsinki.at> Wed, 05 Mar 2014 18:20:46 +0100
-
-rhnop-client (0.2) unstable; urgency=low
-
- * added nopsysstated
-
- -- Christian Pointner <equinox@helsinki> Wed, 5 Apr 2011 15:45:45 +0200
-
-rhnop-client (0.1) unstable; urgency=low
-
- * Initial release.
-
- -- Christian Pointner <equinox@helsinki> Wed, 5 Apr 2011 02:16:41 +0200
diff --git a/rhnop-client/debian/compat b/rhnop-client/debian/compat
deleted file mode 100644
index 7ed6ff8..0000000
--- a/rhnop-client/debian/compat
+++ /dev/null
@@ -1 +0,0 @@
-5
diff --git a/rhnop-client/debian/control b/rhnop-client/debian/control
deleted file mode 100644
index e34f9b5..0000000
--- a/rhnop-client/debian/control
+++ /dev/null
@@ -1,15 +0,0 @@
-Source: rhnop-client
-Section: interpreters
-Priority: optional
-Maintainer: Christian Pointner <equinox@helsinki.at>
-Build-Depends: debhelper (>= 5), liblua5.1-0-dev, lua5.1
-Standards-Version: 3.8.2
-Homepage: http://www.helsinki.at/
-
-Package: rhnop-client
-Architecture: any
-Depends: ${shlibs:Depends}, adduser, liblua5.1-socket2, liblua5.1-sql-mysql-2, lua5.1, runit
-Description: Radio Helsinki now playing information system - client
- The Radio Helsinki now playing information system gathers the
- now playing info into an mysql database for further processing.
- This package contains the client component.
diff --git a/rhnop-client/debian/copyright b/rhnop-client/debian/copyright
deleted file mode 100644
index 2ab2caa..0000000
--- a/rhnop-client/debian/copyright
+++ /dev/null
@@ -1,28 +0,0 @@
-This package was debianized by Christian Pointner <equinox@helsinki.at> on
-Fri, 30 Mar 2011 11:23:42 +0200.
-
-Upstream Author: Christian Pointner <equinox@helsinki.at>
-
-Copyright: 2011-2014 Christian Pointner
-
-License:
-
- 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 3 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 package; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-On Debian systems, the complete text of the GNU General
-Public License can be found in `/usr/share/common-licenses/GPL-3'.
-
-The Debian packaging is © 2009, Christian Pointner <equinox@helsinki.at> and
-is licensed under the GPL, see above.
diff --git a/rhnop-client/debian/postinst b/rhnop-client/debian/postinst
deleted file mode 100755
index 3ff8b35..0000000
--- a/rhnop-client/debian/postinst
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-# postinst script for rhnop-client
-
-set -e
-
-if [ "$1" = "configure" ]; then
- adduser --quiet --system --group --no-create-home --home /var/run/rhnop rhnop
- chgrp rhnop /etc/rhnop/nopcollectd.*.conf
- chgrp rhnop /etc/rhnop/nopsysstated.conf
-fi
diff --git a/rhnop-client/debian/postrm b/rhnop-client/debian/postrm
deleted file mode 100755
index eaf8334..0000000
--- a/rhnop-client/debian/postrm
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh
-# postrm script for rhnop-client
-
-set -e
-
-if [ "$1" = "purge" ] ; then
- if [ -x "$(command -v deluser)" -a -x "$(command -v delgroup)" ]; then
- deluser --quiet --system rhnop || true
- delgroup --quiet --system rhnop || true
- else
- echo "Not removing rhnop user and group: adduser package not found." >&2
- fi
-fi
diff --git a/rhnop-client/debian/rhnop-client.master.runit b/rhnop-client/debian/rhnop-client.master.runit
deleted file mode 100644
index 69d7226..0000000
--- a/rhnop-client/debian/rhnop-client.master.runit
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-set -e
-
-exec 2>&1
-exec chpst -u rhnop:rhnop /usr/bin/nopcollectd master
diff --git a/rhnop-client/debian/rhnop-client.master.runit.log b/rhnop-client/debian/rhnop-client.master.runit.log
deleted file mode 100644
index 850066a..0000000
--- a/rhnop-client/debian/rhnop-client.master.runit.log
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-set -e
-
-LOG_D="/var/log/nopcollectd.master/"
-if [ ! -d "$LOG_D" ]; then
- mkdir -p -m0750 "$LOG_D"
-fi
-chown root:adm "$LOG_D"
-exec chpst -u root:adm svlogd -tt "$LOG_D"
diff --git a/rhnop-client/debian/rhnop-client.standby.runit b/rhnop-client/debian/rhnop-client.standby.runit
deleted file mode 100644
index 01b7527..0000000
--- a/rhnop-client/debian/rhnop-client.standby.runit
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-set -e
-
-exec 2>&1
-exec chpst -u rhnop:rhnop /usr/bin/nopcollectd standby
diff --git a/rhnop-client/debian/rhnop-client.standby.runit.log b/rhnop-client/debian/rhnop-client.standby.runit.log
deleted file mode 100644
index 8223c28..0000000
--- a/rhnop-client/debian/rhnop-client.standby.runit.log
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-set -e
-
-LOG_D="/var/log/nopcollectd.standby/"
-if [ ! -d "$LOG_D" ]; then
- mkdir -p -m0750 "$LOG_D"
-fi
-chown root:adm "$LOG_D"
-exec chpst -u root:adm svlogd -tt "$LOG_D"
diff --git a/rhnop-client/debian/rhnop-client.state.runit b/rhnop-client/debian/rhnop-client.state.runit
deleted file mode 100644
index f044abf..0000000
--- a/rhnop-client/debian/rhnop-client.state.runit
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-set -e
-
-exec 2>&1
-exec chpst -u rhnop:rhnop /usr/bin/nopsysstated
diff --git a/rhnop-client/debian/rhnop-client.state.runit.log b/rhnop-client/debian/rhnop-client.state.runit.log
deleted file mode 100644
index 7a67bb3..0000000
--- a/rhnop-client/debian/rhnop-client.state.runit.log
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-set -e
-
-LOG_D="/var/log/nopsysstated/"
-if [ ! -d "$LOG_D" ]; then
- mkdir -p -m0750 "$LOG_D"
-fi
-chown root:adm "$LOG_D"
-exec chpst -u root:adm svlogd -tt "$LOG_D"
diff --git a/rhnop-client/debian/rules b/rhnop-client/debian/rules
deleted file mode 100755
index ef73f66..0000000
--- a/rhnop-client/debian/rules
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/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.
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-configure: configure-stamp
-configure-stamp:
- dh_testdir
- ./configure --prefix=/usr --sysconfdir=/etc
- touch configure-stamp
-
-build: build-stamp
-
-build-stamp: configure-stamp
- dh_testdir
- $(MAKE)
- touch $@
-
-clean:
- dh_testdir
- dh_testroot
- rm -f build-stamp configure-stamp
- $(MAKE) distclean
- dh_clean
-
-install: build
- dh_testdir
- dh_testroot
- dh_installdirs
- $(MAKE) DESTDIR=$(CURDIR)/debian/rhnop-client install
- mkdir -p $(CURDIR)/debian/rhnop-client/etc/sv/rhnop-client.master/log
- ln -s /var/run/sv.rhnop-client.master/ $(CURDIR)/debian/rhnop-client/etc/sv/rhnop-client.master/supervise
- cp $(CURDIR)/debian/rhnop-client.master.runit $(CURDIR)/debian/rhnop-client/etc/sv/rhnop-client.master/run
- ln -s /var/run/sv.rhnop-client.master.log/ $(CURDIR)/debian/rhnop-client/etc/sv/rhnop-client.master/log/supervise
- cp $(CURDIR)/debian/rhnop-client.master.runit.log $(CURDIR)/debian/rhnop-client/etc/sv/rhnop-client.master/log/run
- mkdir -p $(CURDIR)/debian/rhnop-client/etc/sv/rhnop-client.standby/log
- ln -s /var/run/sv.rhnop-client.standby/ $(CURDIR)/debian/rhnop-client/etc/sv/rhnop-client.standby/supervise
- cp $(CURDIR)/debian/rhnop-client.standby.runit $(CURDIR)/debian/rhnop-client/etc/sv/rhnop-client.standby/run
- ln -s /var/run/sv.rhnop-client.standby.log/ $(CURDIR)/debian/rhnop-client/etc/sv/rhnop-client.standby/log/supervise
- cp $(CURDIR)/debian/rhnop-client.standby.runit.log $(CURDIR)/debian/rhnop-client/etc/sv/rhnop-client.standby/log/run
- mkdir -p $(CURDIR)/debian/rhnop-client/etc/sv/rhnop-client.state/log
- ln -s /var/run/sv.rhnop-client.state/ $(CURDIR)/debian/rhnop-client/etc/sv/rhnop-client.state/supervise
- cp $(CURDIR)/debian/rhnop-client.state.runit $(CURDIR)/debian/rhnop-client/etc/sv/rhnop-client.state/run
- ln -s /var/run/sv.rhnop-client.state.log/ $(CURDIR)/debian/rhnop-client/etc/sv/rhnop-client.state/log/supervise
- cp $(CURDIR)/debian/rhnop-client.state.runit.log $(CURDIR)/debian/rhnop-client/etc/sv/rhnop-client.state/log/run
-
-# Build architecture-independent files here.
-binary-indep: install
-# We have nothing to do by default.
-
-# Build architecture-dependent files here.
-binary-arch: install
- dh_testdir
- dh_testroot
- dh_installdocs
- dh_installchangelogs
- dh_installexamples
- dh_link
- dh_strip
- dh_compress
- dh_fixperms
- chmod 640 debian/rhnop-client/etc/rhnop/nopcollectd.*.conf
- chmod 640 debian/rhnop-client/etc/rhnop/nopsysstated.conf
- chmod 755 debian/rhnop-client/etc/sv/rhnop-client.master/run
- chmod 755 debian/rhnop-client/etc/sv/rhnop-client.master/log/run
- chmod 755 debian/rhnop-client/etc/sv/rhnop-client.standby/run
- chmod 755 debian/rhnop-client/etc/sv/rhnop-client.standby/log/run
- chmod 755 debian/rhnop-client/etc/sv/rhnop-client.state/run
- chmod 755 debian/rhnop-client/etc/sv/rhnop-client.state/log/run
- dh_installdeb
- dh_shlibdeps
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/rhnop-client/nopcollectd b/rhnop-client/nopcollectd
deleted file mode 100755
index 0f7c66e..0000000
--- a/rhnop-client/nopcollectd
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/usr/bin/lua
---
--- rhnop
---
--- Copyright (C) 2011-2014 Christian Pointner <equinox@helsinki.at>
---
--- This file is part of rhnop.
---
--- rhnop 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 3 of the License, or
--- any later version.
---
--- rhnop 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 rhnop. If not, see <http://www.gnu.org/licenses/>.
---
---
--- send now and next cart# and length to nopsyncd
--- this script should be called by the now/next macro cart
--- the arguments should be: now# nowlen next# nextlen
---
-
-require "socket"
-
-package.path = package.path .. ";_rhnoplibdir_/?.lua"
-db = require "db"
-
-if #arg < 1 then
- io.stderr:write("too few parameters\n")
- os.exit(1)
-end
-
-conffile = "nopcollectd." .. arg[1] .. ".conf"
-conf = require "conf"
-
-src_db = assert(db.init(conf.src_db, conf.src_user, conf.src_pwd, conf.src_host, conf.src_port, conf.src_table))
-dst_db = assert(db.init(conf.dst_db, conf.dst_user, conf.dst_pwd, conf.dst_host, conf.dst_port, conf.dst_table))
-
-local sock = assert(socket.tcp())
-local ret, err = sock:connect(conf.sync_host, conf.sync_port)
-if ret == nil then
- print(err)
- return 1
-end
-print "connection established"
-
-local last = dst_db:getLastEntry()
-print("last timestamp was " .. last)
-local cur = assert(src_db:findMissingEntries(last))
-local cnt = 0
-while true do
- local data = src_db:getNextMissingEntry(cur)
- if data == nil then break end
- local ret, err = dst_db:addEntry(data)
- if ret == nil then print(err) end
- cnt = cnt + 1
-end
-
-print("synced " .. cnt .. " Entries")
-
-while true do
- local timestamp = sock:receive('*l')
- if timestamp == nil then break end
- data = assert(src_db:getEntry(timestamp))
- assert(dst_db:addEntry(data))
-end
-
-sock:close()
-
-return 0
diff --git a/rhnop-client/nopcollectd.master.conf b/rhnop-client/nopcollectd.master.conf
deleted file mode 100644
index 5d61551..0000000
--- a/rhnop-client/nopcollectd.master.conf
+++ /dev/null
@@ -1,16 +0,0 @@
-sync_host=airplay.helsinki.at
-sync_port=2345
-
-src_db=rhnop
-src_table=now
-src_host=airplay.helsinki.at
-#src_port=3306
-src_user=nopcollectd
-src_pwd=123456
-
-dst_db=nop
-dst_table=master
-dst_host=127.0.0.1
-#dst_port=3306
-dst_user=nopcollectd
-dst_pwd=123456
diff --git a/rhnop-client/nopcollectd.standby.conf b/rhnop-client/nopcollectd.standby.conf
deleted file mode 100644
index 92ba1aa..0000000
--- a/rhnop-client/nopcollectd.standby.conf
+++ /dev/null
@@ -1,16 +0,0 @@
-sync_host=airplay2.helsinki.at
-sync_port=2345
-
-src_db=rhnop
-src_table=now
-src_host=airplay2.helsinki.at
-#src_port=3306
-src_user=nopcollectd
-src_pwd=123456
-
-dst_db=nop
-dst_table=standby
-dst_host=127.0.0.1
-#dst_port=3306
-dst_user=nopcollectd
-dst_pwd=123456
diff --git a/rhnop-client/nopsysstated b/rhnop-client/nopsysstated
deleted file mode 100755
index d303cbe..0000000
--- a/rhnop-client/nopsysstated
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/usr/bin/lua
---
--- rhnop
---
--- Copyright (C) 2011-2014 Christian Pointner <equinox@helsinki.at>
---
--- This file is part of rhnop.
---
--- rhnop 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 3 of the License, or
--- any later version.
---
--- rhnop 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 rhnop. If not, see <http://www.gnu.org/licenses/>.
---
---
--- send now and next cart# and length to nopsyncd
--- this script should be called by the now/next macro cart
--- the arguments should be: now# nowlen next# nextlen
---
-
-require "socket"
-
-package.path = package.path .. ";_rhnoplibdir_/?.lua"
-db = require "db"
-
-conffile = "nopsysstated.conf"
-conf = require "conf"
-
-db = assert(db.init(conf.db_db, conf.db_user, conf.db_pwd, conf.db_host, conf.db_port, conf.db_table))
-
-local sock = assert(socket.tcp())
-local ret, err = sock:connect(conf.host, conf.port)
-if ret == nil then
- print(err)
- return 1
-end
-print "connection established"
-
-local current_state, err = db:getLastSysState()
-if current_state == nil then
- print(err)
- return 1
-end
-print("current state according to db is " .. current_state)
-
-while true do
- local state = sock:receive('*l')
- if state == nil then break end
- if state ~= current_state then
- -- reading timestamp (milliseconds since epoch)
- local p = assert(io.popen("/bin/date --utc '+%s %N'" , 'r'))
- local time = assert(p:read('*l'))
- p:close()
- local s, ns = assert(string.match(time, "([0-9]+) ([0-9]+)"))
- local timestamp = s .. string.format("%06d", math.floor(ns/1000))
-
- assert(db:updateSysState(timestamp, state))
- current_state = state
- end
-end
-
-sock:close()
-
-return 0
diff --git a/rhnop-client/nopsysstated.conf b/rhnop-client/nopsysstated.conf
deleted file mode 100644
index b9892c8..0000000
--- a/rhnop-client/nopsysstated.conf
+++ /dev/null
@@ -1,9 +0,0 @@
-host=rhctl.helsinki.at
-port=2345
-
-db_db=nop
-db_table=state
-db_host=127.0.0.1
-#db_port=3306
-db_user=nopsysstated
-db_pwd=123456