From f14cfce65da72c2b51e1334ad66de3abc2422ddb Mon Sep 17 00:00:00 2001 From: PktSurf Date: Fri, 1 Nov 2024 21:11:19 +0530 Subject: [PATCH] Added doinst.sh to net/irssi to preserve /etc/irssi.conf Discarded old patch and added a new one to net/wireless-tools and fixed its build file --- net/irssi/doinst.sh | 13 +++++ net/irssi/smbuild | 5 +- net/wireless-tools/makefile.patch | 28 ++++++++++ net/wireless-tools/smbuild | 19 ++++--- .../wireless-tools-Makefile.patch | 53 ------------------- 5 files changed, 54 insertions(+), 64 deletions(-) create mode 100644 net/irssi/doinst.sh create mode 100644 net/wireless-tools/makefile.patch delete mode 100644 net/wireless-tools/wireless-tools-Makefile.patch diff --git a/net/irssi/doinst.sh b/net/irssi/doinst.sh new file mode 100644 index 0000000..bcd060f --- /dev/null +++ b/net/irssi/doinst.sh @@ -0,0 +1,13 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +config etc/irssi.conf.new diff --git a/net/irssi/smbuild b/net/irssi/smbuild index afaa8dc..5f96183 100644 --- a/net/irssi/smbuild +++ b/net/irssi/smbuild @@ -19,13 +19,16 @@ prepbuilddir() { build() { LDFLAGS="-lcurses -lterminfo" \ ./configure \ - --prefix=/usr + --prefix=/usr \ + --sysconfdir=/etc make make install DESTDIR=$pkg cp COPYING $pkgdocs/ + mv $pkg/etc/irssi.conf $pkg/etc/irssi.conf.new + mkfinalpkg } diff --git a/net/wireless-tools/makefile.patch b/net/wireless-tools/makefile.patch new file mode 100644 index 0000000..8f72c0b --- /dev/null +++ b/net/wireless-tools/makefile.patch @@ -0,0 +1,28 @@ +--- a/Makefile 2024-10-30 10:45:37.791157442 +0000 ++++ b/Makefile 2024-10-30 14:58:42.084973143 +0000 +@@ -4,9 +4,7 @@ + + ## Installation directory. By default, go in /usr/local. + ## Distributions should probably use /, but they probably know better... +-ifndef PREFIX +- PREFIX = /usr/local +-endif ++PREFIX ?= /usr + + ## Compiler to use (modify this for cross compile). + CC = gcc +@@ -71,10 +69,10 @@ + DYNAMIC_LINK= libiw.so + + # Install directories +-INSTALL_DIR= $(PREFIX)/sbin/ +-INSTALL_LIB= $(PREFIX)/lib/ +-INSTALL_INC= $(PREFIX)/include/ +-INSTALL_MAN= $(PREFIX)/man/ ++INSTALL_DIR= $(DESTDIR)$(PREFIX)/bin/ ++INSTALL_LIB= $(DESTDIR)$(PREFIX)/lib/ ++INSTALL_INC= $(DESTDIR)$(PREFIX)/include/ ++INSTALL_MAN= $(DESTDIR)$(PREFIX)/share/man/ + + # Various commands + RM = rm -f diff --git a/net/wireless-tools/smbuild b/net/wireless-tools/smbuild index eaf8a6f..e516812 100644 --- a/net/wireless-tools/smbuild +++ b/net/wireless-tools/smbuild @@ -2,7 +2,6 @@ app=wireless-tools version=29 build=1sml -altname="$(echo $app | sed 's/-/_/')" homepage="https://hewlettpackard.github.io/wireless-tools/" download="https://hewlettpackard.github.io/wireless-tools/wireless_tools.$version.tar.gz" desc="Set of tools allowing manipulation of wireless extensions" @@ -10,19 +9,19 @@ requires="musl" prepbuilddir() { mkandenterbuilddir - rm -rf "$altname.$version" + rm -rf $app-$version - tar xf $srcdir/$altname.$version.tar.?z - cd "$altname.$version" + tar xf $srcdir/$app-$version.tar.?z* + cd $app-$version fixbuilddirpermissions - applypatch $srcdir/wireless-tools-Makefile.patch + applypatch $srcdir/makefile.patch applypatch $srcdir/wireless-tools-headers.patch } build() { - make INSTALL_MAN="$pkg/usr/share/man" INSTALL_DIR="$pkg/usr/bin" - make INSTALL_MAN="$pkg/usr/share/man" INSTALL_DIR="$pkg/usr/bin" install DESTDIR="$pkg" + make + make install PREFIX=/usr DESTDIR="$pkg" cp COPYING $pkgdocs/ @@ -30,7 +29,7 @@ build() { } sha512sums=" -d2f182e60aeb2f3fa6dbb52b49be48a7ed25c1e660116c8b763b6d2baf863855c7459f1d8e0d4ae7d9f526a8f47d3cc5deaf1db5fe5352fdd821a427aa31716a wireless_tools.29.tar.lz -629dee411f8b37047613fb8381b431caed8c1dcc24a3ced058c38f3628696ded1b8a0432ce5da75dbc93d42c7c82e54f16c0102fb0d961c840fe925f30377114 wireless-tools-Makefile.patch +f9c0c126b82ec8c81847c52080152e92a449dc5db00ae44b8ed45aa5959b7c611b59b8c8e2152efd1ee67c321a76600aeac4b1de0df1ee86993be5d42fc5b6a2 wireless-tools-29.tar.lz +12610d303a9f8ecaf22e6fbf4f817f71ea7ba5309b1c713b6f39df843c46d6c766abbf7d5677b32648603baf8617067237772cafd6264667ddd7b843181cc1d4 makefile.patch 502e0b879bed0ccbcb6de0580984f4187cdbf4adc87caae44652a6a9ff786103a3930d9dfecd2fbe4754743cde2cc0a310ab67f4a794d0d18e88bdaf41662f14 wireless-tools-headers.patch -" +" \ No newline at end of file diff --git a/net/wireless-tools/wireless-tools-Makefile.patch b/net/wireless-tools/wireless-tools-Makefile.patch deleted file mode 100644 index edded22..0000000 --- a/net/wireless-tools/wireless-tools-Makefile.patch +++ /dev/null @@ -1,53 +0,0 @@ ---- wireless_tools.29.org/Makefile -+++ wireless_tools.29/Makefile -@@ -4,20 +4,18 @@ - - ## Installation directory. By default, go in /usr/local. - ## Distributions should probably use /, but they probably know better... --ifndef PREFIX -- PREFIX = /usr/local --endif -+PREFIX ?= - --## Compiler to use (modify this for cross compile). --CC = gcc -+# Compiler to use (modify this for cross compile). -+CC ?= gcc - ## Other tools you need to modify for cross compile (static lib only). --AR = ar --RANLIB = ranlib -+AR ?= ar -+RANLIB ?= ranlib - - ## Uncomment this to build tools using static version of the library. - ## Mostly useful for embedded platforms without ldd, or to create - ## a local version (non-root). --# BUILD_STATIC = y -+BUILD_STATIC ?= y - - ## Uncomment this to build without using libm (less efficient). - ## This is mostly useful for embedded platforms without maths. -@@ -25,7 +23,7 @@ - - ## Uncomment this to strip binary from symbols. This reduce binary size. - ## by a few percent but make debug worse... --# BUILD_STRIPPING = y -+BUILD_STRIPPING ?= y - - ## Uncomment this to build with only essential functionality. - ## This leaves out the less used features and cut in half the tools. -@@ -71,10 +69,10 @@ - DYNAMIC_LINK= libiw.so - - # Install directories --INSTALL_DIR= $(PREFIX)/sbin/ --INSTALL_LIB= $(PREFIX)/lib/ --INSTALL_INC= $(PREFIX)/include/ --INSTALL_MAN= $(PREFIX)/man/ -+INSTALL_DIR= $(DESTDIR)$(PREFIX)/sbin/ -+INSTALL_LIB= $(DESTDIR)$(PREFIX)/lib/ -+INSTALL_INC= $(DESTDIR)$(PREFIX)/include/ -+INSTALL_MAN= $(DESTDIR)$(PREFIX)/man/ - - # Various commands - RM = rm -f