]> gitweb.fluxo.info Git - slackbuilds.git/commitdiff
libtheora: adding libtheora
authorrhatto <rhatto@370017ae-e619-0410-ac65-c121f96126d4>
Sat, 10 Oct 2009 18:40:28 +0000 (18:40 +0000)
committerrhatto <rhatto@370017ae-e619-0410-ac65-c121f96126d4>
Sat, 10 Oct 2009 18:40:28 +0000 (18:40 +0000)
git-svn-id: svn+slack://slack.fluxo.info/var/svn/slackbuilds@2262 370017ae-e619-0410-ac65-c121f96126d4

media/libs/libtheora/libtheora.SlackBuild [deleted file]
patches/libtheora/Manifest [new file with mode: 0644]
patches/libtheora/libtheora-1.0alpha7-x86_64.diff [moved from media/libs/libtheora/libtheora-1.0alpha7-x86_64.diff with 100% similarity]
patches/libtheora/libtheora.SlackBuild [new file with mode: 0644]

diff --git a/media/libs/libtheora/libtheora.SlackBuild b/media/libs/libtheora/libtheora.SlackBuild
deleted file mode 100755 (executable)
index bde950d..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-#!/bin/bash
-#
-# Heavily based on the Slackware 10.2 SlackBuild
-# http://www.theora.org
-# 
-# bumped to version 1.0alpha7 - rafael2k
-#
-# got it from http://www.slacky.it/download/libraries/libtheora/1.0alpha5/src/libtheora.SlackBuild
-# small changes by rhatto
-#
-
-CWD="`pwd`"
-
-if [ -f ~/.slackbuildrc ]; then
-  source ~/.slackbuildrc
-elif [ -f /etc/slackbuildrc ]; then
-  source /etc/slackbuildrc
-fi
-
-PACKAGE="libtheora"
-VERSION=${VERSION:=1.0}
-ARCH=${ARCH:-i486}
-TARGET=${TARGET:=$ARCH}
-BUILD=${BUILD:=1rha}
-TMP=${TMP:=/tmp}
-SRC_DIR=${SRC:=$CWD}
-REPOS=${REPOS:=$TMP}
-
-# -------  error codes for createpkg  --------------
-ERROR_WGET=31;      ERROR_MAKE=32;      ERROR_INSTALL=33
-ERROR_MD5=34;       ERROR_CONF=35;      ERROR_HELP=36
-ERROR_TAR=37;       ERROR_MKPKG=38;     ERROR_GPG=39
-ERROR_PATCH=40
-
-RTOOL="wget"
-PACKAGE_EXT="bz2"
-SRC="$PACKAGE-$VERSION.tar.$PACKAGE_EXT"
-URL="http://downloads.xiph.org/releases/theora/$SRC"
-
-SRC_DIR="$SRC_DIR/$PACKAGE"
-mkdir -p $SRC_DIR
-
-if [ "$RTOOL" == "wget" ] && [ ! -f "$SRC_DIR/$SRC" ]; then
-  wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET
-fi
-
-if [ "$ARCH" = "i486" ]; then
-  SLKCFLAGS="-O2 -march=i486 -mcpu=i686"
-elif [ "$ARCH" = "i686" ]; then
-  SLKCFLAGS="-O2 -march=i686 -mcpu=i686"
-elif [ "$ARCH" = "x86_64" ]; then
-  SLKCFLAGS="-O2"
-fi
-
-if [ "$ARCH" == "x86_64" ]; then
-  LIBDIR="/usr/lib64"
-else
-  LIBDIR="/usr/lib"
-fi
-
-if [ ! -d $TMP ]; then
-  mkdir -p $TMP
-fi
-
-if [ ! -d $PKG ]; then
-  mkdir -p $PKG
-fi
-
-TMP="$TMP/$PACKAGE"
-rm -rf $TMP
-mkdir -p $TMP
-cd $TMP
-
-NAME="$PACKAGE"
-PKG=$TMP/package-$PACKAGE
-
-tar xvf $SRC_DIR/$SRC || exit $ERROR_TAR
-cd $NAME-$VERSION
-chown -R root.root .
-
-if [ -f "$CWD/$PACKAGE-$VERSION.diff" ]; then
-  patch -p1 < $CWD/$PACKAGE-$VERSION.diff || exit $ERROR_PATCH
-fi
-
-if [ -f "$CWD/$PACKAGE-$VERSION-$ARCH.diff" ]; then
-  patch -p1 < $CWD/$PACKAGE-$VERSION-$ARCH.diff || exit $ERROR_PATCH
-fi
-
-find . -perm 777 -exec chmod 755 {} \;
-
-CFLAGS="$SLKCFLAGS" CXXFLAGS="$SLKCFLAGS" \
-./configure --prefix=/usr --libdir=$LIBDIR --program-prefix="" --program-suffix="" $TARGET-slackware-linux || exit $ERROR_CONF
-
-make || exit $ERROR_MAKE
-make install DESTDIR=$PKG || exit $ERROR_INSTALL
-
-cp -a COPYING README $PKG/usr/share/doc/$NAME-$VERSION
-
-( cd $PKG
-  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
-)
-
-mkdir -p $PKG/install
-cat << EOF > $PKG/install/slack-desc
-# 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-----------------------------------------------------|
-libtheora: Libtheora
-libtheora:
-libtheora: Theora is an open video codec being developed by the Xiph.org
-libtheora: Foundation as part of their Ogg project (It is a project that aims
-libtheora: to integrate On2's VP3 video codec, Ogg Vorbis audio codec and Ogg
-libtheora: multimedia container formats into a multimedia solution that can
-libtheora: compete with MPEG-4 format).
-libtheora:
-libtheora:
-libtheora:
-libtheora:
-EOF
-
-cd $PKG
-
-echo 'chroot . /sbin/ldconfig' > install/doinst.sh
-
-makepkg -l y -c n $REPOS/$NAME-$VERSION-$ARCH-$BUILD.tgz || exit $ERROR_MKPKG
-
-if [ "$CLEANUP" == "yes" ]; then
-  rm -rf $TMP
-fi
-
diff --git a/patches/libtheora/Manifest b/patches/libtheora/Manifest
new file mode 100644 (file)
index 0000000..4bdb245
--- /dev/null
@@ -0,0 +1,24 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA256
+
+DIST libtheora-1.1.1.tar.bz2 1903175 MD5 292ab65cedd5021d6b7ddd117e07cd8e RMD160 1d07234bd7e2296c61d6e30fe9816415aa7fd8e5 SHA1 8dcaa8e61cd86eb1244467c0b64b9ddac04ae262 SHA256 b6ae1ee2fa3d42ac489287d3ec34c5885730b1296f0801ae577a35193d3affbc SHA512 9ab9b3af1c35d16a7d6d84f61f59ef3180132e30c27bdd7c0fa2683e0d00e2c791accbc7fd2c90718cc947d8bd10ee4a5940fb55f90f1fd7b0ed30583a47dbbd
+MKBUILD libtheora.mkbuild 5070 MD5 619e36cdbdd30492dec0a6498dbf9d1f RMD160 c4dbe5ca0f46f1f9d38518257fa6f1d7f3e1a2e8 SHA1 844f2bfae141b62e86b77f3137fe6fa4f8264982 SHA256 6c12dce07dbdf799081787eaae00d00c1142d29bdb16f464ca37d3cd595f8d37 SHA512 077b224061b3cb45733db9dcb99e795e8016b681c11b68de8bf8f984c1db885b272d80645691b02cba684d5ebb9d12d60ba20d2c6ebece3b265d885e3547b61d
+PATCH libtheora-1.0alpha7-x86_64.diff 727 MD5 20abef4272f0808a7e74fdb92f5e45f5 RMD160 bcd05c6f9caea334fae8fe726e3b4c054a10b46a SHA1 47eab4a81fc17b151d95b70d32804b751de9e251 SHA256 1cd3c07fea1b8706bb206a15ba762cf0482a7aca7331ce5201eb96905bed8f0a SHA512 065c2e52cadbc27b9d94f516dc3ef443ae200897ef84d056286d4328cd8cf839b41bff303e4c4b7c8fbbe6c2a1a731aa042475e8d703e00cdbfd0ddf84e82a38
+SLACKBUILD libtheora.SlackBuild 8115 MD5 a5348245ea214e68a65ad02d2cbb7d9e RMD160 6cc09b94402c0f640020664e253f9a498ec89051 SHA1 258a2c478f70b2b17ffc79d4c86b134fc35a980e SHA256 2fb01f4e588a728fc6587fdba0c79c82953fe2aa981f2328106feefc36d92129 SHA512 560d17390dee3a07e033cdaef02292d42a7fb9e4950f0f03099a8553b7c72f2a2c05d4fb2dc74cc07ec5979fd0aec5f9f0ba325c317a6e22c58a99462d96592c
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.9 (GNU/Linux)
+
+iQIcBAEBCAAGBQJK0NTGAAoJEEHL93ESzgeiFjMP/ROaSlAGtPXwo6BeACG5Gidc
+2KJDSkoLC7gk9cEHCJaXr15Tm7mjOqCzjqPgEhcWK9upD01xhFHLhszFsCq5Prai
+LzUpDERZubq0DEHKyQABIl5TyVytzYK9n73ODjxFBwqMSWbA2V5b4M9+giDUAWNe
+g9Rf5g2PM55m2/8l/tWxci8YetfCgKZs+RrvQHr7SokqkpE4BTqRfrR0kML5lWbl
+0CJaIO8parkl671cSBStLZ50beMCyImhlYuH+qQpMhTEN/jStadksJVYrqbmWYSO
+wBPNlPc3F0Zan1L3/im7/BYNKae7EomoukrRCMMCpO7luVOR9GnjgU70acnCnv3k
+JQFGTgXnTjMoT1zA4ifF3UwtWgK9pXLIicOl9YZsbcFHVXJ6whIg/9RoZzZEOscq
+8OzrwT1splkNow48V3Q+0uVGMJYytx0OMa13OtbEYcmAIFsZoh5SbP/Jg2TLRUT3
+1gUPZ47q6r1ajhjtS/rL4nokQgh98rqpd+RqvBtlClrtjhN1m1LyZYRbxsxiwu5C
+paeaw3LVlrk0xlCkxNBRgTWmeFdqhre5TgQB+eo+umfVPWMNEev6uZhQdEwZScuM
+q21iZkXXFK5cPh9/Fkm4F5T1e3H5Q0+ALPU0sn4rB32lzHMloLh0vLL7z3UXF1vV
+fxVHDnQLtrhTRXp6NrHT
+=DNF1
+-----END PGP SIGNATURE-----
diff --git a/patches/libtheora/libtheora.SlackBuild b/patches/libtheora/libtheora.SlackBuild
new file mode 100644 (file)
index 0000000..59bea92
--- /dev/null
@@ -0,0 +1,248 @@
+#!/bin/bash
+#
+#  libtheora.SlackBuild is free software; you can redistribute
+#  it and/or modify it under the terms of the GNU General Public License as
+#  published by the Free Software Foundation; either version 2 of the License,
+#  or any later version.
+#
+#  libtheora.SlackBuild is distributed in the hope that it will
+#  be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
+#  Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License along
+#  with this program; if not, write to the Free Software Foundation, Inc.,
+#  59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+#
+# slackbuild for libtheora, by Silvio Rhatto
+# requires:  
+# tested: libtheora-1.1.1
+# model: generic.mkSlackBuild $Rev: 822 $
+#
+
+# Look for slackbuildrc
+if [ -f ~/.slackbuildrc ]; then
+  source ~/.slackbuildrc
+elif [ -f /etc/slackbuildrc ]; then
+  source /etc/slackbuildrc
+fi
+
+# Set variables
+CWD="$(pwd)"
+SRC_NAME="libtheora"
+PKG_NAME="libtheora"
+ARCH=${ARCH:=i486}
+SRC_VERSION=${VERSION:=1.1.1}
+PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')"
+BUILD=${BUILD:=1rha}
+SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME
+TMP=${TMP:=/tmp}
+PKG=${PKG:=$TMP/package-$PKG_NAME}
+REPOS=${REPOS:=$TMP}
+SLACKBUILD_PATH=${SLACKBUILD_PATH:="patches/libtheora"}
+PREFIX=${PREFIX:=/usr}
+PKG_WORK="$TMP/$SRC_NAME"
+CONF_OPTIONS=${CONF_OPTIONS:=""}
+NUMJOBS=${NUMJOBS:=""}
+
+# Set system libraries' path and optmization flags based on $ARCH
+LIBDIR="$PREFIX/lib"
+
+if [ "$ARCH" = "i386" ]; then
+  SLKCFLAGS="-O2 -march=i386 -mtune=i686"
+elif [ "$ARCH" = "i486" ]; then
+  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+elif [ "$ARCH" = "i686" ]; then
+  SLKCFLAGS="-O2 -march=i686"
+elif [ "$ARCH" = "s390" ]; then
+  SLKCFLAGS="-O2"
+elif [ "$ARCH" = "x86_64" ]; then
+  SLKCFLAGS="-O2 -fPIC"
+  LIBDIR="$PREFIX/lib64"
+  LDFLAGS="-L/lib64 -L/usr/lib64"
+fi
+
+# Set error codes (used by createpkg)
+ERROR_WGET=31;      ERROR_MAKE=32;      ERROR_INSTALL=33
+ERROR_MD5=34;       ERROR_CONF=35;      ERROR_HELP=36
+ERROR_TAR=37;       ERROR_MKPKG=38;     ERROR_GPG=39
+ERROR_PATCH=40;     ERROR_VCS=41;       ERROR_MKDIR=42
+ERROR_MANIFEST=43;
+
+# Clean up any leftovers of previous builds
+rm -rf "$PKG_WORK" 2> /dev/null
+rm -rf "$PKG" 2> /dev/null
+
+# Create directories if necessary
+mkdir -p "$SRC_DIR" || exit $ERROR_MKDIR
+mkdir -p "$PKG" || exit $ERROR_MKDIR
+mkdir -p "$REPOS" || exit $ERROR_MKDIR
+mkdir -p "$PKG_WORK" || exit $ERROR_MKDIR
+
+# Dowload source if necessary
+SRC="$SRC_NAME-$VERSION.tar.bz2"
+URL="http://downloads.xiph.org/releases/theora/$SRC"
+
+if [ ! -s "$SRC_DIR/$SRC" ] || ! bunzip2 -t "$SRC_DIR/$SRC" 2> /dev/null; then
+  wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET
+fi
+
+# Check Manifest file
+if [ -e "$CWD/Manifest" ]; then
+
+  # Manifest signature checking
+  if grep -q -- "-----BEGIN PGP SIGNED MESSAGE-----" $CWD/Manifest; then
+    echo "Checking Manifest signature..."
+    gpg --verify $CWD/Manifest
+    if [ "$?" != "0" ]; then
+      exit $ERROR_MANIFEST
+    fi
+  fi
+
+  MANIFEST_LINES="`grep -E -v "^(MKBUILD|SLACKBUILD)" $CWD/Manifest | wc -l`"
+
+  for ((MANIFEST_COUNT=1; MANIFEST_COUNT <= $MANIFEST_LINES; MANIFEST_COUNT++)); do
+
+    MANIFEST_LINE="`grep -E -v "^(MKBUILD|SLACKBUILD)" $CWD/Manifest | head -n $MANIFEST_COUNT | tail -n 1`"
+    MANIFEST_FILE="`echo $MANIFEST_LINE | awk '{ print $2 }'`"
+    MANIFEST_FILE_TYPE="`echo $MANIFEST_LINE | awk '{ print $1 }'`"
+
+    if [ -e "$SRC_DIR/$MANIFEST_FILE" ]; then
+      MANIFEST_FILE="$SRC_DIR/$MANIFEST_FILE"
+    else
+      MANIFEST_FILE="`find $CWD -name $MANIFEST_FILE`"
+    fi
+
+    if [ ! -e "$MANIFEST_FILE" ] || [ -d "$MANIFEST_FILE" ]; then
+      continue
+    fi
+
+    echo "Checking Manifest for $MANIFEST_FILE_TYPE $MANIFEST_FILE integrity..."
+
+    SIZE_SRC="`wc -c $MANIFEST_FILE | awk '{ print $1 }'`"
+    SIZE_MANIFEST="`echo $MANIFEST_LINE | awk '{ print $3 }'`"
+
+    # Check source code size
+    if [ "$SIZE_SRC" != "$SIZE_MANIFEST" ]; then
+      echo "SIZE Manifest: $SIZE_MANIFEST; SIZE $SRC: $SIZE_SRC"
+      exit $ERROR_MANIFEST
+    else
+      echo "Size match."
+    fi
+
+    # Check source code integrity
+    for ALGO in md5 rmd160 sha1 sha256 sha512; do
+      if [ $ALGO = "rmd160" ]; then
+        ALGO_SRC="`openssl rmd160 $MANIFEST_FILE | awk '{ print $2 }'`"
+      else
+        ALGO_SRC="`"$ALGO"sum $MANIFEST_FILE | awk '{ print $1 }'`"
+      fi
+      ALGO="`echo $ALGO | tr '[:lower:]' '[:upper:]'`"
+      ALGO_MANIFEST=$(echo $MANIFEST_LINE | sed "s/.* $ALGO //" | awk '{ print $1 }')
+      if [ "$ALGO_SRC" != "$ALGO_MANIFEST" ]; then
+        echo "$ALGO Manifest: $ALGO_MANIFEST; $ALGO $SRC: $ALGO_SRC"
+        exit $ERROR_MANIFEST
+      else
+        echo "$ALGO match."
+      fi
+    done
+
+  done
+
+else
+  exit $ERROR_MANIFEST
+fi
+
+# Untar
+cd "$PKG_WORK"
+tar --no-same-owner --no-same-permissions -xvf "$SRC_DIR/$SRC" || exit $ERROR_TAR
+PKG_SRC="$PWD/`ls -l | awk '/^d/ { print $NF }'`"
+cd "$PKG_SRC"
+
+# Patch source
+patches=" [[PATCH URLS]]
+         $PKG_NAME.diff $PKG_NAME-$PKG_VERSION.diff
+         $PKG_NAME-$PKG_VERSION-$ARCH.diff $PKG_NAME-$ARCH.diff"
+for patch in $patches; do
+  patch="`basename $patch`"
+  if [ -f "$CWD/$patch" ]; then
+    patch -Np1 < "$CWD/$patch" || exit $ERROR_PATCH
+  elif [ -f "$CWD/patches/$patch" ]; then
+    patch -Np1 < "$CWD/patches/$patch" || exit $ERROR_PATCH
+  elif [ -f "$CWD/$patch.gz" ]; then
+    gzip -dc "$CWD/$patch.gz" | patch -Np1 || exit $ERROR_PATCH
+  elif [ -f "$CWD/patches/$patch.gz" ]; then
+    gzip -dc "$CWD/patches/$patch.gz" | patch -Np1 || exit $ERROR_PATCH
+  elif [ -f "$SRC_DIR/$patch" ]; then
+    if [ "`basename $patch .gz`" != "$patch" ]; then
+      gzip -dc $SRC_DIR/$patch | patch -Np1 || exit $ERROR_PATCH
+    elif [ "`basename $patch .bz2`" != "$patch" ]; then
+      bzip2 -dc $SRC_DIR/$patch | patch -Np1 || exit $ERROR_PATCH
+    else
+      patch -Np1 < "$SRC_DIR/$patch" || exit $ERROR_PATCH
+    fi
+  fi
+done
+
+# Configure
+CFLAGS="$SLKCFLAGS" \
+  CXXFLAGS="$SLKCFLAGS" \
+  ./configure \
+  --prefix="$PREFIX" --libdir="$LIBDIR" $CONF_OPTIONS || exit $ERROR_CONF
+
+# Compile
+make $NUMJOBS || exit $ERROR_MAKE
+
+# Install
+make install DESTDIR="$PKG" || exit $ERROR_INSTALL
+
+# Strip binaries
+( cd "$PKG"
+  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
+)
+
+# Install documentation
+DOCS="NEWS TODO README AUTHORS INSTALL ChangeLog MAINTAINERS COPYING LICENSE SIGNATURE readme.*"
+mkdir -p "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION" || exit $ERROR_MKDIR
+for doc in $DOCS; do
+  if [ -f "$doc" ]; then
+    cp -a $doc "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION"
+  fi
+done
+
+# Add package description (slack-desc)
+mkdir -p "$PKG/install" || exit $ERROR_MKDIR
+cat << EODESC > "$PKG/install/slack-desc"
+# 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----------------------------------------------------|
+libtheora: Libtheora
+libtheora:
+libtheora: Theora is an open video codec being developed by the Xiph.org
+libtheora: Foundation as part of their Ogg project (It is a project that aims
+libtheora: to integrate On2's VP3 video codec, Ogg Vorbis audio codec and Ogg
+libtheora: multimedia container formats into a multimedia solution that can
+libtheora: compete with MPEG-4 format).
+libtheora:
+libtheora:
+libtheora:
+libtheora:
+EODESC
+
+# Build the package
+cd "$PKG"
+mkdir -p $REPOS/$SLACKBUILD_PATH
+makepkg -l y -c n "$REPOS/$SLACKBUILD_PATH/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG
+
+# Delete source and build directories if requested
+if [ "$CLEANUP" == "yes" ] || [ "$1" = "--cleanup" ]; then
+  rm -rf "$PKG_WORK" "$PKG"
+fi