Files
bpfire/lfs/collectd
Vincent Li 8a0ca16bae Loongarch64: initial change for tool chain build
1. add loongarch64 in make.sh

2. updated many source tar balls with config.guss
   and config.sub with loongarch64 support

3. remove rust and surricata for now

4. workaround binary env dynamic linker missing
   by symbolic link tools_loongarch64/lib to lib64
   when ./make.sh build

   cd build_loongarch64; ln -s tools_loongarch64/lib lib64

./make.sh toolchain to build tool chain
./make clean to start fresh
./make.sh gettoolchain to extract tool chaina from cache
./make.sh build to build software and image

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-12-15 09:09:28 -08:00

143 lines
7.9 KiB
Plaintext

###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2007-2024 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
PKG_NAME = collectd
VER = 4.10.9
THISAPP = collectd-$(VER)
DL_FILE = $(THISAPP).tar.bz2
DL_FROM = $(URL_IPFIRE)
DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
PROG = collectd
DEPS =
CFLAGS += \
-fcommon \
-Wno-error=deprecated-declarations \
-Wno-error=implicit-function-declaration \
-Wno-error=incompatible-pointer-types
###############################################################################
# Top-level Rules
###############################################################################
objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
$(DL_FILE)_BLAKE2 = f169a5eda3cfbe9c6c4c2e043e3c4741dc03d913b4dd2e98da8149ade8ba4bcec8adfd1667cbe4c2b45417b99f9e30b8b1526090bec4571202c49d27d38d249c
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 jxf $(DIR_DL)/$(DL_FILE)
$(UPDATE_AUTOMAKE)
cd $(DIR_APP) && find . -name "Makefile.*" | xargs sed -e "s/-Werror//g" -i
cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0001-src-utils_mount.h-Add-stdio.h.patch
cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0002-Don-t-notify-continuously-when-MySQL-slave-SQL-threa.patch
cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0003-curl_xml.c-avoid-using-uninitalized-variable-in-erro.patch
cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0004-interface.c-FreeBSD-10-support.patch
cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0005-Revert-curl_xml.c-avoid-using-uninitalized-variable-.patch
cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0006-network-set_thread_cbs-so-we-initialize-the-right-th.patch
cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0007-apache-plugin-Call-curl_global_init-from-the-init-fu.patch
cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0008-network-comment-libgcrypt-initalization-process.patch
cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0009-Call-curl_global_init-in-_init-of-plugins-using-curl.patch
cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0010-indent-wh_init-to-be-consistent-with-the-rest-of-the.patch
cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0011-Configparser-when-we-alocate-an-empty-list-we-also-n.patch
cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0012-don-t-assume-pkg-config-is-in-PATH.patch
cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0013-add-missing-backticks-which-broke-the-build.patch
cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0014-snmp-free-snmp_pdu-struct-allocated-by-snmp_pdu_crea.patch
cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0015-curl_xml-plugin-Fixed-tautological-pointer-compariso.patch
cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0016-Add-support-for-OpenVPN-2.3.0-status-files.patch
cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0017-openvpn-plugin-Don-t-signal-an-error-when-no-clients.patch
cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0018-openvpn-Remove-boguous-file-handler-check.patch
cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0019-openvpn-Ignore-not-fully-established-connections.patch
cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0020-openvpn-Make-read-functions-robust-like-in-8516f9abb.patch
cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0021-openvpn-Fix-copy-and-paste-error.patch
cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0022-openvpn-Change-data-type-from-COUNTER-to-DERIVE.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/collectd/collectd-4.10.9-cpufreq_skip_disabled_cores.patch
cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/silence-openvpn-errors.patch
cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd-4.10.9-xfs-compile-fix.patch
cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd-4.10-libiptc-build-fixes.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/collectd-4.10.9-remove-checks-for-SENSORS_API_VERSION-upper-limit.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/collectd-4.10-drop-linux-disk-module.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/collectd-4.10.9-fix-glibc-headers.patch
cd $(DIR_APP) && autoupdate -v configure.in
cd $(DIR_APP) && autoreconf -vfi
cd $(DIR_APP)/libltdl && autoreconf -vfi
cd $(DIR_APP) && ./configure --prefix=/usr --localstatedir=/var \
--disable-{apple_sensors,csv,ipvs,mbmon,memcached,mysql} \
--disable-{netlink,nginx,nut,perl,serial,snmp,tape,vserver,xmms} \
--disable-{perl,serial,snmp,tape,vserver,xmms} \
--enable-{apcups,battery,cpu{,freq},df,disk,dns,email,entropy,exec,hddtemp} \
--enable-{interface,iptables,irq,load,logfile,memory,multimeter} \
--enable-{network,nfs,ntpd,ping,processes,rrdtool,sensors,swap,syslog} \
--enable-{tcpconns,unixsock,users,wireless} \
--with-librrd=/usr/share/rrdtool-1.2.30 \
--with-fp-layout=nothing
cd $(DIR_APP) && make install #collectd-4 does not support parallel build
mkdir /etc/collectd.d
echo "# Put custom configfiles in this folder" > /etc/collectd.d/info
cp -vf $(DIR_SRC)/config/collectd/collectd.* /etc/
mv /etc/collectd.vpn /var/ipfire/ovpn/collectd.vpn
chown nobody.nobody /var/ipfire/ovpn/collectd.vpn
ln -f -s ../var/ipfire/ovpn/collectd.vpn /etc/collectd.vpn
ln -f -s ../init.d/collectd /etc/rc.d/rc0.d/K50collectd
ln -f -s ../init.d/collectd /etc/rc.d/rc3.d/S29collectd
ln -f -s ../init.d/collectd /etc/rc.d/rc6.d/K50collectd
@rm -rf $(DIR_APP)
@$(POSTBUILD)