summaryrefslogtreecommitdiffstats
path: root/libraries/libbsd
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/libbsd')
-rw-r--r--libraries/libbsd/README8
-rw-r--r--libraries/libbsd/libbsd.SlackBuild46
-rw-r--r--libraries/libbsd/libbsd.info14
-rw-r--r--libraries/libbsd/patches/0001-build-Use-yes-instead-of-true-for-AC_CHECK_FUNCS-cac.patch32
-rw-r--r--libraries/libbsd/patches/0001-funopen-Replace-off64_t-with-off_t-in-funopen_seek.patch39
-rw-r--r--libraries/libbsd/patches/0001-include-Adjust-closefrom-per-glibc-adoption.patch33
-rw-r--r--libraries/libbsd/patches/0001-man-Update-STANDARDS-and-HISTORY-sections.patch279
7 files changed, 426 insertions, 25 deletions
diff --git a/libraries/libbsd/README b/libraries/libbsd/README
index e263cefefe..50be4a0082 100644
--- a/libraries/libbsd/README
+++ b/libraries/libbsd/README
@@ -1,4 +1,4 @@
-This library provides useful functions commonly found on BSD systems, and
-lacking on others like GNU systems, thus making it easier to port projects
-with strong BSD origins, without needing to embed the same code over and
-over again on each project.
+This library provides useful functions commonly found on BSD systems,
+and lacking on others like GNU systems, thus making it easier to port
+projects with strong BSD origins, without needing to embed the same
+code over and over again on each project.
diff --git a/libraries/libbsd/libbsd.SlackBuild b/libraries/libbsd/libbsd.SlackBuild
index d3d127c102..bcd909ea1f 100644
--- a/libraries/libbsd/libbsd.SlackBuild
+++ b/libraries/libbsd/libbsd.SlackBuild
@@ -1,6 +1,9 @@
-#!/bin/sh
+#!/bin/bash
-# Copyright (c) 2010-2013 LEVAI Daniel
+# Slackware build script for libbsd
+
+# Copyright 2020-2023 Matteo Bernardini <ponce@slackbuilds.org>, Pisa, Italy
+# Copyright (c) 2010-2020 LEVAI Daniel
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -25,28 +28,36 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-# Build script for libbsd
+cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=libbsd
-VERSION=${VERSION:-0.6.0}
+VERSION=${VERSION:-0.11.7}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
- i?86) ARCH=i486 ;;
+ i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
-CWD=$(pwd)
+# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
+# the name of the created package would be, and then exit. This information
+# could be useful to other scripts.
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
-if [ "$ARCH" = "i486" ];then
- SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+if [ "$ARCH" = "i586" ];then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
@@ -69,11 +80,15 @@ tar xvf $CWD/$PRGNAM-$VERSION.tar.xz
cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
- \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
- -exec chmod 755 {} \; -o \
- \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
- -exec chmod 644 {} \;
+ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
+ -o -perm 511 \) -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+# Debian/upstream patches
+for i in $CWD/patches/* ; do patch -p1 < $i ; done
+
+autoreconf -vif
CFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
@@ -82,9 +97,12 @@ CFLAGS="$SLKCFLAGS" \
--disable-static \
--build=$ARCH-slackware-linux
-make install DESTDIR=$PKG
+make install-strip DESTDIR=$PKG
+
+rm -rf $PKG/usr/lib${LIBDIRSUFFIX}/*.la
find $PKG/usr/man -type f -exec gzip -9 {} \;
+for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/
cp -a ChangeLog README TODO $PKG/usr/doc/$PRGNAM-$VERSION/
@@ -95,4 +113,4 @@ mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
diff --git a/libraries/libbsd/libbsd.info b/libraries/libbsd/libbsd.info
index 37305d9165..486a365bf0 100644
--- a/libraries/libbsd/libbsd.info
+++ b/libraries/libbsd/libbsd.info
@@ -1,10 +1,10 @@
PRGNAM="libbsd"
-VERSION="0.6.0"
-HOMEPAGE="http://libbsd.freedesktop.org/wiki/"
-DOWNLOAD="http://libbsd.freedesktop.org/releases/libbsd-0.6.0.tar.xz"
-MD5SUM="f6c75f0a9818e323a589bcbd560a0eb4"
+VERSION="0.11.7"
+HOMEPAGE="https://libbsd.freedesktop.org/wiki/"
+DOWNLOAD="https://libbsd.freedesktop.org/releases/libbsd-0.11.7.tar.xz"
+MD5SUM="2c5e63b5bb7771bbe4f572c7788e0bb8"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
-REQUIRES=""
-MAINTAINER="LEVAI Daniel"
-EMAIL="leva@ecentrum.hu"
+REQUIRES="libmd"
+MAINTAINER="Matteo Bernardini"
+EMAIL="ponce@slackbuilds.org"
diff --git a/libraries/libbsd/patches/0001-build-Use-yes-instead-of-true-for-AC_CHECK_FUNCS-cac.patch b/libraries/libbsd/patches/0001-build-Use-yes-instead-of-true-for-AC_CHECK_FUNCS-cac.patch
new file mode 100644
index 0000000000..f73d8efe6a
--- /dev/null
+++ b/libraries/libbsd/patches/0001-build-Use-yes-instead-of-true-for-AC_CHECK_FUNCS-cac.patch
@@ -0,0 +1,32 @@
+From 5cfa39e5cde6b64ccf3d1335cee4d4744d4ce242 Mon Sep 17 00:00:00 2001
+From: Guillem Jover <guillem@hadrons.org>
+Date: Wed, 23 Nov 2022 23:42:49 +0100
+Subject: [PATCH] =?UTF-8?q?build:=20Use=20=C2=AByes=C2=BB=20instead=20of?=
+ =?UTF-8?q?=20=C2=ABtrue=C2=BB=20for=20AC=5FCHECK=5FFUNCS=20cache=20value?=
+Origin: upstream, commit:5cfa39e5cde6b64ccf3d1335cee4d4744d4ce242
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This autoconf macro sets the ac_cv_func_ cached variable to «yes» not
+«true» so we were checking for an impossible condition.
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 17d113c..842f5d6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -246,7 +246,7 @@ AC_LINK_IFELSE(
+ AC_CHECK_FUNCS([clearenv dirfd fopencookie __fpurge \
+ getauxval getentropy getexecname getline \
+ pstat_getproc sysconf])
+-AM_CONDITIONAL([HAVE_GETENTROPY], [test "x$ac_cv_func_getentropy" = "xtrue"])
++AM_CONDITIONAL([HAVE_GETENTROPY], [test "x$ac_cv_func_getentropy" = "xyes"])
+
+ AC_SUBST([MD5_LIBS])
+ AC_SUBST([LIBBSD_LIBS])
+--
+2.39.2
+
diff --git a/libraries/libbsd/patches/0001-funopen-Replace-off64_t-with-off_t-in-funopen_seek.patch b/libraries/libbsd/patches/0001-funopen-Replace-off64_t-with-off_t-in-funopen_seek.patch
new file mode 100644
index 0000000000..6a9892acda
--- /dev/null
+++ b/libraries/libbsd/patches/0001-funopen-Replace-off64_t-with-off_t-in-funopen_seek.patch
@@ -0,0 +1,39 @@
+From ec88b7bbbc9ef262b22302419ae14fce5fc7b1d8 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 15 Dec 2022 09:02:22 -0800
+Origin: upstream, commit:ec88b7bbbc9ef262b22302419ae14fce5fc7b1d8
+Subject: [PATCH] funopen: Replace off64_t with off_t in funopen_seek()
+
+AC_SYS_LARGEFILE in configure.ac is setting needed defines to make
+64bit off_t on relevant platforms.
+
+Fixes build on musl:
+
+| src/funopen.c:68:28: error: unknown type name 'off64_t'; did you mean 'off_t'?
+| funopen_seek(void *cookie, off64_t *offset, int whence)
+| ^~~~~~~
+| off_t
+
+Closes: !24
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Guillem Jover <guillem@hadrons.org>
+---
+ src/funopen.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/funopen.c b/src/funopen.c
+index 01b63b3..0513e38 100644
+--- a/src/funopen.c
++++ b/src/funopen.c
+@@ -65,7 +65,7 @@ funopen_write(void *cookie, const char *buf, size_t size)
+ }
+
+ static int
+-funopen_seek(void *cookie, off64_t *offset, int whence)
++funopen_seek(void *cookie, off_t *offset, int whence)
+ {
+ struct funopen_cookie *cookiewrap = cookie;
+ off_t soff = *offset;
+--
+2.39.2
+
diff --git a/libraries/libbsd/patches/0001-include-Adjust-closefrom-per-glibc-adoption.patch b/libraries/libbsd/patches/0001-include-Adjust-closefrom-per-glibc-adoption.patch
new file mode 100644
index 0000000000..41b2b496af
--- /dev/null
+++ b/libraries/libbsd/patches/0001-include-Adjust-closefrom-per-glibc-adoption.patch
@@ -0,0 +1,33 @@
+From 7b4ebd6521a693f236cad4170fce1bb5237ecae5 Mon Sep 17 00:00:00 2001
+From: Callum Farmer <callumjfarmer13@gmail.com>
+Date: Thu, 16 Feb 2023 21:26:05 +0000
+Origin: upstream, commit:7b4ebd6521a693f236cad4170fce1bb5237ecae5
+Subject: [PATCH] include: Adjust closefrom() per glibc adoption
+
+Added in glibc 2.34
+https://sourceware.org/git/?p=glibc.git;a=commit;h=607449506f197cc9514408908f41f22537a47a8c
+
+Signed-off-by: Guillem Jover <guillem@hadrons.org>
+---
+ include/bsd/unistd.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/include/bsd/unistd.h b/include/bsd/unistd.h
+index 167241b..20b0993 100644
+--- a/include/bsd/unistd.h
++++ b/include/bsd/unistd.h
+@@ -59,7 +59,11 @@ int bsd_getopt(int argc, char * const argv[], const char *shortopts);
+ mode_t getmode(const void *set, mode_t mode);
+ void *setmode(const char *mode_str);
+
++#if !defined(__GLIBC__) || \
++ !__GLIBC_PREREQ(2, 34) || \
++ !defined(_DEFAULT_SOURCE)
+ void closefrom(int lowfd);
++#endif
+
+ /* Compatibility with sendmail implementations. */
+ #define initsetproctitle(c, a, e) setproctitle_init((c), (a), (e))
+--
+2.39.2
+
diff --git a/libraries/libbsd/patches/0001-man-Update-STANDARDS-and-HISTORY-sections.patch b/libraries/libbsd/patches/0001-man-Update-STANDARDS-and-HISTORY-sections.patch
new file mode 100644
index 0000000000..d743f05c46
--- /dev/null
+++ b/libraries/libbsd/patches/0001-man-Update-STANDARDS-and-HISTORY-sections.patch
@@ -0,0 +1,279 @@
+From 59a21c7fb846c483460979be74c546edab0d185e Mon Sep 17 00:00:00 2001
+From: Guillem Jover <guillem@hadrons.org>
+Date: Mon, 20 Feb 2023 00:11:10 +0100
+Origin: upstream, commit:59a21c7fb846c483460979be74c546edab0d185e
+Subject: [PATCH] man: Update STANDARDS and HISTORY sections
+
+Include BSD versions when functions were introduced. Add mention
+whether these are BSD extensions.
+---
+ man/arc4random.3bsd | 6 ++++++
+ man/closefrom.3bsd | 13 +++++++++++--
+ man/fparseln.3bsd | 4 +++-
+ man/getpeereid.3bsd | 5 ++++-
+ man/humanize_number.3bsd | 4 +++-
+ man/pidfile.3bsd | 14 ++++++++++++++
+ man/pwcache.3bsd | 6 +++---
+ man/readpassphrase.3bsd | 6 ++++--
+ man/reallocarray.3bsd | 10 ++++++++--
+ man/setproctitle.3bsd | 2 ++
+ man/strlcpy.3bsd | 2 ++
+ man/strnstr.3bsd | 5 +++++
+ man/strtonum.3bsd | 4 ++--
+ man/tree.3bsd | 3 +++
+ man/wcslcpy.3bsd | 11 +++++++++++
+ 15 files changed, 81 insertions(+), 14 deletions(-)
+
+diff --git a/man/arc4random.3bsd b/man/arc4random.3bsd
+index 547bd54..f1dc254 100644
+--- a/man/arc4random.3bsd
++++ b/man/arc4random.3bsd
+@@ -135,6 +135,12 @@ These functions first appeared in
+ .Nx 1.6 ,
+ and
+ .Dx 1.0 .
++The functions
++.Fn arc4random ,
++.Fn arc4random_buf
++and
++.Fn arc4random_uniform
++appeared in glibc 2.36.
+ .Pp
+ The original version of this random number generator used the
+ RC4 (also known as ARC4) algorithm.
+diff --git a/man/closefrom.3bsd b/man/closefrom.3bsd
+index 9e1b0db..5f930f5 100644
+--- a/man/closefrom.3bsd
++++ b/man/closefrom.3bsd
+@@ -51,8 +51,17 @@ from the per-process object reference table.
+ Any errors encountered while closing file descriptors are ignored.
+ .Sh SEE ALSO
+ .Xr close 2
++.Sh STANDARDS
++.Fn closefrom
++is a
++.Bx
++and Solaris extension.
+ .Sh HISTORY
+ The
+ .Fn closefrom
+-function first appeared in
+-.Fx 8.0 .
++function first appeared in Solaris 9,
++.Ox 3.5 ,
++.Dx 1.2 ,
++.Nx 3.0 ,
++.Fx 8.0
++and glibc 2.34.
+diff --git a/man/fparseln.3bsd b/man/fparseln.3bsd
+index ab8ad7b..b227f0d 100644
+--- a/man/fparseln.3bsd
++++ b/man/fparseln.3bsd
+@@ -150,4 +150,6 @@ if it runs out of memory.
+ The
+ .Fn fparseln
+ function first appeared in
+-.Nx 1.4 .
++.Nx 1.4
++and
++.Fx 4.0 .
+diff --git a/man/getpeereid.3bsd b/man/getpeereid.3bsd
+index eafa4b4..4cc7cc6 100644
+--- a/man/getpeereid.3bsd
++++ b/man/getpeereid.3bsd
+@@ -139,4 +139,7 @@ or the kernel returned invalid data.
+ The
+ .Fn getpeereid
+ function appeared in
+-.Fx 4.6 .
++.Fx 4.6 ,
++.Nx 5.0
++and
++.Ox 3.0 .
+diff --git a/man/humanize_number.3bsd b/man/humanize_number.3bsd
+index 45b1d68..02ce9af 100644
+--- a/man/humanize_number.3bsd
++++ b/man/humanize_number.3bsd
+@@ -166,7 +166,9 @@ represented a number that does not fit in
+ .Sh HISTORY
+ .Fn humanize_number
+ first appeared in
+-.Nx 2.0 .
++.Nx 2.0
++and
++.Fx 5.3 .
+ .Pp
+ .Fn dehumanize_number
+ first appeared in
+diff --git a/man/pidfile.3bsd b/man/pidfile.3bsd
+index 634ac81..547c556 100644
+--- a/man/pidfile.3bsd
++++ b/man/pidfile.3bsd
+@@ -292,6 +292,20 @@ Probably called not from the process which used
+ .Xr open 2 ,
+ .Xr daemon 3 ,
+ .Xr flopen 3bsd
++.Sh HISTORY
++The functions
++.Fn pidfile_open ,
++.Fn pidfile_write ,
++.Fn pidfile_close
++and
++.Fn pidfile_remove
++first appeared in
++.Fx 5.5 .
++.Pp
++The function
++.Fn pidfile_fileno
++first appeared in
++.Fx 10.0 .
+ .Sh AUTHORS
+ .An -nosplit
+ The
+diff --git a/man/pwcache.3bsd b/man/pwcache.3bsd
+index 366c0b2..06c54e1 100644
+--- a/man/pwcache.3bsd
++++ b/man/pwcache.3bsd
+@@ -137,7 +137,7 @@ The
+ .Fn uid_from_user
+ and
+ .Fn gid_from_group
+-functions were ported from
+-.Nx
+-and first appeared in
++functions first appeared in
++.Nx 1.4
++and
+ .Ox 6.4 .
+diff --git a/man/readpassphrase.3bsd b/man/readpassphrase.3bsd
+index 23e5e4c..3c9275d 100644
+--- a/man/readpassphrase.3bsd
++++ b/man/readpassphrase.3bsd
+@@ -165,10 +165,12 @@ will reprint the prompt and the user may then enter a passphrase.
+ The
+ .Fn readpassphrase
+ function is an
+-.Ox
++.Bx
+ extension and should not be used if portability is desired.
+ .Sh HISTORY
+ The
+ .Fn readpassphrase
+ function first appeared in
+-.Ox 2.9 .
++.Ox 2.9
++and
++.Fx 4.6 .
+diff --git a/man/reallocarray.3bsd b/man/reallocarray.3bsd
+index f4dbf2b..a63de81 100644
+--- a/man/reallocarray.3bsd
++++ b/man/reallocarray.3bsd
+@@ -283,12 +283,18 @@ The
+ .Fn reallocarray
+ function appeared in
+ .Ox 5.6 ,
++.Dx 5.5
+ and glibc 2.26.
++.Pp
+ The
+ .Fn recallocarray
+ function appeared in
+-.Ox 6.1 .
++.Ox 6.1
++and
++.Dx 5.5 .
+ The
+ .Fn freezero
+ function appeared in
+-.Ox 6.2 .
++.Ox 6.2
++and
++.Dx 5.5 .
+diff --git a/man/setproctitle.3bsd b/man/setproctitle.3bsd
+index 4a6609f..c8aeb4b 100644
+--- a/man/setproctitle.3bsd
++++ b/man/setproctitle.3bsd
+@@ -112,6 +112,8 @@ The
+ .Fn setproctitle
+ function
+ first appeared in
++.Nx 1.0
++and
+ .Fx 2.2 .
+ Other operating systems have
+ similar functions.
+diff --git a/man/strlcpy.3bsd b/man/strlcpy.3bsd
+index 19aaa75..ebc9758 100644
+--- a/man/strlcpy.3bsd
++++ b/man/strlcpy.3bsd
+@@ -192,4 +192,6 @@ and
+ functions first appeared in
+ .Ox 2.4 ,
+ and made their appearance in
++.Nx 1.4.3
++and
+ .Fx 3.3 .
+diff --git a/man/strnstr.3bsd b/man/strnstr.3bsd
+index 44756e6..95e729e 100644
+--- a/man/strnstr.3bsd
++++ b/man/strnstr.3bsd
+@@ -112,3 +112,8 @@ ptr = strnstr(largestring, smallstring, 4);
+ .Xr strspn 3 ,
+ .Xr strtok 3 ,
+ .Xr wcsstr 3
++.Sh HISTORY
++The
++.Fn strnstr
++function originated in
++.Fx .
+diff --git a/man/strtonum.3bsd b/man/strtonum.3bsd
+index 44107b1..1041782 100644
+--- a/man/strtonum.3bsd
++++ b/man/strtonum.3bsd
+@@ -141,8 +141,8 @@ The string did not consist solely of digit characters.
+ .Xr strtoull 3
+ .Sh STANDARDS
+ .Fn strtonum
+-is an
+-.Ox
++is a
++.Bx
+ extension.
+ .Sh HISTORY
+ .ds doc-operating-system-NetBSD-8.0 8.0
+diff --git a/man/tree.3bsd b/man/tree.3bsd
+index 2bd4f17..4c9dfb6 100644
+--- a/man/tree.3bsd
++++ b/man/tree.3bsd
+@@ -562,6 +562,9 @@ main(void)
+ .Ed
+ .Sh SEE ALSO
+ .Xr queue 3bsd
++.Sh HISTORY
++The tree macros first appeared in
++.Fx 4.6 .
+ .Sh NOTES
+ Trying to free a tree in the following way is a common error:
+ .Bd -literal -offset indent
+diff --git a/man/wcslcpy.3bsd b/man/wcslcpy.3bsd
+index f7ed5a2..3a6169c 100644
+--- a/man/wcslcpy.3bsd
++++ b/man/wcslcpy.3bsd
+@@ -69,3 +69,14 @@ counterpart, such as
+ and
+ .Fn wcslcpy ,
+ which are BSD extensions.
++.Sh HISTORY
++The
++.Fn wcslcpy
++and
++.Fn wcslcat
++functions first appeared in
++.Ox 3.8 ,
++.Nx 1.6 ,
++.Fx 5.0
++and
++.Dx 2.1 .
+--
+2.39.2
+