Skip to content

Commit

Permalink
mjpegtools: upgraded to 2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
conraid committed Mar 1, 2015
1 parent 19cb2a7 commit 9e51faa
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 63 deletions.
105 changes: 47 additions & 58 deletions mjpegtools/mjpegtools.SlackBuild
Expand Up @@ -2,7 +2,7 @@
#
# Slackware build script for mjpegtools
#
# Copyright 2009-2012 Corrado Franco (http://conraid.net)
# Copyright 2009-2015 Corrado Franco (http://conraid.net)
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
Expand All @@ -23,73 +23,71 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# Exit on most errors
set -e
set -eu

# Set variables:
CWD=$(pwd)

PRGNAME=${PRGNAME:-mjpegtools}
PKGNAME=$(echo $PRGNAME | tr A-Z a-z)
VERSION=${VERSION:-2.0.0}
PKGVERSION=$(echo $VERSION | tr - _)
PKGNAME=$(echo ${PRGNAME} | tr A-Z a-z)
VERSION=${VERSION:-2.1.0}
PKGVERSION=${VERSION/-/_}
BUILD=${BUILD:-1}
TAG=${TAG:-cf}
TMP=${TMP:-/tmp/pkg}
PKG=$TMP/package-$PKGNAME
DOCS="$PKG/usr/doc/$PKGNAME-$PKGVERSION"
PKG=${TMP}/package-${PKGNAME}
DOCDIR="${PKG}/usr/doc/${PKGNAME}-${PKGVERSION}"

# Insert document files in this variable
DOCFILES="AUTHORS BUGS CHANGES COPYING ChangeLog HINTS INSTALL* NEWS PLANS README* TODO docs/FAQ.txt"

# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
if [ -z ${ARCH:=""} ]; then
case "$( uname -m )" in
i?86) ARCH=i686 ;;
arm*) ARCH=arm ;;
# Unless $ARCH is already set, use uname -m for all other archs:
*) ARCH=$( uname -m ) ;;
# Unless ${ARCH} is already set, use uname -m for all other archs:
*) ARCH=$( uname -m ) ;;
esac
fi

# Set compiling FLAGS
case "$ARCH" in
i486)
case "${ARCH}" in
i486)
SLKCFLAGS="-O2 -march=i486 -mtune=i686"; CHOST="i486"
SLKLDFLAGS=""; LIBDIRSUFFIX=""
;;
i686)
;;
i686)
SLKCFLAGS="-O2 -march=i686 -pipe -fomit-frame-pointer"; CHOST="i486"
SLKLDFLAGS=""; LIBDIRSUFFIX=""
;;
x86_64)
;;
x86_64)
SLKCFLAGS="-O2 -fPIC -pipe -fomit-frame-pointer"; CHOST="x86_64"
SLKLDFLAGS="-L/lib64 -L/usr/lib64"; LIBDIRSUFFIX="64"
;;
*)
SLKCFLAGS="-O2"; CHOST=$ARCH
;;
*)
SLKCFLAGS="-O2"; CHOST=${ARCH}
SLKLDFLAGS=""; LIBDIRSUFFIX=""
;;
esac

# Extract source and prepare:
rm -rf $PKG
mkdir -p $TMP $PKG
cd $TMP
rm -rf $PRGNAME-$VERSION
tar xvf $CWD/$PRGNAME-$VERSION.tar.gz
cd $PRGNAME-$VERSION

# Apply patch for v4l
patch -p0 -i "${CWD}/mjpegtools-v4l.patch" --backup
rm -rf ${PKG}
mkdir -p ${TMP} ${PKG}
cd ${TMP}
rm -rf ${PRGNAME}-${VERSION}
tar xvf ${CWD}/${PRGNAME}-${VERSION}.tar.gz
cd ${PRGNAME}-${VERSION}

# Make sure ownerships and permissions are sane:
chown -R root:root .
chmod -R u+w,go+r-w,a-s .

# Configure
LDFLAGS="$SLKLDFLAGS" \
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
sed -i -e '/ARCHFLAGS=/s:=.*:=:' configure
LDFLAGS="${SLKLDFLAGS}" \
CFLAGS="${SLKCFLAGS}" \
CXXFLAGS="${SLKCFLAGS}" \
./configure \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
Expand All @@ -100,46 +98,37 @@ CXXFLAGS="$SLKCFLAGS" \
--docdir=/usr/doc/${PKGNAME}-${PKGVERSION} \
--enable-static=no \
--enable-shared=yes \
--host=$CHOST-slackware-linux \
--build=$CHOST-slackware-linux
--enable-largefile \
--with-x \
--host=${CHOST}-slackware-linux \
--build=${CHOST}-slackware-linux

# Build and install:
make $JOBS
make DESTDIR=$PKG install-strip
make
make DESTDIR=${PKG} install-strip

# Compress and link manpages, if any:
if [ -d $PKG/usr/man ]; then
( cd $PKG/usr/man
find -type f -exec gzip -9 {} \;
for i in $(find -type l); do ln -s $(readlink $i).gz $i.gz; rm $i; done
)
if [ -d ${PKG}/usr/man ]; then
find ${PKG}/usr/man -type f -exec gzip -9 {} \;
for i in $( find ${PKG}/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
fi

# Compress info files, if any:
if [ -d $PKG/usr/info ]; then
rm -f $PKG/usr/info/dir
gzip -9 $PKG/usr/info/*.info*
if [ -d ${PKG}/usr/info ]; then
rm -f ${PKG}/usr/info/dir
gzip -9 ${PKG}/usr/info/*.info*
fi

# Add a documentation directory:
mkdir -p ${DOCS}
for i in ${DOCFILES}; do
if [ -e "${i}" ]; then
if ! [ -L "${i}" ]; then
cp -a "${i}" ${DOCS}
else
cp -LRp "${i}" ${DOCS}
fi
fi;
done
mkdir -p ${DOCDIR}
cp -a ${DOCFILES} ${DOCDIR} || true

# Add a slackbuild script:
cat $CWD/$PKGNAME.SlackBuild > $DOCS/$PKGNAME.SlackBuild
install -Dm644 ${CWD}/${PKGNAME}.SlackBuild ${DOCDIR}/${PKGNAME}.SlackBuild

# Add slack-desc
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
install -Dm644 ${CWD}/slack-desc ${PKG}/install/slack-desc

# Create package:
cd $PKG
/sbin/makepkg -l y -c n $CWD/$PKGNAME-$PKGVERSION-$ARCH-${BUILD}${TAG}.txz
cd ${PKG}
/sbin/makepkg -l y -c n ${CWD}/${PKGNAME}-${PKGVERSION}-${ARCH}-${BUILD}${TAG}.txz
8 changes: 4 additions & 4 deletions mjpegtools/mjpegtools.info
@@ -1,7 +1,7 @@
NAME="mjpegtools"
VERSION="2.0.0"
VERSION="2.1.0"
HOMEPAGE="http://mjpeg.sourceforge.net/"
DOWNLOAD="http://downloads.sourceforge.net/project/mjpeg/mjpegtools/2.0.0/mjpegtools-2.0.0.tar.gz"
DOWNLOAD="http://downloads.sourceforge.net/project/mjpeg/mjpegtools/2.1.0/mjpegtools-2.1.0.tar.gz"
REQUIRES=""
MD5SUM="903e1e3b967eebcc5fe5626d7517dc46"
SHASUM="f411e8573d446711dbe8455a6ae9257e1afe1e70"
MD5SUM="57bf5dd78976ca9bac972a6511b236f3"
SHASUM="b9effa86280e23d67369e842e5cb645948583097"
2 changes: 1 addition & 1 deletion mjpegtools/slack-desc
Expand Up @@ -15,5 +15,5 @@ mjpegtools:
mjpegtools: The recorded videos can be converted to MPEG streams. The software
mjpegtools: playback of MPEG streams works with almost every player and every OS.
mjpegtools:
mjpegtools: Home: http://mjpeg.sourceforge.net/
mjpegtools:
mjpegtools:

0 comments on commit 9e51faa

Please sign in to comment.