[mosquitto/el6] * Tue Aug 12 2014 Fabian Affolter <mail at fabian-affolter.ch> - 1.3.4-1 - Upate to new upstream versio

Fabian Affolter fab at fedoraproject.org
Tue Aug 12 13:58:36 UTC 2014


commit 517c25de4c5f96f328521603ec67238a49988ef7
Author: Fabian Affolter <fabian at affolter-engineering.ch>
Date:   Tue Aug 12 15:58:33 2014 +0200

    * Tue Aug 12 2014 Fabian Affolter <mail at fabian-affolter.ch> - 1.3.4-1
    - Upate to new upstream version 1.3.4

 .gitignore     |    1 +
 mosquitto.spec |  150 ++++++++++++++++++++++++++++++++++++++++++++++----------
 sources        |    2 +-
 3 files changed, 125 insertions(+), 28 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index ea14b02..d6f55bc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,3 +7,4 @@
 /mosquitto-1.3.1.tar.gz
 /mosquitto-1.3.2.tar.gz
 /mosquitto-1.3.3.tar.gz
+/mosquitto-1.3.4.tar.gz
diff --git a/mosquitto.spec b/mosquitto.spec
index 2af0449..8a5ea60 100644
--- a/mosquitto.spec
+++ b/mosquitto.spec
@@ -1,5 +1,5 @@
 Name:           mosquitto
-Version:        1.3.3
+Version:        1.3.4
 Release:        1%{?dist}
 Summary:        An Open Source MQTT v3.1 Broker
 
@@ -9,18 +9,17 @@ Source0:        http://mosquitto.org/files/source/%{name}-%{version}.tar.gz
 
 BuildRequires:  openssl-devel
 BuildRequires:  tcp_wrappers-devel
-BuildRequires:  python2-devel
+BuildRequires:  python-devel
 BuildRequires:  python-setuptools
 BuildRequires:  systemd
 BuildRequires:  uthash-devel
 BuildRequires:  c-ares-devel
-# This will become a requirement soon
-#BuildRequires:  libwebsockets-devel
 
 Requires(pre):  shadow-utils
-Requires(post): systemd
-Requires(preun): systemd
-Requires(postun): systemd
+Requires(post): chkconfig
+Requires(preun): chkconfig
+Requires(preun): initscripts
+Requires(postun): initscripts
 
 %description
 Mosquitto is an open source (BSD licensed) message broker that implements the 
@@ -60,7 +59,7 @@ export LDFLAGS="%{optflags} %{__global_ldflags} -Wl,--as-needed"
 make all %{?_smp_mflags}
 
 pushd lib/python
-%{__python2} setup.py build
+%{__python} setup.py build
 
 %install
 %if "%{_lib}" == "lib64"
@@ -69,27 +68,116 @@ export LIB_SUFFIX=64
 %make_install
 
 pushd lib/python
-%{__python2} setup.py install --skip-build --root $RPM_BUILD_ROOT
+%{__python} setup.py install --skip-build --root %{buildroot}
 popd
 
-cat > mosquitto.service << FOE
-[Unit]
-Description=Mosquitto MQTTv3.1 Broker
-Documentation=man:mosquitto.conf(5) man:mosquitto(8)
-
-[Service]
-ExecStart=/usr/sbin/mosquitto 
-User=mosquitto
-
-[Install]
-WantedBy=multi-user.target
+cat > mosquitto.initd << FOE
+#!/bin/sh
+#
+# mosquitto - An Open Source MQTT v3.1 Broker
+#
+# chkconfig:  <default runlevel(s)> <start> <stop>
+# description:  An Open Source MQTT v3.1 Broker
+#
+### BEGIN INIT INFO
+# Provides:  Mosquitto
+# Default-Start:  2 3 4 5
+# Default-Stop:  0 1 6
+# Short-Description:  Start and stop mosquitto
+# Description:  An Open Source MQTT v3.1 Broker
+### END INIT INFO
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+exec="/usr/sbin/mosquitto"
+prog="mosquitto"
+config="/etc/mosquitto/mosquitto.conf"
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+lockfile=/var/lock/subsys/$prog
+
+start() {
+    [ -x $exec ] || exit 5
+    [ -f $config ] || exit 6
+    echo -n $"Starting $prog: "
+    # if not running, start it up here, usually something like "daemon $exec"
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && touch $lockfile
+    return $retval
+}
+
+stop() {
+    echo -n $"Stopping $prog: "
+    # stop it here, often "killproc $prog"
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && rm -f $lockfile
+    return $retval
+}
+
+restart() {
+    stop
+    start
+}
+
+reload() {
+    restart
+}
+
+force_reload() {
+    restart
+}
+
+rh_status() {
+    # run checks to determine if the service is running or use generic status
+    status $prog
+}
+
+rh_status_q() {
+    rh_status >/dev/null 2>&1
+}
+
+
+case "$1" in
+    start)
+        rh_status_q && exit 0
+        $1
+        ;;
+    stop)
+        rh_status_q || exit 0
+        $1
+        ;;
+    restart)
+        $1
+        ;;
+    reload)
+        rh_status_q || exit 7
+        $1
+        ;;
+    force-reload)
+        force_reload
+        ;;
+    status)
+        rh_status
+        ;;
+    condrestart|try-restart)
+        rh_status_q || exit 0
+        restart
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+        exit 2
+esac
+exit $?
 FOE
 
-mkdir -p $RPM_BUILD_ROOT%{_unitdir}
-install -p -m 0644 %{name}.service $RPM_BUILD_ROOT%{_unitdir}/%{name}.service
+install -p -m 0644 %{name}.init %{buildroot}%{_initrddir}/%{name}.init
 
 %check
-#make test
+make test
 
 %pre
 getent group %{name} >/dev/null || groupadd -r %{name}
@@ -99,14 +187,19 @@ getent passwd %{name} >/dev/null || \
 exit 0
 
 %post
-%systemd_post %{name}.service
+/sbin/chkconfig --add mosquitto
 /sbin/ldconfig
 
 %preun
-%systemd_preun %{name}.service
+if [ $1 -eq 0 ] ; then
+    /sbin/service mosquitto stop >/dev/null 2>&1
+    /sbin/chkconfig --del mosquitto
+fi
 
 %postun
-%systemd_postun_with_restart %{name}.service
+if [ "$1" -ge "1" ] ; then
+    /sbin/service mosquitto condrestart >/dev/null 2>&1 || :
+fi
 /sbin/ldconfig
 
 %files
@@ -114,9 +207,9 @@ exit 0
 %{_bindir}/*
 %{_sbindir}/*
 %{_libdir}/*.so.*
+%{_initrddir}/%{name}.init
 %dir %{_sysconfdir}/%{name}
 %config %{_sysconfdir}/%{name}/*.example
-%{_unitdir}/%{name}.service
 %{_mandir}/man1/*.1.*
 %{_mandir}/man5/*.5.*
 %{_mandir}/man7/*.7.*
@@ -131,6 +224,9 @@ exit 0
 %{python_sitelib}/%{name}*
 
 %changelog
+* Tue Aug 12 2014 Fabian Affolter <mail at fabian-affolter.ch> - 1.3.4-1
+- Upate to new upstream version 1.3.4
+
 * Mon Aug 11 2014 Fabian Affolter <mail at fabian-affolter.ch> - 1.3.3-1
 - Upate to new upstream version 1.3.3
 
diff --git a/sources b/sources
index de4e25c..c3b5a07 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-e4df5c814f5d640dfa77d156625946fb  mosquitto-1.3.3.tar.gz
+9d729849efd74c6e3eee17a4a002e1e9  mosquitto-1.3.4.tar.gz


More information about the scm-commits mailing list