]> git.ipfire.org Git - people/arne_f/ipfire-3.x.git/commitdiff
mstpd: New package.
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 9 Nov 2011 21:31:13 +0000 (22:31 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 9 Nov 2011 21:31:13 +0000 (22:31 +0100)
mstpd/bridge-stp [new file with mode: 0644]
mstpd/mstpd.nm [new file with mode: 0644]
mstpd/systemd/mstpd.service [new file with mode: 0644]

diff --git a/mstpd/bridge-stp b/mstpd/bridge-stp
new file mode 100644 (file)
index 0000000..947c12b
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2007, 2008, 2009 Michael Tremer & Christian Schmidt           #
+#                                                                             #
+# 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 program.  If not, see <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
+#
+# This script always returns 0 to prevent the kernel
+# starting its own stp implementation.
+
+exit 0
diff --git a/mstpd/mstpd.nm b/mstpd/mstpd.nm
new file mode 100644 (file)
index 0000000..04a3876
--- /dev/null
@@ -0,0 +1,52 @@
+###############################################################################
+# IPFire.org    - An Open Source Firewall Solution                            #
+# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
+###############################################################################
+
+name       = mstpd
+version    = 0.01
+git_ver    = 0d06abf
+release    = 0.1-git%{git_ver}.1
+thisapp    = %{name}-%{version}-git%{git_ver}
+
+groups     = Networking/Tools
+url        = http://git.ipfire.org/?p=thirdparty/mstpd.git;a=summary
+license    = GPLv2+
+summary    = The Multiple Spanning Tree Protocol Daemon.
+
+description
+       A daemon that implements the Multiple Spanning Tree Protocol
+       running upon the Linux ethernet bridge.
+end
+
+build
+       prepare_cmds
+               # Please do not ship code with -Werror enabled.
+               sed -i Makefile \
+                       -e "s/-Werror//"
+       end
+
+       install_cmds
+               install -v -m 755 %{DIR_SOURCE}/bridge-stp \
+                       %{BUILDROOT}/sbin/bridge-stp
+       end
+end
+
+packages
+       package %{name}
+               script postin
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+                       /bin/systemctl --no-reload enable mstpd.service >/dev/null 2>&1 || :
+               end
+
+               script preun
+                       /bin/systemctl --no-reload disable mstpd.service >/dev/null 2>&1 || :
+                       /bin/systemctl stop rstp.service >/dev/null 2>&1 || :
+               end
+
+               script postup
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+                       /bin/systemctl try-restart mstpd.service >/dev/null 2>&1 || :
+               end
+       end
+end
diff --git a/mstpd/systemd/mstpd.service b/mstpd/systemd/mstpd.service
new file mode 100644 (file)
index 0000000..8a14d39
--- /dev/null
@@ -0,0 +1,11 @@
+[Unit]
+Description=Multiple Spanning Tree Protocol Daemon
+Before=network.service
+
+[Service]
+ExecStartPre=/sbin/modprobe net_pf_17
+ExecStart=/sbin/mstpd -d
+Restart=always
+
+[Install]
+WantedBy=multi-user.target