aboutsummaryrefslogtreecommitdiff
path: root/libraries
diff options
context:
space:
mode:
authorLarry Hajali <larryhaja[at]gmail[dot]com>2015-11-10 23:22:26 -0600
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2015-11-14 07:07:34 +0700
commit9b35a6da207c467a1fb2bcafe7cd23ea47e0f276 (patch)
tree3a84b02b61a27fcec0220e5b7f7c620dd47f7e0e /libraries
parent05d4adbc63c5b8b022fef487a0d30d6ff36aaf3f (diff)
libraries/libb64: Added (C routines for base64 encoding/decoding)
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'libraries')
-rw-r--r--libraries/libb64/README7
-rw-r--r--libraries/libb64/libb64.SlackBuild99
-rw-r--r--libraries/libb64/libb64.info10
-rw-r--r--libraries/libb64/shared-library.patch25
-rw-r--r--libraries/libb64/slack-desc19
5 files changed, 160 insertions, 0 deletions
diff --git a/libraries/libb64/README b/libraries/libb64/README
new file mode 100644
index 000000000000..13f621dacf80
--- /dev/null
+++ b/libraries/libb64/README
@@ -0,0 +1,7 @@
+libb64 is a library of ANSI C routines for fast encoding/decoding data into and
+from a base64-encoded format. C++ wrappers are included, as well as the source
+code for standalone encoding and decoding executables.
+
+Base64 uses a subset of displayable ASCII characters, and is therefore a useful
+encoding for storing binary data in a text file, such as XML, or sending binary
+data over text-only email.
diff --git a/libraries/libb64/libb64.SlackBuild b/libraries/libb64/libb64.SlackBuild
new file mode 100644
index 000000000000..ddc45518bd42
--- /dev/null
+++ b/libraries/libb64/libb64.SlackBuild
@@ -0,0 +1,99 @@
+#!/bin/sh
+
+# Slackware build script for libb64
+
+# Copyright 2015 Larry Hajali <larryhaja[at]gmail[dot]com>
+# 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=libb64
+VERSION=${VERSION:-1.2.1}
+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
+unzip $CWD/$PRGNAM-$VERSION.zip
+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 640 -o -perm 600 -o -perm 444 \
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+
+# Fix warnings as errors.
+sed -i 's|-Werror||' */Makefile
+# Build shared library.
+patch -p0 < $CWD/shared-library.patch
+
+CFLAGS="$SLKCFLAGS" make
+
+# Manually install.
+mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}
+#install -m 0644 src/libb64.a $PKG/usr/lib${LIBDIRSUFFIX}
+install -m 0755 src/libb64.so.0 $PKG/usr/lib${LIBDIRSUFFIX}
+ln -s /usr/lib${LIBDIRSUFFIX}/$PRGNAM.so.0 $PKG/usr/lib${LIBDIRSUFFIX}/$PRGNAM.so
+mv include $PKG/usr
+
+find $PKG -print0 | xargs -0 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 \
+ AUTHORS BENCHMARKS CHANGELOG INSTALL LICENSE README \
+ $PKG/usr/doc/$PRGNAM-$VERSION
+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}
diff --git a/libraries/libb64/libb64.info b/libraries/libb64/libb64.info
new file mode 100644
index 000000000000..d30e6a8ea405
--- /dev/null
+++ b/libraries/libb64/libb64.info
@@ -0,0 +1,10 @@
+PRGNAM="libb64"
+VERSION="1.2.1"
+HOMEPAGE="http://libb64.sourceforge.net/"
+DOWNLOAD="http://downloads.sourceforge.net/libb64/libb64-1.2.1.zip"
+MD5SUM="8a5dc72eb7e32f074605260bc127c764"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES=""
+MAINTAINER="Larry Hajali"
+EMAIL="larryhaja[at]gmail[dot]com"
diff --git a/libraries/libb64/shared-library.patch b/libraries/libb64/shared-library.patch
new file mode 100644
index 000000000000..0cd2bf234f87
--- /dev/null
+++ b/libraries/libb64/shared-library.patch
@@ -0,0 +1,25 @@
+--- src/Makefile~
++++ src/Makefile
+@@ -1,4 +1,5 @@
+-LIBRARIES = libb64.a
++LIBRARIES = libb64.a libb64.so
++SOVERSION ?= 0
+
+ # Build flags (uncomment one)
+ #############################
+@@ -27,6 +28,15 @@ all: $(TARGETS) #strip
+ libb64.a: cencode.o cdecode.o
+ $(AR) $(ARFLAGS) $@ $^
+
++libb64.so.$(SOVERSION): cencode.So cdecode.So
++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-soname,$@ -o $@ $^
++
++%.So: %.c
++ $(CC) -fPIC -c $(CFLAGS) $(CPPFLAGS) $< -o $@
++
++%.so: %.so.$(SOVERSION)
++ ln -fs $< $@
++
+ strip:
+ strip $(BINARIES) *.exe
+
diff --git a/libraries/libb64/slack-desc b/libraries/libb64/slack-desc
new file mode 100644
index 000000000000..341c48ffe84b
--- /dev/null
+++ b/libraries/libb64/slack-desc
@@ -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------------------------------------------------------|
+libb64: libb64 (C routines for base64 encoding/decoding)
+libb64:
+libb64: libb64 is a library of ANSI C routines for fast encoding/decoding data
+libb64: into and from a base64-encoded format. C++ wrappers are included, as
+libb64: well as the source code for standalone encoding and decoding
+libb64: executables.
+libb64:
+libb64: Homepage: http://libb64.sourceforge.net/
+libb64:
+libb64:
+libb64: