###############################################################################
name = collecty
-version = 0.0.2
+version = 002
release = 1
maintainer = Michael Tremer <michael.tremer@ipfire.org>
build
requires
- gettext
+ autoconf
+ automake
+ docbook-utils
+ docbook-xsl
+ gettext-devel
+ intltool
+ libtool-devel
+ libxslt
python
+ systemd-devel
end
- install
- mkdir -pv %{BUILDROOT}%{bindir}
- make install DESTDIR=%{BUILDROOT}
+ prepare_cmds
+ [ -e "configure" ] || ./autogen.sh
end
end
packages
package %{name}
groups += Base
+
+ requires
+ pygobject2
+ python-dbus
+ python-rrdtool
+ end
+
+ script postin
+ systemctl daemon-reload >/dev/null 2>&1 || :
+
+ # The collecty service should be started on default.
+ systemctl enable collecty.service > /dev/null 2>&1 || :
+ end
+
+ # Disable the service that is to be removed and stop it if it is still running.
+ script preun
+ systemctl --no-reload disable collecty.service >/dev/null 2>&1 || :
+ systemctl stop collecty.service >/dev/null 2>&1 || :
+ end
+
+ # Just tell systemd that unitfiles have been removed.
+ script postun
+ systemctl daemon-reload >/dev/null 2>&1 || :
+ end
+
+ # Try to restart the service if it is running.
+ script postup
+ systemctl daemon-reload >/dev/null 2>&1 || :
+ systemctl try-restart collecty.service >/dev/null 2>&1 || :
+ end
end
end
+++ /dev/null
-From 82c136f87bb13aea4f27b669ee98ff7e798ad8b3 Mon Sep 17 00:00:00 2001
-From: Michael Tremer <michael.tremer@ipfire.org>
-Date: Sat, 1 Sep 2012 18:56:19 +0000
-Subject: [PATCH] Install daemon to /usr/sbin.
-
----
- Makefile | 5 ++++-
- collecty.service | 2 +-
- 2 files changed, 5 insertions(+), 2 deletions(-)
-
-diff --git a/Makefile b/Makefile
-index 7d679af..6fcc787 100644
---- a/Makefile
-+++ b/Makefile
-@@ -24,6 +24,7 @@ PACKAGE_VERSION = 0.0.2
- DESTDIR =
- PREFIX = /usr
- BINDIR = $(PREFIX)/bin
-+SBINDIR = $(PREFIX)/sbin
- LOCALEDIR = $(PREFIX)/share/locale
- UNITDIR = $(PREFIX)/lib/systemd/system
-
-@@ -55,7 +56,9 @@ dist:
- install: $(MO_FILES)
- -mkdir -pv $(PYTHON_DIR)
- cp -rvf collecty $(PYTHON_DIR)
-- install -v -m 755 collectyd $(DESTDIR)$(BINDIR)
-+
-+ -mkdir -pv $(DESTDIR)$(SBINDIR)
-+ install -v -m 755 collectyd $(DESTDIR)$(SBINDIR)
-
- # Install configuration
- -mkdir -pv $(DESTDIR)/etc/$(PACKAGE_NAME)
-diff --git a/collecty.service b/collecty.service
-index ac4a893..78bd26e 100644
---- a/collecty.service
-+++ b/collecty.service
-@@ -2,7 +2,7 @@
- Description=collecty - A system data collecting daemon
-
- [Service]
--ExecStart=/usr/bin/collectyd
-+ExecStart=/usr/sbin/collectyd
- ExecReload=/bin/kill -HUP $MAINPID
-
- [Install]
---
-1.7.8.2
-