Files
BMLFS/build-scripts/lm_sensors.build

80 lines
3.1 KiB
Bash

#! /bin/bash
# lm_sensors
# Source: https://github.com/lm-sensors/lm-sensors/archive/V3-6-0/lm-sensors-3-6-0.tar.gz
#
# $BUILD = Directory to temporarily install
# $PKGS = Directory to store built packages
#
# DEPS
# Required: NONE
# Recommended: NONE
# Optional: sysfsutils
# If coptimizing:
export CFLAGS="-march=native -mtune=native -pipe "
export CFLAGS+="-O3 -ffat-lto-objects -flto=4 "
export LDFLAGS="-flto=4 -Wl,-O2 -Wl,--as-needed "
sed -i -e 's:^# \(PROG_EXTRA\):\1:' Makefile && \
sed -i -e 's/\$(LIBDIR)$/\$(LIBDIR) \$(LDFLAGS)/g' Makefile && \
sed -i -e 's/\$(LIBSHSONAME) -o/$(LIBSHSONAME) \$(LDFLAGS) -o/g' \
lib/Module.mk && \
sed -i -e 's/^LIBICONV.*/LIBICONV ?=/' prog/sensors/Module.mk && \
export CFLAGS="$CFLAGS -fno-stack-protector" && \
make PREFIX=/usr BUILD_STATIC_LIB=0 \
MANDIR=/usr/share/man -j2
sudo -S make DESTDIR=$BUILD PREFIX=/usr \
BUILD_STATIC_LIB=0 \
MANDIR=/usr/share/man install && \
sudo -S install -v -m755 -d ${BUILD}/usr/share/doc/lm_sensors-3-6-0 && \
sudo -S cp -rv README INSTALL doc/* \
${BUILD}/usr/share/doc/lm_sensors-3-6-0
sudo -S mkdir -pv /BMAN/install
sudo -S mkdir -pv /BMAN/usr
sudo -S mv $BUILD/usr/share /BMAN/usr/
cd $BUILD && sudo -S mkdir -v ${BUILD}/install &&
cat > /tmp/slack-desc << "EOF"
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
lm_sensors: lm_sensors (hardware monitoring package)
lm_sensors:
lm_sensors: lm_sensors provides tools for monitoring the temperatures, voltages,
lm_sensors: and fans of Linux systems with hardware monitoring devices. Included
lm_sensors: are text-based tools for sensor reporting, and a library for sensors
lm_sensors: access called libsensors. It also contains tools for sensor hardware
lm_sensors: identification and I2C bus probing.
lm_sensors:
lm_sensors:
lm_sensors:
lm_sensors:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
sudo -S makepkg -l y -c n $PKGS/lm_sensors-3.6.0-$(uname -m)-mlfs.txz &&
cd /BMAN
cat > /tmp/slack-desc << "EOF"
lm_sensors-doc: Manuals for lm_sensors (hardware monitoring package)
lm_sensors-doc:
lm_sensors-doc: lm_sensors provides tools for monitoring the temperatures, voltages,
lm_sensors-doc: and fans of Linux systems with hardware monitoring devices. Included
lm_sensors-doc: are text-based tools for sensor reporting, and a library for sensors
lm_sensors-doc: access called libsensors. It also contains tools for sensor hardware
lm_sensors-doc: identification and I2C bus probing.
lm_sensors-doc:
lm_sensors-doc:
lm_sensors-doc:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
sudo -S makepkg -l y -c n $PKGS/lm_sensors-doc-3.6.0-noarch-mlfs.txz
sudo -S rm -rf /BMAN/*
sudo -S rm -rf ${BUILD}/*