From b7da3c85f01bcadeb607f48b3d9e73bef9539c4b Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Wed, 26 Jan 2022 13:39:58 -0500 Subject: libraries/libcsv: version update, new maintainer. Signed-off-by: B. Watson Signed-off-by: Willy Sudiarto Raharjo --- libraries/libcsv/Makefile.patch | 25 --------- libraries/libcsv/README | 15 ++++-- libraries/libcsv/git2tarxz.sh | 48 +++++++++++++++++ libraries/libcsv/libcsv.SlackBuild | 108 +++++++++++++++++-------------------- libraries/libcsv/libcsv.info | 12 ++--- libraries/libcsv/slack-desc | 12 ++--- 6 files changed, 121 insertions(+), 99 deletions(-) delete mode 100644 libraries/libcsv/Makefile.patch create mode 100644 libraries/libcsv/git2tarxz.sh (limited to 'libraries/libcsv') diff --git a/libraries/libcsv/Makefile.patch b/libraries/libcsv/Makefile.patch deleted file mode 100644 index bb2aedbd13..0000000000 --- a/libraries/libcsv/Makefile.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff -Nur libcsv-3.0.0.orig//Makefile libcsv-3.0.0/Makefile ---- libcsv-3.0.0.orig//Makefile 2008-07-26 20:48:28.000000000 -0500 -+++ libcsv-3.0.0/Makefile 2010-05-11 00:01:39.900783556 -0500 -@@ -17,6 +17,7 @@ - install_static: install_headers install_static_lib - - install_man: csv.3.gz -+ mkdir -p $(DESTDIR)$(MANDIR)/ - cp -f $^ $(DESTDIR)$(MANDIR)/ - - install_headers: csv.h -@@ -24,11 +25,13 @@ - cp -f $^ $(DESTDIR)$(INCDIR)/libcsv/ - - install_shared_lib: libcsv.so -+ mkdir -p $(DESTDIR)$(LIBDIR) - cp -f $< $(DESTDIR)$(LIBDIR)/$<.$(VERSION) - ln -sf $<.$(VERSION) $(DESTDIR)$(LIBDIR)/$<.3 - ln -sf $<.3 $(DESTDIR)$(LIBDIR)/$< - - install_static_lib: libcsv.a -+ mkdir -p $(DESTDIR)$(LIBDIR) - cp -f $< $(DESTDIR)$(LIBDIR)/$< - - libcsv.o: libcsv.c csv.h diff --git a/libraries/libcsv/README b/libraries/libcsv/README index 3807591eab..5aa5a05aeb 100644 --- a/libraries/libcsv/README +++ b/libraries/libcsv/README @@ -1,4 +1,11 @@ -libcsv is a small, simple and fast CSV library written in pure ANSI C89 that -can read and write CSV data. It provides a straight-forward interface using -callback functions to handle parsed fields and rows and can parse improperly -formatted CSV files. +libcsv (library to read/write comma-separated-value data) + +libcsv is a small, simple and fast CSV library written in pure ANSI +C89 that can read and write CSV[*] data. It provides a straightforward +interface using callback functions to handle fields and rows, and can +parse improperly formatted CSV files. + +[*] libcsv is capable of using any delimter, not just commas. + +For command-line tools that use this library to manipulate CSV files, +see system/csvutils. diff --git a/libraries/libcsv/git2tarxz.sh b/libraries/libcsv/git2tarxz.sh new file mode 100644 index 0000000000..fe2851eff9 --- /dev/null +++ b/libraries/libcsv/git2tarxz.sh @@ -0,0 +1,48 @@ +#!/bin/sh + +# Create source tarball from git repo, with generated version +# number. + +# Note that this script doesn't need to be run as root. It does +# need to be able to write to the current directory it's run from. + +# Takes one optional argument, which is the commit or tag to create +# a tarball of. With no arg, HEAD is used. + +PRGNAM=libcsv +CLONE_URL=https://github.com/rgamble/libcsv + +# upstream doesn't use tags. libcsv was moved to github after +# this release. +OLDVER=3.0.3 + +set -e + +GITDIR=$( mktemp -dt $PRGNAM.git.XXXXXX ) +rm -rf $GITDIR +git clone $CLONE_URL $GITDIR + +CWD="$( pwd )" +cd $GITDIR + +if [ "$1" != "" ]; then + git reset --hard "$1" || exit 1 +fi + +GIT_SHA=$( git rev-parse --short HEAD ) + +DATE=$( git log --date=format:%Y%m%d --format=%cd | head -1 ) + +VERSION=$OLDVER+${DATE}_${GIT_SHA} + +rm -rf .git +find . -name .gitignore -print0 | xargs -0 rm -f + +cd "$CWD" +rm -rf $PRGNAM-$VERSION $PRGNAM-$VERSION.tar.xz +mv $GITDIR $PRGNAM-$VERSION +tar cvfJ $PRGNAM-$VERSION.tar.xz $PRGNAM-$VERSION + +echo +echo "Created tarball: $PRGNAM-$VERSION.tar.xz" +echo "VERSION=$VERSION" diff --git a/libraries/libcsv/libcsv.SlackBuild b/libraries/libcsv/libcsv.SlackBuild index 7ea9dcdbd5..04e12127a3 100644 --- a/libraries/libcsv/libcsv.SlackBuild +++ b/libraries/libcsv/libcsv.SlackBuild @@ -1,43 +1,37 @@ #!/bin/bash -# Copyright 2008, 2009, 2010 Tarantino Antonino, Palermo, Italy. -# 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. +# Originally written by Tarantino Antonino. +# Modified and now maintained by B. Watson + +# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. + +# This project used to live on sourceforge, where it hadn't been +# updated in years. However the author moved to github, and started +# maintaining it there... there hasn't been a new release yet, but +# there have been some bugfixes that are worth having. + +# 20220126 bkw: +# - take over maintenance. +# - relicense as WTFPL, with permission from Tarantino. +# - update for v3.0.3 + latest git. +# - rework script for autotools. +# - don't install INSTALL in doc dir. cd $(dirname $0) ; CWD=$(pwd) PRGNAM=libcsv -VERSION=${VERSION:-"3.0.0"} +VERSION=${VERSION:-"3.0.3+20210820_b1d5212"} 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 ;; *) ARCH=$( uname -m ) ;; esac fi -# 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 @@ -47,11 +41,11 @@ 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" = "s390" ]; then - SLKCFLAGS="-O2" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" @@ -61,41 +55,39 @@ else LIBDIRSUFFIX="" fi +set -e + rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$VERSION -tar xvf $CWD/$PRGNAM-$VERSION.tar.?z* || exit 1 -cd $PRGNAM-$VERSION || exit 1 +tar xvf $CWD/$PRGNAM-$VERSION.tar.?z* +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 {} \; - -# Make sure the Makefile creates all needed directories before installing -patch -p1 < $CWD/Makefile.patch - -make \ - CC="gcc $SLKCFLAGS" \ - LIBDIR=/usr/lib${LIBDIRSUFFIX} \ - MANDIR=/usr/man/man3 - -make install \ - CC="gcc $SLKCFLAGS" \ - LIBDIR=/usr/lib${LIBDIRSUFFIX} \ - MANDIR=/usr/man/man3 \ - DESTDIR=$PKG - -find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ - | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true - -mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp -a \ - Changelog FAQ INSTALL LICENSE README \ - $PKG/usr/doc/$PRGNAM-$VERSION -chmod 0644 $PKG/usr/doc/$PRGNAM-$VERSION/* +find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \ + \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+ + +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --mandir=/usr/man \ + --docdir=/usr/doc/$PRGNAM-$VERSION \ + --disable-static \ + --build=$ARCH-slackware-linux + +make +make install-strip DESTDIR=$PKG +rm -f $PKG/usr/lib*/*.la +gzip -9 $PKG/usr/man/man*/* + +# don't bother with csv.pdf: it's just the man page. +PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION +mkdir -p $PKGDOC +cp -a examples COPYING* ChangeLog FAQ README $PKGDOC mkdir $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc diff --git a/libraries/libcsv/libcsv.info b/libraries/libcsv/libcsv.info index 252aa8056d..b4dbc30ed0 100644 --- a/libraries/libcsv/libcsv.info +++ b/libraries/libcsv/libcsv.info @@ -1,10 +1,10 @@ PRGNAM="libcsv" -VERSION="3.0.0" -HOMEPAGE="https://sourceforge.net/projects/libcsv/" -DOWNLOAD="https://downloads.sourceforge.net/libcsv/libcsv-3.0.0.tar.gz" -MD5SUM="04ade4e8198c920c7e7857c47e24b818" +VERSION="3.0.3+20210820_b1d5212" +HOMEPAGE="https://github.com/rgamble/libcsv" +DOWNLOAD="https://slackware.uk/~urchlay/src/libcsv-3.0.3+20210820_b1d5212.tar.xz" +MD5SUM="773f34c4fd7976791dc6cdb8f9f0d4a5" DOWNLOAD_x86_64="" MD5SUM_x86_64="" REQUIRES="" -MAINTAINER="Tarantino Antonino" -EMAIL="metrofox9@gmail.com" +MAINTAINER="B. Watson" +EMAIL="yalhcru@gmail.com" diff --git a/libraries/libcsv/slack-desc b/libraries/libcsv/slack-desc index 3d161cf305..04a1f0bdfa 100644 --- a/libraries/libcsv/slack-desc +++ b/libraries/libcsv/slack-desc @@ -6,14 +6,14 @@ # customary to leave one space after the ':' except on otherwise blank lines. |-----handy-ruler------------------------------------------------------| -libcsv: libcsv (CSV's Library) +libcsv: libcsv (library to read/write comma-separated-value data) +libcsv: +libcsv: libcsv is a small, simple and fast CSV library written in pure ANSI +libcsv: C89 that can read and write CSV data. It provides a straightforward +libcsv: interface using callback functions to handle fields and rows, and can +libcsv: parse improperly formatted CSV files. libcsv: -libcsv: libcsv is a small, simple and fast CSV library written in pure -libcsv: ANSI C89 that can read and write CSV data. It provides a -libcsv: straight-forward interface using callback functions to handle -libcsv: fields and rows and can parse improperly formatted CSV files. libcsv: libcsv: libcsv: -libcsv: Homepage: http://sourceforge.net/projects/libcsv/ libcsv: -- cgit v1.2.3-80-g2a13