libraries/libcsv: Added (a small/simple/fast CSV library)

This commit is contained in:
Tarantino Antonino 2010-05-11 00:07:12 -05:00 committed by Robby Workman
parent 0903f0f57c
commit 034c53e7b8
5 changed files with 153 additions and 0 deletions

View file

@ -0,0 +1,25 @@
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

4
libraries/libcsv/README Normal file
View file

@ -0,0 +1,4 @@
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.

View file

@ -0,0 +1,96 @@
#!/bin/sh
# 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.
PRGNAM=libcsv
VERSION=${VERSION:-"3.0.0"}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
# Automatically determine architecture for build & packaging:
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) export ARCH=i486 ;;
# Unless $ARCH is already set, use uname -m for all other archs:
*) export 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" = "s390" ]; then
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi
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
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 {} \;
# 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/*
mkdir $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}

View file

@ -0,0 +1,10 @@
PRGNAM="libcsv"
VERSION="3.0.0"
HOMEPAGE="http://sourceforge.net/projects/libcsv/"
DOWNLOAD="http://downloads.sourceforge.net/libcsv/libcsv-3.0.0.tar.gz"
MD5SUM="04ade4e8198c920c7e7857c47e24b818"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
MAINTAINER="Tarantino Antonino"
EMAIL="metrofox9@gmail.com"
APPROVED="rworkman"

View file

@ -0,0 +1,18 @@
# 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 ':'.
|-----handy-ruler--------------------------------------------------------|
libcsv: libcsv( CSV's Library )
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: