Perl: Add Net ISP load balancer

Perl Net-ISP-Balance can be used for ISP Internet connection
load balancing [0], it depends on Net-Netmask module.

[0]: https://lstein.github.io/Net-ISP-Balance/

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
This commit is contained in:
Vincent Li
2025-05-16 20:03:36 -07:00
parent a43dcad754
commit 01b6865f4b
5 changed files with 214 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
etc/balance
etc/balance.conf
etc/balance/firewall
etc/balance/firewall/01.accept
etc/balance/firewall/01.accept.pl
etc/balance/firewall/02.forward.pl
etc/balance/lsm
etc/balance/lsm/balancer_event_script
etc/balance/lsm/default_script
etc/balance/post-run
etc/balance/post-run/post-run-script.pl
etc/balance/pre-run
etc/balance/pre-run/pre-run-script.pl
etc/balance/routes
etc/balance/routes/01.local_routes
etc/balance/routes/02.local_routes.pl
etc/load_balance.pl
usr/bin/foolsm
usr/bin/load_balance.pl
usr/lib/perl5/site_perl/5.36.0/Net/ISP
usr/lib/perl5/site_perl/5.36.0/Net/ISP/Balance
usr/lib/perl5/site_perl/5.36.0/Net/ISP/Balance.pm
usr/lib/perl5/site_perl/5.36.0/Net/ISP/Balance/ConfigData.pm
#usr/lib/perl5/site_perl/5.36.0/x86_64-linux-thread-multi/auto/Net/ISP
#usr/lib/perl5/site_perl/5.36.0/x86_64-linux-thread-multi/auto/Net/ISP/Balance
#usr/lib/perl5/site_perl/5.36.0/x86_64-linux-thread-multi/auto/Net/ISP/Balance/.packlist
#usr/share/man/man1/load_balance.pl.1
#usr/share/man/man3/Net::ISP::Balance.3
#usr/share/man/man3/Net::ISP::Balance::ConfigData.3
var/lib/foolsm

View File

@@ -0,0 +1,5 @@
usr/lib/perl5/site_perl/5.36.0/Net/Netmask.pm
#usr/lib/perl5/site_perl/5.36.0/Net/Netmask.pod
#usr/lib/perl5/site_perl/5.36.0/x86_64-linux-thread-multi/auto/Net/Netmask
#usr/lib/perl5/site_perl/5.36.0/x86_64-linux-thread-multi/auto/Net/Netmask/.packlist
#usr/share/man/man3/Net::Netmask.3

89
lfs/perl-Net-ISP-Balance Normal file
View File

@@ -0,0 +1,89 @@
###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2007-2019 IPFire Team <info@ipfire.org> #
# #
# 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
SUMMARY = Perl Net ISP balance for ISP Internet connection balancing
VER = 1.31
THISAPP = Net-ISP-Balance-$(VER)
DL_FILE = ${THISAPP}.tar.gz
DL_FROM = $(URL_IPFIRE)
DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
PROG = perl-Net-ISP-Balance
DEPS =
PAK_VER = 4
SERVICES =
###############################################################################
# Top-level Rules
###############################################################################
objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
$(DL_FILE)_BLAKE2 = 7ec08866f4dcb1f09babffd75fce9c03e88298e9389ed4b78641aed5c7ec408a97da95e55921b1c3c589266426f02e8be0e5a89cc6a6228e393b722d977bcc08
install : $(TARGET)
check : $(patsubst %,$(DIR_CHK)/%,$(objects))
download :$(patsubst %,$(DIR_DL)/%,$(objects))
b2 : $(subst %,%_BLAKE2,$(objects))
dist:
@$(PAK)
###############################################################################
# Downloading, checking, b2sum
###############################################################################
$(patsubst %,$(DIR_CHK)/%,$(objects)) :
@$(CHECK)
$(patsubst %,$(DIR_DL)/%,$(objects)) :
@$(LOAD)
$(subst %,%_BLAKE2,$(objects)) :
@$(B2SUM)
###############################################################################
# Installation Details
###############################################################################
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
cd $(DIR_APP) && perl Build.PL
cd $(DIR_APP) && ./Build installdeps
cd $(DIR_APP) && ./Build test
cd $(DIR_APP) && ./Build install
@rm -rf $(DIR_APP)
@$(POSTBUILD)

88
lfs/perl-Net-Netmask Normal file
View File

@@ -0,0 +1,88 @@
###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2007-2019 IPFire Team <info@ipfire.org> #
# #
# 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
SUMMARY = Perl Net Netmask module
VER = 2.0002
THISAPP = Net-Netmask-$(VER)
DL_FILE = ${THISAPP}.tar.gz
DL_FROM = $(URL_IPFIRE)
DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
PROG = perl-Net-Netmask
DEPS =
PAK_VER = 4
SERVICES =
###############################################################################
# Top-level Rules
###############################################################################
objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
$(DL_FILE)_BLAKE2 = e0237b184d0adbab3a66852052dfaace317b9c9751b85967735ca38ed44dd17f93126af7b0c2e3b0b146ef3a7aea9da4d2518bbd142fda45b48404bdef1e7655
install : $(TARGET)
check : $(patsubst %,$(DIR_CHK)/%,$(objects))
download :$(patsubst %,$(DIR_DL)/%,$(objects))
b2 : $(subst %,%_BLAKE2,$(objects))
dist:
@$(PAK)
###############################################################################
# Downloading, checking, b2sum
###############################################################################
$(patsubst %,$(DIR_CHK)/%,$(objects)) :
@$(CHECK)
$(patsubst %,$(DIR_DL)/%,$(objects)) :
@$(LOAD)
$(subst %,%_BLAKE2,$(objects)) :
@$(B2SUM)
###############################################################################
# Installation Details
###############################################################################
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
cd $(DIR_APP) && perl Makefile.PL
cd $(DIR_APP) && make
cd $(DIR_APP) && make install
@rm -rf $(DIR_APP)
@$(POSTBUILD)

View File

@@ -2082,6 +2082,8 @@ build_system() {
lfsmake2 perl-Imager-QRCode
lfsmake2 perl-MIME-Base32
lfsmake2 perl-URI-Encode
lfsmake2 perl-Net-Netmask
lfsmake2 perl-Net-ISP-Balance
lfsmake2 rsnapshot
lfsmake2 mympd
lfsmake2 wsdd