]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
mdns-repeater: New package
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 9 Jan 2018 14:03:39 +0000 (14:03 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 9 Jan 2018 14:14:37 +0000 (14:14 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
lfs/mdns-repeater [new file with mode: 0644]
make.sh
src/initscripts/packages/mdns-repeater [new file with mode: 0644]
src/paks/mdns-repeater/install.sh [new file with mode: 0644]
src/paks/mdns-repeater/uninstall.sh [new file with mode: 0644]
src/paks/mdns-repeater/update.sh [new file with mode: 0644]

diff --git a/lfs/mdns-repeater b/lfs/mdns-repeater
new file mode 100644 (file)
index 0000000..4b3d3a7
--- /dev/null
@@ -0,0 +1,89 @@
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2007  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/>.       #
+#                                                                             #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include Config
+
+VER        = 1.10
+
+THISAPP    = mdns-repeater-$(VER)
+DL_FILE    = $(THISAPP).tar.gz
+DL_FROM    = $(URL_IPFIRE)
+DIR_APP    = $(DIR_SRC)/$(THISAPP)
+TARGET     = $(DIR_INFO)/$(THISAPP)
+PROG       = mdns-repeater
+PAK_VER    = 1
+
+DEPS       = ""
+
+CFLAGS    += -DHGVERSION='\"$(VER)\"'
+
+###############################################################################
+# Top-level Rules
+###############################################################################
+
+objects = $(DL_FILE)
+
+$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
+
+$(DL_FILE)_MD5 = 6dba5f891b50c2267f45a7760894fcb6
+
+install : $(TARGET)
+
+check : $(patsubst %,$(DIR_CHK)/%,$(objects))
+
+download :$(patsubst %,$(DIR_DL)/%,$(objects))
+
+md5 : $(subst %,%_MD5,$(objects))
+
+dist: 
+       @$(PAK)
+
+###############################################################################
+# Downloading, checking, md5sum
+###############################################################################
+
+$(patsubst %,$(DIR_CHK)/%,$(objects)) :
+       @$(CHECK)
+
+$(patsubst %,$(DIR_DL)/%,$(objects)) :
+       @$(LOAD)
+
+$(subst %,%_MD5,$(objects)) :
+       @$(MD5)
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
+       @$(PREBUILD)
+       @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
+       cd $(DIR_APP) && make $(MAKETUNING) CFLAGS="$(CFLAGS)"
+       cd $(DIR_APP) && install -v -m 755 mdns-repeater /usr/bin
+
+       # install initscripts
+       $(call INSTALL_INITSCRIPT,mdns-repeater)
+
+       @rm -rf $(DIR_APP)
+       @$(POSTBUILD)
diff --git a/make.sh b/make.sh
index 213ecd4f61abf461d25a35aa61dacfea7f78b09d..690a611f0f1c895798c966ceb896202c06c120d7 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -1516,6 +1516,7 @@ buildipfire() {
   lfsmake2 perl-Net-IP
   lfsmake2 wio
   lfsmake2 iftop
+  lfsmake2 mdns-repeater
 }
 
 buildinstaller() {
diff --git a/src/initscripts/packages/mdns-repeater b/src/initscripts/packages/mdns-repeater
new file mode 100644 (file)
index 0000000..49717a1
--- /dev/null
@@ -0,0 +1,48 @@
+#!/bin/sh
+########################################################################
+# Begin $rc_base/init.d/mdns-repeater
+########################################################################
+
+. /etc/sysconfig/rc
+. ${rc_functions}
+
+eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings)
+
+INTERFACES=
+
+if [ -n "${GREEN_DEV}" ]; then
+       INTERFACES="${INTERFACES} ${GREEN_DEV}"
+fi
+
+if [ -n "${BLUE_DEV}" ]; then
+       INTERFACES="${INTERFACES} ${BLUE_DEV}"
+fi
+
+case "${1}" in
+       start)
+               boot_mesg "Starting Multicast DNS Repeater..."
+               loadproc /usr/bin/mdns-repeater ${INTERFACES}
+               ;;
+
+       stop)
+               boot_mesg "Stopping Multicast DNS Repeater..."
+               killproc /usr/bin/mdns-repeater
+               ;;
+
+       restart)
+               ${0} stop
+               sleep 1
+               ${0} start
+               ;;
+
+       status)
+               statusproc /usr/bin/mdns-repeater
+               ;;
+
+       *)
+               echo "Usage: ${0} {start|stop|restart|status}"
+               exit 1
+               ;;
+esac
+
+# End $rc_base/init.d/mdns-repeater
diff --git a/src/paks/mdns-repeater/install.sh b/src/paks/mdns-repeater/install.sh
new file mode 100644 (file)
index 0000000..233f6a8
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/bash
+############################################################################
+#                                                                          #
+# This file is part of the IPFire Firewall.                                #
+#                                                                          #
+# IPFire 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 2 of the License, or        #
+# (at your option) any later version.                                      #
+#                                                                          #
+# IPFire 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 IPFire; if not, write to the Free Software                    #
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA #
+#                                                                          #
+# Copyright (C) 2007 IPFire-Team <info@ipfire.org>.                        #
+#                                                                          #
+############################################################################
+#
+. /opt/pakfire/lib/functions.sh
+
+extract_files
+restore_backup ${NAME}
+
+# create startlinks
+ln -sf ../init.d/mdns-repeater /etc/rc.d/rc0.d/K20mdns-repeater
+ln -sf ../init.d/mdns-repeater /etc/rc.d/rc3.d/S99mdns-repeater
+ln -sf ../init.d/mdns-repeater /etc/rc.d/rc6.d/K20mdns-repeater
+
+# Start the service.
+start_service --background ${NAME}
+
+exit 0
diff --git a/src/paks/mdns-repeater/uninstall.sh b/src/paks/mdns-repeater/uninstall.sh
new file mode 100644 (file)
index 0000000..91e7762
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/bash
+############################################################################
+#                                                                          #
+# This file is part of the IPFire Firewall.                                #
+#                                                                          #
+# IPFire 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 2 of the License, or        #
+# (at your option) any later version.                                      #
+#                                                                          #
+# IPFire 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 IPFire; if not, write to the Free Software                    #
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA #
+#                                                                          #
+# Copyright (C) 2007 IPFire-Team <info@ipfire.org>.                        #
+#                                                                          #
+############################################################################
+#
+. /opt/pakfire/lib/functions.sh
+stop_service ${NAME}
+make_backup ${NAME}
+remove_files
+
+# Remove all start links.
+rm -rf /etc/rc.d/rc*.d/*mdns-repeater
+
+exit 0
diff --git a/src/paks/mdns-repeater/update.sh b/src/paks/mdns-repeater/update.sh
new file mode 100644 (file)
index 0000000..c6485bf
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/bash
+############################################################################
+#                                                                          #
+# This file is part of the IPFire Firewall.                                #
+#                                                                          #
+# IPFire 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 2 of the License, or        #
+# (at your option) any later version.                                      #
+#                                                                          #
+# IPFire 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 IPFire; if not, write to the Free Software                    #
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA #
+#                                                                          #
+# Copyright (C) 2007 IPFire-Team <info@ipfire.org>.                        #
+#                                                                          #
+############################################################################
+#
+. /opt/pakfire/lib/functions.sh
+
+./uninstall.sh
+./install.sh