diff --git a/mjpegtools/README b/mjpegtools/README index b16d158ebf..70458e40f0 100644 --- a/mjpegtools/README +++ b/mjpegtools/README @@ -1,5 +1,5 @@ -Slackware Current Repository by Conraid +Slackware Current Repository by Conraid ====================================================================== diff --git a/mjpegtools/mjpegtools.SlackBuild b/mjpegtools/mjpegtools.SlackBuild index 2806cf7b35..6ae01d949b 100644 --- a/mjpegtools/mjpegtools.SlackBuild +++ b/mjpegtools/mjpegtools.SlackBuild @@ -2,92 +2,76 @@ # # Slackware build script for mjpegtools # -# Copyright 2009-2015 Corrado Franco (http://conraid.net) +# Copyright 2009-2016 Corrado Franco (http://conraid.net) # 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. - -# Exit on most errors +# This program 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 +# (at your option) any later version, with the following exception: +# the text of the GPL license may be omitted. + +# This program 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. Compiling, +# interpreting, executing or merely reading the text of the program +# may result in lapses of consciousness and/or very being, up to and +# including the end of all existence and the Universe as we know it. +# See the GNU General Public License for more details. + +# You may have received a copy of the GNU General Public License along +# with this program (most likely, a file named COPYING). If not, see +# . + set -eu -# Set variables: CWD=$(pwd) -PRGNAME=${PRGNAME:-mjpegtools} -PKGNAME=$(echo ${PRGNAME} | tr A-Z a-z) -VERSION=${VERSION:-2.1.0} -PKGVERSION=${VERSION//-/_} -BUILD=${BUILD:-2} +PKGNAM=mjpegtools +VERSION=2.1.0 +BUILD=${BUILD:-3} TAG=${TAG:-cf} TMP=${TMP:-/tmp/pkg} -PKG=${TMP}/package-${PKGNAME} -DOCDIR="${PKG}/usr/doc/${PKGNAME}-${PKGVERSION}" +PKG=$TMP/package-$PKGNAM +OUTPUT=${OUTPUT:-/tmp} -# 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 - case "$( uname -m )" in + 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 ) ;; - esac + *) ARCH=$( uname -m ) ;; + esac fi -# Set compiling FLAGS -case "${ARCH}" in - i486) - SLKCFLAGS="-O2 -march=i486 -mtune=i686"; CHOST="i486" - SLKLDFLAGS=""; LIBDIRSUFFIX="" - ;; - i686) - SLKCFLAGS="-O2 -march=i686 -fomit-frame-pointer"; CHOST="i486" - SLKLDFLAGS=""; LIBDIRSUFFIX="" - ;; - x86_64) - SLKCFLAGS="-O2 -fPIC -fomit-frame-pointer"; CHOST="x86_64" - SLKLDFLAGS="-L/lib64 -L/usr/lib64"; LIBDIRSUFFIX="64" - ;; - *) - 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} - -# Make sure ownerships and permissions are sane: +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 -pipe -fomit-frame-pointer" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PKGNAM-$VERSION +tar xvf $CWD/$PKGNAM-$VERSION.tar.gz +cd $PKGNAM-$VERSION + chown -R root:root . chmod -R u+w,go+r-w,a-s . -# Configure -sed -i -e '/ARCHFLAGS=/s:=.*:=:' configure -LDFLAGS="${SLKLDFLAGS}" \ -CFLAGS="${SLKCFLAGS}" \ -CXXFLAGS="${SLKCFLAGS}" \ +LDFLAGS="-L/usr/lib${LIBDIRSUFFIX}" \ +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --libdir=/usr/lib${LIBDIRSUFFIX} \ @@ -95,40 +79,33 @@ CXXFLAGS="${SLKCFLAGS}" \ --localstatedir=/var \ --mandir=/usr/man \ --infodir=/usr/info \ - --docdir=/usr/doc/${PKGNAME}-${PKGVERSION} \ + --docdir=/usr/doc/$PKGNAM-$VERSION \ --enable-static=no \ --enable-shared=yes \ --enable-largefile \ --with-x \ - --host=${CHOST}-slackware-linux \ - --build=${CHOST}-slackware-linux + --host=$ARCH-slackware-linux \ + --build=$ARCH-slackware-linux -# Build and install: make -make DESTDIR=${PKG} install-strip +make DESTDIR=$PKG install-strip -# Compress and link manpages, if any: -if [ -d ${PKG}/usr/man ]; then - find ${PKG}/usr/man -type f -exec chmod 644 {} \; -exec gzip -9 {} \; - for i in $( find ${PKG}/usr/man -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 chmod 644 {} \; -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 ${DOCDIR} -cp -a ${DOCFILES} ${DOCDIR} || true - -# Add a slackbuild script: -install -Dm644 ${CWD}/${PKGNAME}.SlackBuild ${DOCDIR}/${PKGNAME}.SlackBuild +mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION +cp -a $DOCFILES $PKG/usr/doc/$PKGNAM-$VERSION || true +cat $CWD/${PKGNAM}.SlackBuild > $PKG/usr/doc/$PKGNAM-$VERSION/${PKGNAM}.SlackBuild -# Add slack-desc -install -Dm644 ${CWD}/slack-desc ${PKG}/install/slack-desc +mkdir -p $PKG/install +cat $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 $OUTPUT/$PKGNAM-$VERSION-$ARCH-$BUILD${TAG}.txz