Browse Source

libraries/liblzf: Added (data compression library).

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
pull/186/head
Isaac Yu 3 years ago
committed by Willy Sudiarto Raharjo
parent
commit
dd50ce26ed
  1. 1
      libraries/liblzf/README
  2. 309
      libraries/liblzf/liblzf-3.6-autoconf-20140314.patch
  3. 116
      libraries/liblzf/liblzf.SlackBuild
  4. 10
      libraries/liblzf/liblzf.info
  5. 19
      libraries/liblzf/slack-desc

1
libraries/liblzf/README

@ -0,0 +1 @@
libLZF is a very small data compression library.

309
libraries/liblzf/liblzf-3.6-autoconf-20140314.patch

@ -0,0 +1,309 @@
diff -uNr liblzf-3.6.ORIG/bootstrap.sh liblzf-3.6/bootstrap.sh
--- liblzf-3.6.ORIG/bootstrap.sh 1970-01-01 00:00:00.000000000 +0000
+++ liblzf-3.6/bootstrap.sh 2014-03-13 08:10:49.132000000 +0000
@@ -0,0 +1,10 @@
+#!/bin/sh
+set -x
+mkdir -p config
+aclocal -I config
+#aclocal-1.10 -I config
+autoheader
+libtoolize --automake
+automake --add-missing --copy --foreign
+#automake-1.10 --add-missing --copy
+autoconf
diff -uNr liblzf-3.6.ORIG/config.h.in liblzf-3.6/config.h.in
--- liblzf-3.6.ORIG/config.h.in 2014-03-13 08:10:30.234000000 +0000
+++ liblzf-3.6/config.h.in 2014-03-13 08:10:49.133000000 +0000
@@ -1,16 +1,89 @@
-/* config.h.in. Generated automatically from configure.in by autoheader 2.13. */
+/* config.h.in. Generated from configure.ac by autoheader. */
-/* Define to empty if the keyword does not work. */
-#undef const
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the <errno.h> header file. */
+#undef HAVE_ERRNO_H
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define to 1 if you have the <getopt.h> header file. */
+#undef HAVE_GETOPT_H
+
+/* Define to 1 if you have the `getopt_long' function. */
+#undef HAVE_GETOPT_LONG
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdio.h> header file. */
+#undef HAVE_STDIO_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
-/* Define if you have the ANSI C header files. */
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#undef LT_OBJDIR
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
-/* The number of bytes in a int. */
-#undef SIZEOF_INT
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
-/* The number of bytes in a long. */
-#undef SIZEOF_LONG
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
-/* The number of bytes in a short. */
-#undef SIZEOF_SHORT
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+#undef inline
+#endif
diff -uNr liblzf-3.6.ORIG/configure.ac liblzf-3.6/configure.ac
--- liblzf-3.6.ORIG/configure.ac 2014-03-13 08:10:30.233000000 +0000
+++ liblzf-3.6/configure.ac 2014-03-13 08:10:49.133000000 +0000
@@ -1,9 +1,65 @@
-AC_INIT
-AC_CONFIG_SRCDIR([lzfP.h])
+AC_INIT(lzf.c)
+
+AC_CONFIG_AUX_DIR(config)
+
+AC_CANONICAL_SYSTEM
+AM_CONFIG_HEADER(config.h)
+AC_CHECK_HEADERS(getopt.h)
+
+
+
+dnl uncomment when tagging
+#RELEASE=TRUE
+
+VER_ARCHITECTURE=3
+VER_MAJOR=6
+VER_MINOR=0
+VER_PATCH=0
+if test "A" = A$RELEASE; then
+ VER_PATCH=${VER_PATCH}_`date '+20%y%m%d%H'`
+fi
+
+AM_INIT_AUTOMAKE(liblzf,$VER_ARCHITECTURE.$VER_MAJOR.$VER_MINOR,"http://software.schmorp.de/pkg/liblzf")
+AC_SUBST(VER_ARCHITECTURE)
+AC_SUBST(VER_MAJOR)
+AC_SUBST(VER_MINOR)
+AC_SUBST(VER_PATCH)
+
+LIBRARY_VERSION="1:0:0"
+
+AC_SUBST(LIBRARY_VERSION)
+
+
+#
+# Wall
+#
+AC_CACHE_CHECK([for maximum warnings compiler flag],
+ ac_cv_cwflag,
+[case "${CC-cc}" in
+ *gcc*) ac_cv_cwflag="-Wall -pedantic -pipe -O3 -funroll-all-loops";;
+ *)
+ ;;
+esac])
+AC_SUBST([CWFLAG], [$ac_cv_cwflag])
+
+AM_PROG_LIBTOOL
+AC_PROG_LN_S
+AC_CHECK_HEADERS([limits.h])
+AC_CHECK_HEADERS([errno.h])
+AC_CHECK_HEADERS([fcntl.h])
+AC_CHECK_HEADERS([stdio.h])
+LT_INIT
+
+AC_CONFIG_SRCDIR([lzf_c.c])
+
+
+if test "${prefix}" = NONE ; then
+ liblzf_prefix=/usr/local
+else
+ liblzf_prefix=${prefix}
+fi
-AC_CONFIG_HEADER(config.h)
-AC_GNU_SOURCE
AC_SYS_LARGEFILE
AC_PROG_CC
AC_PROG_RANLIB
@@ -14,12 +70,6 @@
AC_C_INLINE
AC_CHECK_HEADERS(getopt.h)
AC_CHECK_FUNCS(getopt_long)
+AC_SUBST(ac_aux_dir)
-if test "$GCC" = yes; then
- CFLAGS="$CFLAGS -O3 -funroll-all-loops"
-else
- AC_MSG_RESULT(no gcc)
-fi
-
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
+AC_OUTPUT(Makefile liblzf.pc)
diff -uNr liblzf-3.6.ORIG/liblzf.pc.in liblzf-3.6/liblzf.pc.in
--- liblzf-3.6.ORIG/liblzf.pc.in 1970-01-01 00:00:00.000000000 +0000
+++ liblzf-3.6/liblzf.pc.in 2014-03-13 08:10:49.134000000 +0000
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: liblzf
+Description: Small data compression library
+URL: http://oldhome.schmorp.de/marc/liblzf.html
+Version: @VERSION@
+Libs: -L${libdir} -llzf
+Cflags: -I${includedir}
diff -uNr liblzf-3.6.ORIG/Makefile.am liblzf-3.6/Makefile.am
--- liblzf-3.6.ORIG/Makefile.am 1970-01-01 00:00:00.000000000 +0000
+++ liblzf-3.6/Makefile.am 2014-03-13 08:12:06.195000000 +0000
@@ -0,0 +1,74 @@
+$(PROGRAMS): $(LDEPS)
+
+
+
+h_sources = lzf.h lzfP.h
+c_sources = lzf_c.c \
+ lzf_d.c \
+ crc32.h \
+ lzfP.h
+
+
+library_includedir="$(includedir)"
+
+
+INCLUDES = -I$(includedir) -DLOCALEDIR=\"$(localedir)\"
+
+library_include_HEADERS = $(h_sources)
+
+lib_LTLIBRARIES = liblzf.la
+
+liblzf_la_SOURCES = $(c_sources)
+liblzf_la_LDFLAGS = -no-undefined -version-info $(LIBRARY_VERSION)
+
+bin_PROGRAMS = lzf
+lzf_SOURCES = lzf.c
+lzf_LDADD = $(LDADDS) liblzf.la
+topdir=@RPM_DIR@
+
+
+AUX_DIST = $(ac_aux_dir)/config.guess \
+ $(ac_aux_dir)/config.sub \
+ $(ac_aux_dir)/install-sh \
+ $(ac_aux_dir)/ltmain.sh \
+ $(ac_aux_dir)/missing \
+ $(ac_aux_dir)/ltconfig \
+ $(ac_aux_dir)/ltmain.sh
+
+MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure config-h.in \
+ stamp-h.in $(AUX_DIST)
+
+ACLOCAL = aclocal -I $(ac_aux_dir)
+
+
+dist-hook:
+ (cd $(distdir); \
+ if [ -a $(ac_aux_dir) ]; then \
+ echo "config exist!"; \
+ else \
+ mkdir $(ac_aux_dir); \
+ fi)
+ (if [ -a $(ac_aux_dir)/depcomp ]; then \
+ echo "depcomp exist!"; \
+ else \
+ touch $(ac_aux_dir)/depcomp; \
+ fi)
+ for file in $(AUX_DIST) $(AUX_DIST_EXTRA); do \
+ cp $$file $(distdir)/$$file; \
+ done
+
+docfiles = \
+ LICENSE \
+ Changes \
+ README
+
+
+csCLZFfiles = \
+ cs/CLZF.cs \
+ cs/README
+
+EXTRA_DIST = $(docfiles) $(csCLZFfiles) bootstrap.sh
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = liblzf.pc
+
diff -uNr liblzf-3.6.ORIG/Makefile.in liblzf-3.6/Makefile.in
--- liblzf-3.6.ORIG/Makefile.in 2014-03-13 08:10:30.233000000 +0000
+++ liblzf-3.6/Makefile.in 2014-03-13 08:13:08.090000000 +0000
@@ -41,6 +41,7 @@
$(INSTALL) -m 755 lzf $(bindir)
$(INSTALL) -d $(includedir)
$(INSTALL_DATA) lzf.h $(includedir)
+ $(INSTALL_DATA) lzfP.h $(includedir)
$(INSTALL) -d $(libdir)
$(INSTALL_DATA) liblzf.a $(libdir)

116
libraries/liblzf/liblzf.SlackBuild

@ -0,0 +1,116 @@
#!/bin/bash
# Slackware build script for liblzf
# Copyright 2022 Isaac Yu <isaacyu1@isaacyu1.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.
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=liblzf
VERSION=${VERSION:-3.6}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
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" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -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
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 {} \;
# Apply autoconf patch from Fedora (build dynamic libraries, fix install locations):
# https://src.fedoraproject.org/rpms/liblzf/blob/master/f/liblzf-3.6-autoconf-20140314.patch
patch -p1 < $CWD/liblzf-3.6-autoconf-20140314.patch
chmod +x bootstrap.sh && ./bootstrap.sh
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 DESTDIR=$PKG
# Don't ship .la files:
rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la
# the binary does different things depending on the name it is called by
ln -s lzf $PKG/usr/bin/unlzf
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 Changes 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

10
libraries/liblzf/liblzf.info

@ -0,0 +1,10 @@
PRGNAM="liblzf"
VERSION="3.6"
HOMEPAGE="http://software.schmorp.de/pkg/liblzf.html"
DOWNLOAD="http://dist.schmorp.de/liblzf/liblzf-3.6.tar.gz"
MD5SUM="b8d23b8258d785707a61fc3dd159c04e"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
MAINTAINER="Isaac Yu"
EMAIL="isaacyu1@isaacyu1.com"

19
libraries/liblzf/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------------------------------------------------------|
liblzf: liblzf (data compression library)
liblzf:
liblzf: libLZF is is a very small data compression library.
liblzf:
liblzf:
liblzf:
liblzf:
liblzf:
liblzf:
liblzf:
liblzf:
Loading…
Cancel
Save