diff options
author | B. Watson <yalhcru@gmail.com> | 2015-10-28 23:48:46 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2015-10-28 23:48:46 +0700 |
commit | 908d2798bcbc477bd59dca0e29f5868f06c79de3 (patch) | |
tree | 193fee955ab44881abc5b95f05ac06d64c96536c | |
parent | 80aa8990f94c699626677b610c1e6782ca5c22a5 (diff) | |
download | slackbuilds-908d2798bcbc477bd59dca0e29f5868f06c79de3.tar.gz |
system/unac: Added (remove accents from text).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r-- | system/unac/README | 7 | ||||
-rw-r--r-- | system/unac/oe_ligature.diff | 11 | ||||
-rw-r--r-- | system/unac/size_t.diff | 45 | ||||
-rw-r--r-- | system/unac/slack-desc | 19 | ||||
-rw-r--r-- | system/unac/unac.SlackBuild | 97 | ||||
-rw-r--r-- | system/unac/unac.info | 10 |
6 files changed, 189 insertions, 0 deletions
diff --git a/system/unac/README b/system/unac/README new file mode 100644 index 0000000000..541db046af --- /dev/null +++ b/system/unac/README @@ -0,0 +1,7 @@ +unac (remove accents from text) + +unac is a C library and command that removes accents from a string. For +instance the string été will become ete. It provides a command line +interface that removes accents from an input flow or a string given in +argument (unaccent command). In the library function and the command, +the charset of the input is specified as an argument. diff --git a/system/unac/oe_ligature.diff b/system/unac/oe_ligature.diff new file mode 100644 index 0000000000..1fa9a52453 --- /dev/null +++ b/system/unac/oe_ligature.diff @@ -0,0 +1,11 @@ +diff -Naur unac-1.8.0.orig/unaccent-local-map.perl unac-1.8.0.orig.patched/unaccent-local-map.perl +--- unac-1.8.0.orig/unaccent-local-map.perl 2003-10-13 06:24:25.000000000 -0400 ++++ unac-1.8.0.orig.patched/unaccent-local-map.perl 2015-10-26 17:01:49.000000000 -0400 +@@ -23,5 +23,7 @@ + %::localmap = ( + "LATIN SMALL LETTER AE" => [ "LATIN SMALL LETTER A", "LATIN SMALL LETTER E" ], + "LATIN CAPITAL LETTER AE" => [ "LATIN CAPITAL LETTER A", "LATIN CAPITAL LETTER E" ], ++ "LATIN SMALL LIGATURE OE" => [ "LATIN SMALL LETTER O", "LATIN SMALL LETTER E" ], ++ "LATIN CAPITAL LIGATURE OE" => [ "LATIN CAPITAL LETTER O", "LATIN CAPITAL LETTER E" ], + ); + diff --git a/system/unac/size_t.diff b/system/unac/size_t.diff new file mode 100644 index 0000000000..e7ef82ba32 --- /dev/null +++ b/system/unac/size_t.diff @@ -0,0 +1,45 @@ +diff -r fd7eb0d70970 unac-1.8.0/unac.c +--- a/unac-1.8.0/unac.c Fri Sep 17 10:35:14 2010 +0200 ++++ b/unac-1.8.0/unac.c Fri Sep 17 10:36:07 2010 +0200 +@@ -13873,9 +13873,9 @@ + *out_lengthp = 0; + } else { + char* utf16 = 0; +- int utf16_length = 0; ++ size_t utf16_length = 0; + char* utf16_unaccented = 0; +- int utf16_unaccented_length = 0; ++ size_t utf16_unaccented_length = 0; + + if(convert(charset, utf16be(), in, in_length, &utf16, &utf16_length) < 0) { + return -1; +diff -r fd7eb0d70970 unac-1.8.0/unaccent.c +--- a/unac-1.8.0/unaccent.c Fri Sep 17 10:35:14 2010 +0200 ++++ b/unac-1.8.0/unaccent.c Fri Sep 17 10:40:34 2010 +0200 +@@ -90,7 +90,7 @@ + const char* charset = argv[optind++]; + + char* unaccented = 0; +- int unaccented_length = 0; ++ size_t unaccented_length = 0; + + if(optind >= argc) { + #define BUFFER_SIZE 10240 +@@ -101,7 +101,7 @@ + perror(""); + exit(1); + } +- printf("%.*s", unaccented_length, unaccented); ++ printf("%.*s", (int)unaccented_length, unaccented); + } + } else { + const char* string = argv[optind++]; +@@ -114,7 +114,7 @@ + + if(debug_level > UNAC_DEBUG_NONE) + fprintf(stderr, "unaccented version is "); +- printf("%.*s\n", unaccented_length, unaccented); ++ printf("%.*s\n", (int)unaccented_length, unaccented); + + if(optind < argc) { + const char* expected = argv[optind++]; diff --git a/system/unac/slack-desc b/system/unac/slack-desc new file mode 100644 index 0000000000..202227ffb1 --- /dev/null +++ b/system/unac/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------------------------------------------------------| +unac: unac (remove accents from text) +unac: +unac: unac is a C library and command that removes accents from a +unac: string. For instance the string été will become ete. It provides +unac: a command line interface that removes accents from a input flow or a +unac: string given in argument (unaccent command). In the library function +unac: and the command, the charset of the input is specified as an argument. +unac: +unac: +unac: +unac: diff --git a/system/unac/unac.SlackBuild b/system/unac/unac.SlackBuild new file mode 100644 index 0000000000..e9868c5f27 --- /dev/null +++ b/system/unac/unac.SlackBuild @@ -0,0 +1,97 @@ +#!/bin/sh + +# Slackware build script for unac + +# Written by B. Watson (yalhcru@gmail.com) + +# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. + +PRGNAM=unac +VERSION=${VERSION:-1.8.0} +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 + +TARBALL=${PRGNAM}_${VERSION}.orig.tar.gz +DIRNAME=${PRGNAM}-${VERSION}.orig + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $DIRNAME +tar xvf $CWD/$TARBALL +cd $DIRNAME +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 {} \; + +# patch taken from http://http.debian.net/debian/pool/main/u/unac/unac_1.8.0-6.diff.gz +# (yes, it needs -p2) +patch -p2 < $CWD/size_t.diff + +# patch by slackbuild author, add support for OE ligature +patch -p1 < $CWD/oe_ligature.diff + +touch config.rpath # shut up, autocrap +autoreconf -if + +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 \ + --enable-shared \ + --build=$ARCH-slackware-linux + +# this is needed for the OE ligature also +make -B $PRGNAM.c + +make +make install-strip DESTDIR=$PKG +gzip $PKG/usr/man/man?/*.? + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a AUTHORS COPYING ChangeLog NEWS README THANKS $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/system/unac/unac.info b/system/unac/unac.info new file mode 100644 index 0000000000..4379cc82e7 --- /dev/null +++ b/system/unac/unac.info @@ -0,0 +1,10 @@ +PRGNAM="unac" +VERSION="1.8.0" +HOMEPAGE="http://www.nongnu.org/unac/" +DOWNLOAD="http://http.debian.net/debian/pool/main/u/unac/unac_1.8.0.orig.tar.gz" +MD5SUM="8670c920969a199dec37f15c197602bf" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="B. Watson" +EMAIL="yalhcru@gmail.com" |