From ddcd60f7dc3853f9087659cc2dcb70be8be62a99 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 9 Jan 2018 14:03:39 +0000 Subject: [PATCH] mdns-repeater: New package Signed-off-by: Michael Tremer --- lfs/mdns-repeater | 89 ++++++++++++++++++++++++++ make.sh | 1 + src/initscripts/packages/mdns-repeater | 48 ++++++++++++++ src/paks/mdns-repeater/install.sh | 37 +++++++++++ src/paks/mdns-repeater/uninstall.sh | 32 +++++++++ src/paks/mdns-repeater/update.sh | 27 ++++++++ 6 files changed, 234 insertions(+) create mode 100644 lfs/mdns-repeater create mode 100644 src/initscripts/packages/mdns-repeater create mode 100644 src/paks/mdns-repeater/install.sh create mode 100644 src/paks/mdns-repeater/uninstall.sh create mode 100644 src/paks/mdns-repeater/update.sh diff --git a/lfs/mdns-repeater b/lfs/mdns-repeater new file mode 100644 index 0000000000..4b3d3a7849 --- /dev/null +++ b/lfs/mdns-repeater @@ -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 . # +# # +############################################################################### + +############################################################################### +# 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 213ecd4f61..690a611f0f 100755 --- 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 index 0000000000..49717a1a19 --- /dev/null +++ b/src/initscripts/packages/mdns-repeater @@ -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 index 0000000000..233f6a88e9 --- /dev/null +++ b/src/paks/mdns-repeater/install.sh @@ -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 . # +# # +############################################################################ +# +. /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 index 0000000000..91e77623c9 --- /dev/null +++ b/src/paks/mdns-repeater/uninstall.sh @@ -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 . # +# # +############################################################################ +# +. /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 index 0000000000..c6485bf0ae --- /dev/null +++ b/src/paks/mdns-repeater/update.sh @@ -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 . # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh + +./uninstall.sh +./install.sh -- 2.39.2