From 3dddbfc6987e273015e7854157eb0db7c8f09be0 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Wed, 16 Jul 2008 13:55:31 +0000 Subject: [PATCH] Added tftp-hpa as a package. --- config/rootfiles/packages/tftp-hpa | 6 +++ lfs/tftp-hpa | 86 ++++++++++++++++++++++++++++++ make.sh | 1 + src/initscripts/init.d/tftpd | 45 ++++++++++++++++ src/paks/tftp-hpa/install.sh | 30 +++++++++++ src/paks/tftp-hpa/uninstall.sh | 28 ++++++++++ src/paks/tftp-hpa/update.sh | 26 +++++++++ 7 files changed, 222 insertions(+) create mode 100644 config/rootfiles/packages/tftp-hpa create mode 100644 lfs/tftp-hpa create mode 100644 src/initscripts/init.d/tftpd create mode 100644 src/paks/tftp-hpa/install.sh create mode 100644 src/paks/tftp-hpa/uninstall.sh create mode 100644 src/paks/tftp-hpa/update.sh diff --git a/config/rootfiles/packages/tftp-hpa b/config/rootfiles/packages/tftp-hpa new file mode 100644 index 0000000000..98e78d800d --- /dev/null +++ b/config/rootfiles/packages/tftp-hpa @@ -0,0 +1,6 @@ +etc/init.d/tftpd +#usr/man/man1/tftp.1 +#usr/man/man8/in.tftpd.8 +#usr/man/man8/tftpd.8 +usr/sbin/tftpd +var/tftpboot diff --git a/lfs/tftp-hpa b/lfs/tftp-hpa new file mode 100644 index 0000000000..c82747aa82 --- /dev/null +++ b/lfs/tftp-hpa @@ -0,0 +1,86 @@ +############################################################################### +# # +# 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 = 0.48 + +THISAPP = tftp-hpa-$(VER) +DL_FILE = $(THISAPP).tar.bz2 +DL_FROM = $(URL_IPFIRE) +DIR_APP = $(DIR_SRC)/$(THISAPP) +TARGET = $(DIR_INFO)/$(THISAPP) +PROG = tftp-hpa +PAK_VER = 1 + +DEPS = "" + +############################################################################### +# Top-level Rules +############################################################################### + +objects = $(DL_FILE) + +$(DL_FILE) = $(DL_FROM)/$(DL_FILE) + +$(DL_FILE)_MD5 = f2e0a1ca0c49ae46ecad26a54df3e887 + +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 jxf $(DIR_DL)/$(DL_FILE) + cd $(DIR_APP) && ./configure --prefix=/usr --without-tcpwrappers + cd $(DIR_APP) && make $(MAKETUNING) + cd $(DIR_APP) && make install + mv -fv /usr/sbin/in.tftpd /usr/sbin/tftpd + -mkdir /var/tftpboot + @rm -rf $(DIR_APP) + @$(POSTBUILD) diff --git a/make.sh b/make.sh index d777da4b37..daeb45444c 100755 --- a/make.sh +++ b/make.sh @@ -585,6 +585,7 @@ buildipfire() { ipfiremake wpa_supplicant ipfiremake hostapd ipfiremake urlgrabber + ipfiremake tftp-hpa echo Build on $HOSTNAME > $BASEDIR/build/var/ipfire/firebuild cat /proc/version >> $BASEDIR/build/var/ipfire/firebuild echo >> $BASEDIR/build/var/ipfire/firebuild diff --git a/src/initscripts/init.d/tftpd b/src/initscripts/init.d/tftpd new file mode 100644 index 0000000000..3abf00c8bc --- /dev/null +++ b/src/initscripts/init.d/tftpd @@ -0,0 +1,45 @@ +#!/bin/sh +######################################################################## +# Begin $rc_base/init.d/tftpd +# +# Description : This script controls the tftpd server +# +# Authors : Michael Tremer +# +# Version : 01.00 +# +# Notes : +# +######################################################################## + +. /etc/sysconfig/rc +. ${rc_functions} + +case "${1}" in + start) + boot_mesg "Starting tftpd-hpa Server..." + loadproc /usr/sbin/tftpd -l -s /var/tftpboot + ;; + + stop) + boot_mesg "Stopping tftpd-hpa Server..." + killproc /usr/sbin/tftpd + ;; + + restart) + ${0} stop + sleep 1 + ${0} start + ;; + + status) + statusproc /usr/sbin/tftpd + ;; + + *) + echo "Usage: ${0} {start|stop|restart|status}" + exit 1 + ;; +esac + +# End $rc_base/init.d/tftpd diff --git a/src/paks/tftp-hpa/install.sh b/src/paks/tftp-hpa/install.sh new file mode 100644 index 0000000000..6930b9062f --- /dev/null +++ b/src/paks/tftp-hpa/install.sh @@ -0,0 +1,30 @@ +#!/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} +start_service --background ${NAME} +ln -svf ../init.d/tftpd /etc/rc.d/rc0.d/K00tftpd +ln -svf ../init.d/tftpd /etc/rc.d/rc3.d/S99tftpd +ln -svf ../init.d/tftpd /etc/rc.d/rc6.d/K00tftpd diff --git a/src/paks/tftp-hpa/uninstall.sh b/src/paks/tftp-hpa/uninstall.sh new file mode 100644 index 0000000000..95e70be329 --- /dev/null +++ b/src/paks/tftp-hpa/uninstall.sh @@ -0,0 +1,28 @@ +#!/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 +rm -rf /etc/rc.d/rc*.d/*tftpd diff --git a/src/paks/tftp-hpa/update.sh b/src/paks/tftp-hpa/update.sh new file mode 100644 index 0000000000..89c40d0d7c --- /dev/null +++ b/src/paks/tftp-hpa/update.sh @@ -0,0 +1,26 @@ +#!/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