mirror of
https://github.com/Ponce/slackbuilds
synced 2024-09-29 17:37:55 +02:00
misclibraries/libslack: Added (General programmers' utilities).
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
This commit is contained in:
parent
e49104b469
commit
e33ef45a80
5 changed files with 294 additions and 0 deletions
33
libraries/libslack/README
Normal file
33
libraries/libslack/README
Normal file
|
@ -0,0 +1,33 @@
|
|||
Libslack is a library of general utilities designed to make
|
||||
UNIX/C programming a bit easier on the eye.
|
||||
|
||||
It's a small library with lots of functionality, accurately
|
||||
documented and thoroughly tested.
|
||||
Good library naming conventions are not rigorously observed
|
||||
on the principle that common operations should always be easy
|
||||
to write and code should always be easy to read.
|
||||
|
||||
Libslack contains the following modules:
|
||||
|
||||
agent - agent oriented programming
|
||||
coproc - coprocess using pipes or pseudo terminals
|
||||
daemon - becoming a daemon
|
||||
err - message/error/debug/verbosity/alert messaging
|
||||
fio - fifo and file control and some I/O
|
||||
getopt - GNU getopt_long() for systems that don't have it
|
||||
hsort - generic heap sort
|
||||
lim - POSIX.1 limits convenience functions
|
||||
link - abstract linked lists with optional growable free lists
|
||||
list - list (growable pointer array) data type
|
||||
locker - abstract locking and reader/writer lock implementation
|
||||
map - map (hash table) data type
|
||||
mem - memory helper functions, secure memory, memory pools
|
||||
msg - message handling and syslog helper functions
|
||||
net - network functions (clients/servers, expect/send, pack/unpack, mail)
|
||||
prog - program framework and flexible command line option handling
|
||||
prop - program properties files
|
||||
pseudo - pseudo terminals
|
||||
sig - ISO C compliant signal handling
|
||||
snprintf - safe sprintf for systems that don't have it
|
||||
str - string data type (tr, regex, regsub, fmt, trim, lc, uc, ...)
|
||||
vsscanf - sscanf() with va_list argument for systems that don't have it
|
113
libraries/libslack/libslack.SlackBuild
Normal file
113
libraries/libslack/libslack.SlackBuild
Normal file
|
@ -0,0 +1,113 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Slackware build script for libslack
|
||||
|
||||
# Copyright 2012 Christoph Willing, Australia
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use of this script, with or without modification, is
|
||||
# permitted provided that the following conditions are met:
|
||||
#
|
||||
# 1. Redistributions of this script must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
PRGNAM=libslack
|
||||
VERSION=${VERSION:-0.6}
|
||||
BUILD=${BUILD:-1}
|
||||
TAG=${TAG:-_SBo}
|
||||
|
||||
if [ -z "$ARCH" ]; then
|
||||
case "$( uname -m )" in
|
||||
i?86) ARCH=i486 ;;
|
||||
arm*) ARCH=arm ;;
|
||||
*) ARCH=$( uname -m ) ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
CWD=$(pwd)
|
||||
TMP=${TMP:-/tmp/SBo}
|
||||
PKG=$TMP/package-$PRGNAM
|
||||
OUTPUT=${OUTPUT:-/tmp}
|
||||
|
||||
if [ "$ARCH" = "i486" ]; then
|
||||
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
||||
LIBDIRSUFFIX=""
|
||||
elif [ "$ARCH" = "i686" ]; then
|
||||
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
||||
LIBDIRSUFFIX=""
|
||||
elif [ "$ARCH" = "x86_64" ]; then
|
||||
SLKCFLAGS="-O2 -fPIC"
|
||||
LIBDIRSUFFIX="64"
|
||||
else
|
||||
SLKCFLAGS="-O2"
|
||||
LIBDIRSUFFIX=""
|
||||
fi
|
||||
|
||||
set -e
|
||||
|
||||
rm -rf $PKG
|
||||
mkdir -p $TMP $PKG $OUTPUT
|
||||
cd $TMP
|
||||
rm -rf $PRGNAM-$VERSION
|
||||
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
||||
tar xvf $CWD/$PRGNAM-$VERSION.html.tar.gz
|
||||
cd $PRGNAM-$VERSION
|
||||
chown -R root:root .
|
||||
find . \
|
||||
\( -perm 777 -o -perm 775 -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 {} \;
|
||||
|
||||
# Strip update, download and uninstall capabilities from libslack-config
|
||||
patch -p1 < $CWD/notwanted.patch
|
||||
|
||||
# Set our CFLAGS
|
||||
sed -i "s|-O3|$SLKCFLAGS|" conf/linux Makefile
|
||||
|
||||
./configure
|
||||
make
|
||||
|
||||
# "make install" is badly broken (thanks XGizzmo), so manual install
|
||||
mkdir -p $PKG/usr/bin $PKG/usr/lib$LIBDIRSUFFIX $PKG/usr/include/slack
|
||||
|
||||
install -m 0755 $PRGNAM.a $PKG/usr/lib$LIBDIRSUFFIX/$PRGNAM-$VERSION.a
|
||||
( cd $PKG/usr/lib$LIBDIRSUFFIX ; ln -s $PRGNAM-$VERSION.a $PRGNAM.a )
|
||||
|
||||
install -m 0644 *.h $PKG/usr/include/slack/
|
||||
|
||||
sed \
|
||||
-e "s|@@URL@@|http://$PRGNAM.org/|" \
|
||||
-e "s|@@NAME@@|$PRGNAM|" \
|
||||
-e "s|@@VERSION@@|$VERSION|" \
|
||||
-e "s|@@PREFIX@@|/usr|" \
|
||||
-e "s|@@CFLAGS@@|-DHAVE_GETOPT_LONG=1 -DHAVE_SNPRINTF=1 -DHAVE_VSSCANF=1 -DHAVE_PTHREAD_RWLOCK=1|" \
|
||||
-e "s|@@LIBS@@|-lslack -lpthread -lutil|" \
|
||||
$PRGNAM-config.t > $PKG/usr/bin/$PRGNAM-config
|
||||
chmod 0755 $PKG/usr/bin/$PRGNAM-config
|
||||
|
||||
# Man pages overwrite stuff (thanks XGizzmo), so we ignore them
|
||||
# and install only the html documentation
|
||||
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/html
|
||||
cp -a README LICENSE \
|
||||
$PKG/usr/doc/$PRGNAM-$VERSION
|
||||
cp -a *.html \
|
||||
$PKG/usr/doc/$PRGNAM-$VERSION/html/
|
||||
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
||||
|
||||
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}
|
12
libraries/libslack/libslack.info
Normal file
12
libraries/libslack/libslack.info
Normal file
|
@ -0,0 +1,12 @@
|
|||
PRGNAM="libslack"
|
||||
VERSION="0.6"
|
||||
HOMEPAGE="http://libslack.org"
|
||||
DOWNLOAD="http://libslack.org/download/libslack-0.6.tar.gz \
|
||||
http://libslack.org/download/libslack-0.6.html.tar.gz"
|
||||
MD5SUM="0e22e1d38865be2d94372027e5c42b58 \
|
||||
8687e661c8e3cf591bc33231a9aff553"
|
||||
DOWNLOAD_x86_64=""
|
||||
MD5SUM_x86_64=""
|
||||
REQUIRES=""
|
||||
MAINTAINER="Christoph Willing"
|
||||
EMAIL="c.willing@uq.edu.au"
|
117
libraries/libslack/notwanted.patch
Normal file
117
libraries/libslack/notwanted.patch
Normal file
|
@ -0,0 +1,117 @@
|
|||
diff -Naur libslack-0.6.orig/libslack-config.pod libslack-0.6/libslack-config.pod
|
||||
--- libslack-0.6.orig/libslack-config.pod 2010-06-12 15:37:00.000000000 +0200
|
||||
+++ libslack-0.6/libslack-config.pod 2013-01-02 20:36:02.802707880 +0100
|
||||
@@ -32,13 +32,10 @@
|
||||
-h, --help - Print this help and exit
|
||||
-v, --version - Print the version of the currently installed libslack
|
||||
-L, --latest - Print the latest version of libslack (uses wget)
|
||||
- -D, --download - Download the latest version of libslack (uses wget)
|
||||
- -U, --upgrade - Upgrade to the latest version of libslack (uses wget)
|
||||
-p, --prefix - Print the prefix directory of the libslack installation
|
||||
-c, --cflags - Print CFLAGS needed to compile clients of libslack
|
||||
-l, --libs - Print LDFLAGS needed to link against libslack
|
||||
-l, --ldflags - Identical to --libs
|
||||
- -u, --uninstall - Uninstall libslack
|
||||
|
||||
Note: The dashes are optional for long option names
|
||||
|
||||
@@ -75,19 +72,6 @@
|
||||
Print the latest version of I<libslack> available at
|
||||
C<http://libslack.org/>.
|
||||
|
||||
-=item C<-D>, C<--download>
|
||||
-
|
||||
-Download the latest version of I<libslack> from
|
||||
-C<http://libslack.org/>.
|
||||
-
|
||||
-=item C<-U>, C<--upgrade>
|
||||
-
|
||||
-Upgrade to the latest version of I<libslack> from
|
||||
-C<http://libslack.org/>. This downloads the latest
|
||||
-version, configures it, compiles it, uninstalls the currently installed
|
||||
-version and then installs the new version wherever the current version
|
||||
-was installed.
|
||||
-
|
||||
=item C<-p>, C<--prefix>
|
||||
|
||||
Print the prefix directory under which I<libslack> was installed.
|
||||
@@ -100,10 +84,6 @@
|
||||
|
||||
Print the linker flags needed to link code against I<libslack>.
|
||||
|
||||
-=item C<-u>, C<--uninstall>
|
||||
-
|
||||
-Uninstall I<libslack>.
|
||||
-
|
||||
=back
|
||||
|
||||
=head1 SEE ALSO
|
||||
diff -Naur libslack-0.6.orig/libslack-config.t libslack-0.6/libslack-config.t
|
||||
--- libslack-0.6.orig/libslack-config.t 2010-06-12 15:37:00.000000000 +0200
|
||||
+++ libslack-0.6/libslack-config.t 2013-01-02 19:55:45.772706368 +0100
|
||||
@@ -45,13 +45,10 @@
|
||||
-h, --help - Print this help and exit
|
||||
-v, --version - Print the version of the currently installed libslack
|
||||
-L, --latest - Print the latest version of libslack (uses wget)
|
||||
- -D, --download - Download the latest version of libslack (uses wget)
|
||||
- -U, --upgrade - Upgrade to the latest version of libslack (uses wget)
|
||||
-p, --prefix - Print the prefix directory of the libslack installation
|
||||
-c, --cflags - Print CFLAGS needed to compile clients of libslack
|
||||
-l, --libs - Print LDFLAGS needed to link against libslack
|
||||
-l, --ldflags - Identical to --libs
|
||||
- -u, --uninstall - Uninstall libslack
|
||||
|
||||
Note: the dashes are optional for long option names
|
||||
|
||||
@@ -102,37 +99,6 @@
|
||||
'
|
||||
}
|
||||
|
||||
-download()
|
||||
-{
|
||||
- latest="`latest 2>&1`"
|
||||
- test "$latest" = "No versions found at ${url}download" && die "$latest"
|
||||
- file="`echo $latest | sed 's/^.*\///'`"
|
||||
- test -f "$file" && die "The file $file already exists"
|
||||
- wget "$latest"
|
||||
-}
|
||||
-
|
||||
-upgrade()
|
||||
-{
|
||||
- latest="`latest 2>&1`"
|
||||
- test "$latest" = "No versions found at ${url}/download" && die "$latest"
|
||||
- file="`echo $latest | sed 's/^.*\///'`"
|
||||
- dir="`echo $file | sed 's/\.tar\.gz$//'`"
|
||||
- test -f "$file" || wget "$latest"
|
||||
- test -s "$file" || die "Failed to download $latest"
|
||||
- tar xzf "$file" || die "Failed to untar $file"
|
||||
- cd "$dir" || die "Failed to cd $dir"
|
||||
- ./configure || die "Failed to configure $dir"
|
||||
- make || die "Failed to make $dir"
|
||||
- uninstall || die "Failed to uninstall current version"
|
||||
- make PREFIX="$prefix" install || die "Failed to install $dir into $prefix"
|
||||
- cd .. && rm -rf "$dir"
|
||||
-}
|
||||
-
|
||||
-uninstall()
|
||||
-{
|
||||
-@@UNINSTALL@@
|
||||
-}
|
||||
-
|
||||
test $# -eq 0 && usage 1 1>&2
|
||||
|
||||
while test $# -gt 0
|
||||
@@ -141,13 +107,10 @@
|
||||
-h|--help|help) usage 0;;
|
||||
-v|--version|version) echo "$version";;
|
||||
-L|--latest|latest) latest;;
|
||||
- -D|--download|download) download;;
|
||||
- -U|--upgrade|upgrade) upgrade;;
|
||||
-p|--prefix|prefix) echo "$prefix";;
|
||||
-c|--cflags|cflags) echo "$cflags";;
|
||||
-l|--libs|libs) echo "$libs";;
|
||||
-l|--ldflags|ldflags) echo "$libs";;
|
||||
- -u|--uninstall|uninstall) uninstall;;
|
||||
*) usage 1 >&2;;
|
||||
esac
|
||||
shift
|
19
libraries/libslack/slack-desc
Normal file
19
libraries/libslack/slack-desc
Normal file
|
@ -0,0 +1,19 @@
|
|||
# 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------------------------------------------------------|
|
||||
libslack: libslack (General programmers' utilities)
|
||||
libslack:
|
||||
libslack: Libslack is a library of general utilities designed to make UNIX/C
|
||||
libslack: programming a bit easier on the eye. It is a seemingly random
|
||||
libslack: collection of commonly useful modules and functions.
|
||||
libslack: It was originally implemented as part of the daemon program
|
||||
libslack: (although some of the code dates back much further).
|
||||
libslack:
|
||||
libslack: homepage: http://libslack.org
|
||||
libslack:
|
||||
libslack:
|
Loading…
Reference in a new issue