Commits

Anonymous committed 4c9e7e6

Add compface to veclinux-7.1

Signed-off-by: Lee Pak Hong <benreilly@vector.Linux.net>

  • Participants
  • Parent commits e9f2b22

Comments (0)

Files changed (3)

File var/vabs/compface/src/compface.SlackBuild

+#!/usr/bin/bash
+# This script assumes it will be launched within "/NAME/VERSION/src" dir.
+# With all sources in "src" Your Vector Linux .txz package, slack-desc,
+# and slack-required will be found in "VERSION" dir. The extraction and
+# build will be in a temp dir created in "NAME" dir, and then removed on exit.
+# Comment out second to last line to keep this dir intact.
+#
+# This Template was compiled from the contributions of many users of the Vector
+# Linux forum at http://forum.vectorlinux.com and from tidbits collected 
+# from all over the internet. 
+#
+# Generated by sbbuilder-0.4.14.1, written by Rodrigo Bistolfi 
+# (rbistolfi) and Raimon Grau Cuscó (Kidd) for VectorLinux.
+#
+# Please put your name below if you add some original scripting lines.
+# AUTHORS = 
+
+NAME="compface"            #Enter package Name!
+VERSION=${VERSION:-"1.5.2"}      #Enter package Version!
+VER=$(echo $VERSION|sed 's/-/_/') #this fixes - in version
+VL_PACKAGER=${VL_PACKAGER:-"hata_ph"}   #Enter your Name!
+LINK=${LINK:-"http://ftp.xemacs.org/pub/xemacs/aux/$NAME-$VERSION.tar.gz"}  #Enter URL for package here!
+
+
+#SYSTEM VARIABLES
+#----------------------------------------------------------------------------
+BUILDNUM=${BUILDNUM:-"1"}
+VL_VERSION=${VL_VERSION:-"$(ls /var/log/packages/|grep vlconfig2|cut -d "-" -f4|cut -c 2-5)"}
+BUILD=${BUILD:-"$BUILDNUM""$VL_VERSION"}
+ARCH=${ARCH:-"$(uname -m)"}
+CONFIG_OPTIONS=${CONFIG_OPTIONS:-""}
+LDFLAG_OPTIONS=${LDFLAG_OPTIONS:-""}
+ADDRB=${ADDRB:-""} #Add deps that need to be added to the slack-required file here
+EXRB=${EXRB:-""} #Add deps that need to be excluded from the slack-required file here
+MAKEDEPENDS=${MAKEDEPENDS:-""} #Add deps needed TO BUILD this package here.
+#----------------------------------------------------------------------------
+
+# DO NOT EXECUTE if NORUN is set to 1
+if [ "$NORUN" != "1" ]; then
+
+#SETUP PACKAGING ENVIRONMENT
+#--------------------------------------------
+CWD=$(pwd)
+cd ../
+RELEASEDIR=$(pwd)
+cd $CWD
+mkdir -p $RELEASEDIR/tmp
+TMP=$RELEASEDIR/tmp
+PKG=$TMP/package-$NAME
+#--------------------------------------------
+
+
+
+if [ $UID != 0 ]; then
+   echo "You are not authorized to run this script. Please login as root"
+   exit 1
+fi
+
+if [ ! -x /usr/bin/requiredbuilder ]; then
+   echo "Requiredbuilder not installed, or not executable."
+   exit 1
+fi
+
+if [ $VL_PACKAGER = "YOURNAME" ]; then
+   echo 'Who are you?
+   Please edit VL_PACKAGER=${VL_PACKAGER:-YOURNAME} in this script.
+   Change the word "YOURNAME" to your VectorLinux packager name.
+   You may also export VL_PACKAGER, or call this script with
+   VL_PACKAGER="YOUR NAME HERE"'
+   exit 1
+fi
+
+
+#CFLAGS SETUP
+#--------------------------------------------
+if [[ "$ARCH" = i?86 ]]; then
+  ARCH=i586
+  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+  CONFIGURE_TRIPLET="i586-vector-linux"
+  LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+  SLKCFLAGS="-O2 -fpic"
+  CONFIGURE_TRIPLET="x86_64-vlocity-linux"
+  LIBDIRSUFFIX="64"
+elif [ "$ARCH" = "powerpc" ]; then
+  SLKCFLAGS="-O2"
+  CONFIGURE_TRIPLET="powerpc-vlocity-linux"
+  LIBDIRSUFFIX=""
+fi
+
+export CFLAGS="$SLKCFLAGS $CFLAG_OPTIONS"
+export CXXFLAGS=$CFLAGS
+export LDFLAGS="$LDFLAGS $LDFLAG_OPTIONS"
+#--------------------------------------------
+
+
+#GET THE SOURCE
+#--------------------------------------------
+for SRC in $(echo $LINK);do
+if [ ! -f $CWD/$(basename $SRC) ]
+then
+        wget --no-check-certificate -c $SRC
+fi
+done
+#--------------------------------------------
+
+
+rm -rf $PKG
+cd $TMP
+rm -rf $NAME-$VERSION
+
+
+#EXTRACT SOURCES
+#-----------------------------------------------------
+echo "Extracting source..."
+tar xvf $CWD/$NAME-$VERSION.tar.* || exit 1
+#this moves whatever was extracted to the std dirname we are expecting
+mv * $NAME-$VERSION &> /dev/null 2>&1
+mkdir -p $PKG
+#-----------------------------------------------------
+
+
+cd $TMP/$NAME-$VERSION
+
+
+#PATCHES
+#-----------------------------------------------------
+# Put any Patches here *NOTE this only works if all 
+# your patches use the -p1 strip option!
+#-----------------------------------------------------
+for i in $CWD/patches/*;do
+#  patch -p1 <$i
+  mkdir -p $PKG/usr/doc/$NAME-$VERSION/patches/
+  cp $i $PKG/usr/doc/$NAME-$VERSION/patches/
+done
+#-----------------------------------------------------
+ 
+# Apply xbm patch from Debian
+patch -p1 < $CWD/patches/compface-xbm-debian.patch
+# Apply shared lib patch (the default is static)
+patch -p1 < $CWD/patches/compface-sharedlib.patch
+
+#SET PERMISSIONS
+#-----------------------------------------
+echo "Setting permissions..."
+chown -R root:root .
+find . -perm 664 -exec chmod 644 {} \;
+find . -perm 777 -exec chmod 755 {} \;
+find . -perm 2777 -exec chmod 755 {} \;
+find . -perm 775 -exec chmod 755 {} \;
+find . -perm 2755 -exec chmod 755 {} \;
+find . -perm 774 -exec chmod 644 {} \;
+find . -perm 666 -exec chmod 644 {} \;
+find . -perm 600 -exec chmod 644 {} \;
+find . -perm 444 -exec chmod 644 {} \;
+find . -perm 400 -exec chmod 644 {} \;
+find . -perm 440 -exec chmod 644 {} \;
+find . -perm 511 -exec chmod 755 {} \;
+find . -perm 711 -exec chmod 755 {} \;
+find . -perm 555 -exec chmod 755 {} \;
+#-----------------------------------------
+
+
+
+#CONFIGURE & MAKE
+#----------------------------------------------------------------------
+# If you are building a KDE-related app, then change the following
+# arguments in the script below:
+# --prefix=$(kde-config -prefix) \
+# --sysconfdir=/etc/kde \
+#
+# Making these changes will ensure that your package will build in the
+# correct path and that it will work seamlessly within the KDE environment.
+#
+#-----------------------------------------------------------------------
+
+echo "Configuring source..."
+./configure --prefix=/usr \
+  --libdir=/usr/lib${LIBDIRSUFFIX} \
+  --infodir=/usr/info \
+  --sysconfdir=/etc \
+  --localstatedir=/var \
+  --mandir=/usr/man \
+  --with-included-gettext \
+  --disable-debug \
+  --program-prefix="" \
+  --program-suffix="" \
+  --build=$CONFIGURE_TRIPLET \
+  $CONFIG_OPTIONS || exit 1
+
+make || exit 1
+
+# make install ignores DESTDIR
+mkdir -p $PKG/usr/bin $PKG/usr/lib$LIBDIRSUFFIX $PKG/usr/man/man1 $PKG/usr/man/man3 $PKG/usr/include
+install -s -m 0755 compface uncompface $PKG/usr/bin
+gzip -c compface.1 > $PKG/usr/man/man1/compface.1.gz
+gzip -c compface.3 > $PKG/usr/man/man3/compface.3.gz
+install -m 0644 compface.h $PKG/usr/include
+install -m 0644 libcompface.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/libcompface.so.$VERSION
+cd $PKG/usr/lib$LIBDIRSUFFIX ; ln -sf libcompface.so.$VERSION libcompface.so.1
+cd $PKG/usr/man/man1 ; ln -sf compface.1.gz uncompface.1.gz
+cd $TMP/$NAME-$VERSION
+
+#######################################################################
+#Miscellenious tweaks and things outside a normal ./configure go here #
+#######################################################################
+
+
+
+mkdir -p $PKG/usr/doc/$NAME-$VERSION
+cp -a ChangeLog README $PKG/usr/doc/$NAME-$VERSION
+cat $CWD/$NAME.SlackBuild > $PKG/usr/doc/$NAME-$VERSION/$NAME.SlackBuild
+
+#----------------------------------------------------------------------
+
+if [ -d $PKG/usr/share/man ];then
+mkdir -p $PKG/usr/man
+mv $PKG/usr/share/man/* $PKG/usr/man
+rm -rf $PKG/usr/share/man
+fi
+find $PKG/usr/man -type f -exec gzip -9 {} \;
+
+if [ -d $PKG/usr/share/info ];then
+mkdir -p $PKG/usr/info
+mv $PKG/usr/share/info/* $PKG/usr/info
+rm -rf $PKG/usr/share/info
+fi 
+find $PKG/usr/info -type f -exec gzip -9 {} \;
+
+mkdir -p $PKG/install
+if [ -d $PKG/usr/info ];then
+cat >> $PKG/install/doinst.sh << EOF
+CWD=\$(pwd)
+cd usr/info
+if [ -f dir ];then
+    rm dir
+fi
+if [ -f dir.gz ];then
+    rm dir.gz
+fi
+for i in *.info.gz;do
+    install-info \$i dir
+done
+cd \$CWD
+EOF
+fi
+
+# Add schemas install to the doinst.sh if schemas are found.
+if [ -d $PKG/etc/gconf/schemas ];then
+# Make sure we have gconftool installed
+echo "if [ -x usr/bin/gconftool-2 ]; then" >> $PKG/install/doinst.sh
+( cd $PKG/etc/gconf/schemas
+for schema in *.schemas; do
+ # Install schemas
+ echo "GCONF_CONFIG_SOURCE=\"xml::etc/gconf/gconf.xml.defaults\" \
+   usr/bin/gconftool-2 --makefile-install-rule \
+   etc/gconf/schemas/${schema} >/dev/null 2>&1" \
+   >> $PKG/install/doinst.sh
+done;
+)
+# Finish off gconf block
+echo "fi" >> $PKG/install/doinst.sh
+fi
+
+cat >> $PKG/install/doinst.sh << EOF
+# update rarian database
+if [ -x usr/bin/rarian-sk-update ]; then
+  usr/bin/rarian-sk-update 1> /dev/null 2> /dev/null
+fi
+
+# update mime database
+if [ -x usr/bin/update-mime-database ]; then
+  usr/bin/update-mime-database usr/share/mime 1> /dev/null 2> /dev/null
+fi
+
+# update desktop entries
+if [ -x usr/bin/update-desktop-database ]; then
+  usr/bin/update-desktop-database 1> /dev/null 2> /dev/null
+fi
+
+# update hicolor icons
+if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
+	rm -f usr/share/icons/hicolor/icon-theme.cache
+fi
+usr/bin/gtk-update-icon-cache -f -q usr/share/icons/hicolor 1>/dev/null 2>/dev/null
+
+if [ -x /usr/bin/glib-compile-schemas ]; then
+  /usr/bin/glib-compile-schemas usr/share/glib-2.0/schemas/ >/dev/null 2>&1
+fi
+
+# Restart gconfd-2 if running to reload new gconf settings
+if ps acx | grep -q gconfd-2 ; then
+        killall -HUP gconfd-2 ;
+fi
+
+# A good idea whenever kernel modules are added or changed:
+if [ -x sbin/depmod ]; then
+  /sbin/depmod -a 1> /dev/null 2> /dev/null
+fi
+EOF
+
+#if there is a slack-desc in src dir use it
+if test -f $CWD/slack-desc; then
+cp $CWD/slack-desc $RELEASEDIR/slack-desc
+else
+# This creates the white space in front of "handy-ruler" in slack-desc below.
+
+LENGTH=$(expr length "$NAME")
+SPACES=0
+SHIM=""
+until [ "$SPACES" = "$LENGTH" ]; do
+SHIM="$SHIM "
+let SPACES=$SPACES+1
+done
+
+# Fill in the package summary between the () below.
+# Then package the description, License, Author and Website.
+# There may be no more then 11 $NAME: lines in a valid slack-desc.
+
+cat > $RELEASEDIR/slack-desc << EOF
+# 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 ':'.
+
+$SHIM|-----handy-ruler------------------------------------------------------|
+$NAME: $NAME (48x48x1 image compression and decompression)
+$NAME:
+$NAME: Compface converts 48x48x1 images to and from a compressed format.
+$NAME: The purpose is to allow the inclusion of face images within mail
+$NAME: headers using the field name 'X-face:'. It uses the library that
+$NAME: can be used to allow the compression and decompression algorithms
+$NAME: to be used in other programs such as mail dispatchers and mail
+$NAME: notification daemons.
+$NAME:
+$NAME: License: MIT
+$NAME: Authors: http://freecode.com/projects/compface
+$NAME: Website: http://freecode.com/projects/compface
+
+EOF
+fi
+cat >> $RELEASEDIR/slack-desc << EOF
+
+
+
+#----------------------------------------
+BUILDDATE: $(date)
+PACKAGER:  $VL_PACKAGER
+HOST:      $(uname -srm)
+DISTRO:    $(cat /etc/vector-version)
+CFLAGS:    $CFLAGS
+LDFLAGS:   $LDFLAGS
+CONFIGURE: $(awk "/\\$\ \.\/configure\ /" $TMP/$DIRNAME/config.log)
+
+EOF
+
+cat $RELEASEDIR/slack-desc > $PKG/install/slack-desc
+
+#STRIPPING
+#------------------------------------------------------------------------------------------------------------------
+cd $PKG
+echo " "
+echo "Stripping...."
+echo " "
+find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+#------------------------------------------------------------------------------------------------------------------
+
+
+#FINISH PACKAGE
+#--------------------------------------------------------------
+echo "Finding dependencies..."
+ADD="$ADDRB" EXCLUDE="$EXRB" requiredbuilder -v -y -s $RELEASEDIR $PKG
+echo "Creating package $NAME-$VERSION-$ARCH-$BUILD.txz"
+makepkg -l y -c n $RELEASEDIR/$NAME-$VERSION-$ARCH-$BUILD.txz
+
+cd $CWD
+echo "Cleaning up temp files..." && rm -rf $TMP
+echo "Package Complete"
+fi
+#--------------------------------------------------------------
+
+# vim: set tabstop=4 shiftwidth=4 foldmethod=marker : ##

File var/vabs/compface/src/patches/compface-sharedlib.patch

+--- compface-1.5.2.orig/Makefile.in	2005-10-04 14:59:49.000000000 +0200
++++ compface-1.5.2/Makefile.in	2013-02-28 00:12:27.888027519 +0100
+@@ -24,6 +24,7 @@
+ EXECUTABLE	= $(BINDIR)/$(NAMEEXE)
+ UNEXECUTABLE	= $(BINDIR)/$(UNNAMEEXE)
+ LIBNAME		= lib$(NAME).a
++SOLIBNAME	= lib$(NAME).so
+ LIBRARY		= $(LIBDIR)/$(LIBNAME)
+ MAN1DIR		= $(MANDIR)/man1
+ MAN3DIR		= $(MANDIR)/man3
+@@ -41,15 +42,16 @@
+ CFLAGS		= @CFLAGS@
+ DEFS		= @DEFS@ -DHAVE_CONFIG_H
+ LDFLAGS		= @LDFLAGS@
++SHLDFLAGS	= -L. -lcompface
+ LIBS		= @LIBS@
+ 
+-all:		$(NAMEEXE) $(UNNAMEEXE)
++all:		shared $(NAMEEXE) $(UNNAMEEXE)
+ 
+-$(NAMEEXE) :	cmain.o compface.o $(LIBNAME)
+-		$(CC) $(LDFLAGS) -o $@ cmain.o compface.o $(LIBNAME)
++$(NAMEEXE) :	cmain.o compface.o 
++		$(CC) $(LDFLAGS) $(SHLDFLAGS) -o $@ cmain.o compface.o
+ 
+ $(UNNAMEEXE) :	uncmain.o $(LIBNAME)
+-		$(CC) $(LDFLAGS) -o $@ uncmain.o $(LIBNAME)
++		$(CC) $(LDFLAGS) $(SHLDFLAGS) -o $@ uncmain.o
+ 
+ $(LIBNAME) :	$(OBJECTS)
+ 		ar rc $(LIBNAME) $(OBJECTS)
+@@ -92,6 +94,14 @@
+ 		shar.script $(OTHERS) $(HDRS) $(SOURCES) > $(NAME).sh
+ 		compress $(NAME).sh
+ 
++static: $(OBJECTS)
++	ar rc $(LIBNAME) $(OBJECTS)
++	-ranlib $(LIBNAME)
++
++shared:		$(OBJECTS)
++		$(CC) -shared -Wl,-soname,$(SOLIBNAME).1 $(LDFLAGS) -o $(SOLIBNAME).1.5.2 $(OBJECTS)
++		ln -sf $(SOLIBNAME).1.5.2 $(SOLIBNAME)
++
+ .c.o:
+ 	$(CC) -c $(CPPFLAGS) $(DEFS) $(CFLAGS) $<
+ 

File var/vabs/compface/src/patches/compface-xbm-debian.patch

+diff -Naur compface-1.5.2.orig/compface.c compface-1.5.2/compface.c
+--- compface-1.5.2.orig/compface.c	2005-10-04 14:28:47.000000000 +0200
++++ compface-1.5.2/compface.c	2013-02-27 20:37:04.022999237 +0100
+@@ -19,7 +19,7 @@
+ #include "config.h"
+ #endif
+ 
+-#include "compface_private.h"
++#include "compface.h"
+ 
+ int
+ compface(fbuf)
+diff -Naur compface-1.5.2.orig/compface.h compface-1.5.2/compface.h
+--- compface-1.5.2.orig/compface.h	2005-10-04 14:29:00.000000000 +0200
++++ compface-1.5.2/compface.h	2013-02-27 20:43:45.252969068 +0100
+@@ -143,7 +143,6 @@
+ int AllWhite P((char *, int, int)) ;
+ int BigPop P((Prob *)) ;
+ int compface P((char *)) ;
+-int main P((int, char *[])) ;
+ int ReadBuf P(()) ;
+ int Same P((char *, int, int)) ;
+ int uncompface P((char *)) ;
+diff -Naur compface-1.5.2.orig/file.c compface-1.5.2/file.c
+--- compface-1.5.2.orig/file.c	2005-10-04 14:28:47.000000000 +0200
++++ compface-1.5.2/file.c	2013-02-27 20:43:16.611971224 +0100
+@@ -77,8 +77,42 @@
+ {
+ 	register int c, i;
+ 	register char *s, *t;
++	static char table_inv[] = { 0,8,4,12,2,10,6,14,1,9, 5,13, 3,11, 7,15 };
++	static char table_nop[] = { 0,1,2, 3,4, 5,6, 7,8,9,10,11,12,13,14,15 };
++	char *table = table_nop;	/* optionally invert bits in nibble */
++	register inc = 0;			/* optionally swap nimmles */
++	int bits;
++	int len;
+ 
+ 	t = s = fbuf;
++
++	/* Does this look like an X bitmap ? */
++	if (sscanf(s, "#define %*s %d", &bits) == 1) {
++		if (bits == 48) {
++			char type1[256];
++			char type2[256];
++			while (*s && *s++ != '\n');
++			if (sscanf(s, "#define %*s %d", &bits) == 1) if (bits == 48) {
++				while (*s && *s++ != '\n');
++				for (len=0; s[len] && s[len]!='\n'; len++);
++				if (len<255) {
++				  if (sscanf(s, "static %s %s", type1,type2)==2 &&
++					(!strcmp(type1, "char") || 
++				    	 !strcmp(type2, "char"))) {
++						while (*s && *s++ != '\n');
++						inc = 1;
++						table = table_inv;
++					}
++				  else fprintf(stderr, "warning: xbitmap line 3 not static [unsigned] short ...\n");
++				} else fprintf(stderr, "warning: xbitmap line 3 too long\n");
++			}
++			else fprintf(stderr, "warning: xbitmaps must be 48x48\n");
++		}
++		else fprintf(stderr, "warning: xbitmaps must be 48x48\n");
++	}
++	/* Ensure s is reset if it was not an X bitmap ... */
++	if (! inc) s = fbuf;
++
+ 	for(i = strlen(s); i > 0; i--)
+ 	{
+ 		c = (int)*(s++);
+@@ -89,7 +123,7 @@
+ 				status = ERR_EXCESS;
+ 				break;
+ 			}
+-			*(t++) = c - '0';
++			(t++)[inc] = table[c - '0']; inc = -inc;
+ 		}
+ 		else if ((c >= 'A') && (c <= 'F'))
+ 		{
+@@ -98,7 +132,7 @@
+ 				status = ERR_EXCESS;
+ 				break;
+ 			}
+-			*(t++) = c - 'A' + 10;
++			(t++)[inc] = table[c - 'A' + 10]; inc = -inc;
+ 		}
+ 		else if ((c >= 'a') && (c <= 'f'))
+ 		{
+@@ -107,10 +141,10 @@
+ 				status = ERR_EXCESS;
+ 				break;
+ 			}
+-			*(t++) = c - 'a' + 10;
++			(t++)[inc] = table[c - 'a' + 10]; inc = -inc;
+ 		}
+-		else if (((c == 'x') || (c == 'X')) && (t > fbuf) && (*(t-1) == 0))
+-			t--;
++		else if (((c == 'x') || (c == 'X')) && (t > fbuf) && 
++				((t-1)[-inc] == table[0])){t--; inc = -inc;}
+ 	}
+ 	if (t < fbuf + DIGITS)
+ 		longjmp(comp_env, ERR_INSUFF);