From 31723b3943baa14269be93abcb03e1ffe44a3407 Mon Sep 17 00:00:00 2001 From: davidovski Date: Sun, 6 Feb 2022 14:15:05 +0000 Subject: adde a few extra utilities --- repo/system/dhcp.xibuild | 73 ++++++++++++++++++++++++++++++++++++++ repo/system/libusb.xibuild | 17 +++++++++ repo/system/networkmanager.xibuild | 2 +- repo/util/acpi.xibuild | 29 +++++++++++++++ repo/util/lynx.xibuild | 32 +++++++++++++++++ repo/util/pciutils.xibuild | 31 ++++++++++++++++ repo/util/pm-utils.xibuild | 20 +++++++++++ repo/util/sudo.xibuild | 49 +++++++++++++++++++++++++ repo/util/usbutils.xibuild | 21 +++++++++++ repo/util/wget.xibuild | 19 ++++++++++ 10 files changed, 292 insertions(+), 1 deletion(-) create mode 100644 repo/system/dhcp.xibuild create mode 100644 repo/system/libusb.xibuild create mode 100644 repo/util/acpi.xibuild create mode 100644 repo/util/lynx.xibuild create mode 100644 repo/util/pciutils.xibuild create mode 100644 repo/util/pm-utils.xibuild create mode 100644 repo/util/sudo.xibuild create mode 100644 repo/util/usbutils.xibuild create mode 100644 repo/util/wget.xibuild diff --git a/repo/system/dhcp.xibuild b/repo/system/dhcp.xibuild new file mode 100644 index 0000000..6b57b1d --- /dev/null +++ b/repo/system/dhcp.xibuild @@ -0,0 +1,73 @@ +#!/bin/bash + +MAKEDEPS=(bash iproute2 openldap) +DEPS=(glibc libldap) + +PKG_VER=4.4.2-P1 +SOURCE=https://ftp.isc.org/isc/dhcp/$PKG_VER/dhcp-$PKG_VER.tar.gz + +BOOTSCRIPTS=blfs-bootscripts-20210826 +ADDITIONAL=( + https://anduin.linuxfromscratch.org/BLFS/blfs-bootscripts/$BOOTSCRIPTS.tar.xz + ) + +DESC="A DHCP server, client and relay" + +package () { + sed -i '/o.*dhcp_type/d' server/mdb.c && + sed -r '/u.*(local|remote)_port/d' \ + -i client/dhclient.c \ + relay/dhcrelay.c +} + + +build () { + ( export CFLAGS="${CFLAGS:--g -O2} -Wall -fno-strict-aliasing \ + -D_PATH_DHCLIENT_SCRIPT='\"/usr/sbin/dhclient-script\"' \ + -D_PATH_DHCPD_CONF='\"/etc/dhcp/dhcpd.conf\"' \ + -D_PATH_DHCLIENT_CONF='\"/etc/dhcp/dhclient.conf\"'" && + +./configure --prefix=/usr \ + --sysconfdir=/etc/dhcp \ + --localstatedir=/var \ + --with-srv-lease-file=/var/lib/dhcpd/dhcpd.leases \ + --with-srv6-lease-file=/var/lib/dhcpd/dhcpd6.leases \ + --with-cli-lease-file=/var/lib/dhclient/dhclient.leases \ + --with-cli6-lease-file=/var/lib/dhclient/dhclient6.leases +) && +make -j1 + +} + +package () { + make -C client DESTDIR=$PKG_DEST install && + install -v -m755 client/scripts/linux $PKG_DEST/usr/sbin/dhclient-script + + install -vdm755 /etc/dhcp && + cat > $PKG_DEST/etc/dhcp/dhclient.conf << "EOF" +# Begin /etc/dhcp/dhclient.conf +# +# Basic dhclient.conf(5) + +#prepend domain-name-servers 127.0.0.1; +request subnet-mask, broadcast-address, time-offset, routers, + domain-name, domain-name-servers, domain-search, host-name, + netbios-name-servers, netbios-scope, interface-mtu, + ntp-servers; +require subnet-mask, domain-name-servers; +#timeout 60; +#retry 60; +#reboot 10; +#select-timeout 5; +#initial-interval 2; + +# End /etc/dhcp/dhclient.conf +EOF + install -v -dm 755 $PKG_DEST/var/lib/dhclient + + tar xf $BOOTSCRIPTS.tar.xz + cd $BOOTSCRIPTS + make DESTDIR=$PKG_DEST install-service-dhclient + +} + diff --git a/repo/system/libusb.xibuild b/repo/system/libusb.xibuild new file mode 100644 index 0000000..764341c --- /dev/null +++ b/repo/system/libusb.xibuild @@ -0,0 +1,17 @@ +#!/bin/bash + +MAKEDEPS=(make) +DEPS=(glibc eudev) + +PKG_VER=1.0.25 +SOURCE=https://github.com/libusb/libusb/releases/download/v$PKG_VER/libusb-$PKG_VER.tar.bz2 +DESC="Library that provides generic access to USB devices" + +build () { + ./configure --prefix=/usr --disable-static && + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/networkmanager.xibuild b/repo/system/networkmanager.xibuild index 36ae070..3a59ce4 100644 --- a/repo/system/networkmanager.xibuild +++ b/repo/system/networkmanager.xibuild @@ -1,7 +1,7 @@ #!/bin/bash MAKEDEPS=(grep meson ninja python intltool glib) -DEPS=(jansson libndp curl wpa_supplicant newt nss polkit libpsl audit dbus gobject-introspection) +DEPS=(jansson libndp curl wpa_supplicant newt nss polkit libpsl audit dbus gobject-introspection dhcp) PKG_VER=1.35.5 SOURCE=https://download.gnome.org/sources/NetworkManager/$(echo $PKG_VER | cut -d. -f-2)/NetworkManager-$PKG_VER.tar.xz diff --git a/repo/util/acpi.xibuild b/repo/util/acpi.xibuild new file mode 100644 index 0000000..ff720a4 --- /dev/null +++ b/repo/util/acpi.xibuild @@ -0,0 +1,29 @@ +#!/bin/bash + +MAKEDEPS=(make) +DEPS=(glibc) + +PKG_VER=2.0.33 +SOURCE=https://downloads.sourceforge.net/acpid2/acpid-$PKG_VER.tar.xz +DESC="Client for battery, power, and thermal readings" + +BOOTSCRIPTS=blfs-bootscripts-20210826 +ADDITIONAL=( + https://anduin.linuxfromscratch.org/BLFS/blfs-bootscripts/$BOOTSCRIPTS.tar.xz + ) + +build () { + ./configure --prefix=/usr \ + --docdir=/usr/share/doc/acpid-$PKG_VER && + make +} + +package () { + make DESTDIR=$PKG_DEST install + install -v -m755 -d $PKG_DEST/etc/acpi/events && + cp -r samples $PKG_DEST/usr/share/doc/acpid-$PKG_VER + + tar xf $BOOTSCRIPTS.tar.xz + cd $BOOTSCRIPTS + make DESTDIR=$PKG_DEST install-acpid +} diff --git a/repo/util/lynx.xibuild b/repo/util/lynx.xibuild new file mode 100644 index 0000000..aef0e88 --- /dev/null +++ b/repo/util/lynx.xibuild @@ -0,0 +1,32 @@ +#!/bin/bash + +MAKEDEPS=(make ) +DEPS=(libidn openssl) + +PKG_VER=2.8.9rel.1 + +SOURCE=https://invisible-mirror.net/archives/lynx/tarballs/lynx$PKG_VER.tar.bz2 +ADDITIONAL=( + https://www.linuxfromscratch.org/patches/blfs/svn/lynx-$PKG_VER-security_fix-1.patch + ) + +DESC="A text only browser for the WWW" + +build () { + ./configure --prefix=/usr \ + --sysconfdir=/etc/lynx \ + --datadir=/usr/share/doc/lynx-$PKG_VER \ + --with-zlib \ + --with-bzlib \ + --with-ssl \ + --with-screen=ncursesw \ + --enable-locale-charset && + make + +} + +package () { + make DESTDIR=$PKG_DEST install-full + chgrp -v -R root $PKG_DEST/usr/share/doc/lynx-$PKG_VER/lynx_doc + +} diff --git a/repo/util/pciutils.xibuild b/repo/util/pciutils.xibuild new file mode 100644 index 0000000..421dbd9 --- /dev/null +++ b/repo/util/pciutils.xibuild @@ -0,0 +1,31 @@ +#!/bin/bash + +MAKEDEPS=(make ) +DEPS=(glibc kmod) + +PKG_VER=3.7.0 +SOURCE=https://www.kernel.org/pub/software/utils/pciutils/pciutils-$PKG_VER.tar.xz +DESC="PCI bus configuration space access library and tools" + +build () { + make PREFIX=/usr \ + SHAREDIR=/usr/share/hwdata \ + SHARED=yes +} + +package () { + make DESTDIR=$PKG_DEST + PREFIX=/usr \ + SHAREDIR=/usr/share/hwdata \ + SHARED=yes \ + install install-lib && + chmod -v 755 $PKG_DEST/usr/lib/libpci.so + + cat > $PKG_DEST/etc/cron.weekly/update-pciids.sh << "EOF" && +#!/bin/bash +/usr/sbin/update-pciids +EOF + chmod 754 $PKG_DEST/etc/cron.weekly/update-pciids.sh + + +} diff --git a/repo/util/pm-utils.xibuild b/repo/util/pm-utils.xibuild new file mode 100644 index 0000000..a1347eb --- /dev/null +++ b/repo/util/pm-utils.xibuild @@ -0,0 +1,20 @@ +#!/bin/bash + +MAKEDEPS=(xmlto docbook-xml docbook-xsl) +DEPS=(glibc bash procps) + +PKG_VER=1.4.1 +SOURCE=https://pm-utils.freedesktop.org/releases/pm-utils-$PKG_VER.tar.gz +DESC="Utilities to manage suspend and hiberante powermanagement" + +build () { + ./configure --prefix=/usr \ + --sysconfdir=/etc \ + --docdir=/usr/share/doc/pm-utils-$PKG_VER && + make + +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/util/sudo.xibuild b/repo/util/sudo.xibuild new file mode 100644 index 0000000..a613ccb --- /dev/null +++ b/repo/util/sudo.xibuild @@ -0,0 +1,49 @@ +#!/bin/bash + +MAKEDEPS=(make ) +DEPS=(glibc libldap openssl pam zlib) + +PKG_VER=1.9.9 +SOURCE=https://www.sudo.ws/dist/sudo-$PKG_VER.tar.gz +DESC="Give certain users the ability to run some commands as root" + +build () { + ./configure --prefix=/usr \ + --libexecdir=/usr/lib \ + --with-secure-path \ + --with-all-insults \ + --with-env-editor \ + --docdir=/usr/share/doc/sudo-1.9.9 \ + --with-passprompt="[sudo] password for %p: " && + make + +} + +package () { + make DESTDIR=$PKG_DEST install && + ln -sfv libsudo_util.so.0.0.0 $PKG_DEST/usr/lib/sudo/libsudo_util.so.0 + + cat > $PKG_DEST/etc/sudoers.d/00-sudo << "EOF" +Defaults secure_path="/usr/sbin:/usr/bin" +%wheel ALL=(ALL) ALL +EOF + + cat > $PKG_DEST/etc/pam.d/sudo << "EOF" +# Begin /etc/pam.d/sudo + +# include the default auth settings +auth include system-auth + +# include the default account settings +account include system-account + +# Set default environment variables for the service user +session required pam_env.so + +# include system session defaults +session include system-session + +# End /etc/pam.d/sudo +EOF + chmod 644 $PKG_DEST/etc/pam.d/sudo +} diff --git a/repo/util/usbutils.xibuild b/repo/util/usbutils.xibuild new file mode 100644 index 0000000..5aefeb4 --- /dev/null +++ b/repo/util/usbutils.xibuild @@ -0,0 +1,21 @@ +#!/bin/bash + +MAKEDEPS=(libusb wget) +DEPS=(libusb glibc hwdata coreutils python) + +PKG_VER=014 +SOURCE=https://www.kernel.org/pub/linux/utils/usb/usbutils/usbutils-$PKG_VER.tar.xz +DESC="A collection of USB tools to query connected USB devices" + +build () { + ./configure --prefix=/usr --datadir=/usr/share/hwdata && + make + +} + +package () { + make DESTDIR=$PKG_DEST install + install -dm755 $PKG_DEST/usr/share/hwdata/ && + wget http://www.linux-usb.org/usb.ids -O $PKG_DEST/usr/share/hwdata/usb.ids + +} diff --git a/repo/util/wget.xibuild b/repo/util/wget.xibuild new file mode 100644 index 0000000..71eb2ba --- /dev/null +++ b/repo/util/wget.xibuild @@ -0,0 +1,19 @@ +#!/bin/bash + +MAKEDEPS=(make ) +DEPS=(glibc gnutls libidn2 libpsl nettle util-linux pcre2 zlib cacerts) + +PKG_VER=1.21.2 +SOURCE=https://ftp.gnu.org/gnu/wget/wget-$PKG_VER.tar.gz +DESC="A utility for transfering files with URL syntax" + +build () { + ./configure --prefix=/usr \ + --sysconfdir=/etc \ + --with-ssl=openssl && + make +} + +package () { + make DESTDIR=$PKG_DEST install +} -- cgit v1.2.1