]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
collecty: Update to version 002
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 27 May 2015 12:59:40 +0000 (12:59 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 27 May 2015 12:59:40 +0000 (12:59 +0000)
collecty/collecty.nm
collecty/patches/0001-Install-daemon-to-usr-sbin.patch [deleted file]

index deb7fb4de12ff775e7e4ecb61ec3f6dde28197ec..9c46accebf4a217cab30dbf4fb645c2606a23f7c 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = collecty
-version    = 0.0.2
+version    = 002
 release    = 1
 
 maintainer = Michael Tremer <michael.tremer@ipfire.org>
@@ -23,18 +23,55 @@ source_dl  = http://source.ipfire.org/releases/collecty/
 
 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
diff --git a/collecty/patches/0001-Install-daemon-to-usr-sbin.patch b/collecty/patches/0001-Install-daemon-to-usr-sbin.patch
deleted file mode 100644 (file)
index cc5cac2..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-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
-