summaryrefslogtreecommitdiffstats
path: root/opencore-amr
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2021-12-29 13:10:49 +0000
committer Eric Hameleers <alien@slackware.com>2021-12-29 13:10:49 +0000
commitc042f7b0bd507dbc9db432958d0e6c4d86b49ffb (patch)
treeb4aa224a9ab0ee98937b89166974214c0e70e359 /opencore-amr
parentc34b0ada0b6ccdee80872cc598fe6263070b2223 (diff)
downloadasb-c042f7b0bd507dbc9db432958d0e6c4d86b49ffb.tar.gz
asb-c042f7b0bd507dbc9db432958d0e6c4d86b49ffb.tar.xz
opencore-amr: updated for Slackware 15.0
Diffstat (limited to 'opencore-amr')
-rwxr-xr-xopencore-amr/build/opencore-amr.SlackBuild63
1 files changed, 35 insertions, 28 deletions
diff --git a/opencore-amr/build/opencore-amr.SlackBuild b/opencore-amr/build/opencore-amr.SlackBuild
index ea89c50e..a0d927f9 100755
--- a/opencore-amr/build/opencore-amr.SlackBuild
+++ b/opencore-amr/build/opencore-amr.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
# $Id$
-# Copyright (c) 2009, 2010, 2013 Eric Hameleers, Eindhoven, NL
+# Copyright 2009, 2010, 2013, 2021 Eric Hameleers, Eindhoven, NL
# All rights reserved.
#
# Permission to use, copy, modify, and distribute this software for
@@ -27,7 +27,7 @@
# By: Eric Hameleers <alien@slackware.com>
# For: opencore-amr
# Descr: implementation of AMR NB and WB speech codec
-# URL: http://sourceforge.net/projects/opencore-amr/
+# URL: https://github.com/BelledonneCommunications/opencore-amr
# Needs:
# Changelog:
# 0.1.2-1: 27/Sep/2009 by Eric Hameleers <alien@slackware.com>
@@ -36,9 +36,11 @@
# * Rebuilt for Slackware 13.1.
# 0.1.3-1: 15/oct/2013 by Eric Hameleers <alien@slackware.com>
# * Update.
+# 0.1.5-1: 29/dec/2021 by Eric Hameleers <alien@slackware.com>
+# * Updated for Slackware 15.0.
#
# Run 'sh opencore-amr.SlackBuild' to build a Slackware package.
-# The package (.tgz) and .txt file as well as build logs are created in /tmp .
+# The package (.txz) and .txt file as well as build logs are created in /tmp .
# Install it using 'installpkg'.
#
# -----------------------------------------------------------------------------
@@ -46,12 +48,12 @@
# Set initial variables:
PRGNAM=opencore-amr
-VERSION=${VERSION:-0.1.3}
+VERSION=${VERSION:-0.1.5}
BUILD=${BUILD:-1}
-NUMJOBS=${NUMJOBS:" -j4 "}
+NUMJOBS=${NUMJOBS:-" -j$(nproc) "}
TAG=${TAG:-alien}
-DOCS="AUTHORS COPYING ChangeLog LICENSE NEWS README"
+DOCS="ChangeLog LICENSE README opencore/NOTICE"
# Where do we look for sources?
SRCDIR=$(cd $(dirname $0); pwd)
@@ -62,27 +64,25 @@ PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
SOURCE="$SRCDIR/${PRGNAM}-${VERSION}.tar.gz"
-SRCURL="http://downloads.sourceforge.net/${PRGNAM}/${PRGNAM}-${VERSION}.tar.gz"
+SRCURL="https://downloads.sourceforge.net/sourceforge/${PRGNAM}/${PRGNAM}-${VERSION}.tar.gz"
##
## --- with a little luck, you won't have to edit below this point --- ##
##
# Automatically determine the architecture we're building on:
-MARCH=$( uname -m )
if [ -z "$ARCH" ]; then
- case "$MARCH" in
- i?86) export ARCH=i486 ;;
- armv7hl) export ARCH=$MARCH ;;
- armv6hl) export ARCH=$MARCH ;;
- arm*) export ARCH=arm ;;
+ case "$(uname -m)" in
+ i?86) ARCH=i586 ;;
+ arm*) readelf /usr/bin/file -A | egrep -q "Tag_CPU.*[4,5]" && ARCH=arm || ARCH=armv7hl ;;
# Unless $ARCH is already set, use uname -m for all other archs:
- *) export ARCH=$MARCH ;;
+ *) ARCH=$(uname -m) ;;
esac
+ export ARCH
fi
-
+# Set CFLAGS/CXXFLAGS and LIBDIRSUFFIX:
case "$ARCH" in
- i486) SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ i?86) SLKCFLAGS="-O2 -march=${ARCH} -mtune=i686"
SLKLDFLAGS=""; LIBDIRSUFFIX=""
;;
x86_64) SLKCFLAGS="-O2 -fPIC"
@@ -91,10 +91,7 @@ case "$ARCH" in
armv7hl) SLKCFLAGS="-O2 -march=armv7-a -mfpu=vfpv3-d16"
SLKLDFLAGS=""; LIBDIRSUFFIX=""
;;
- armv6hl) SLKCFLAGS="-O2 -march=armv6 -mfpu=vfp -mfloat-abi=hard"
- SLKLDFLAGS=""; LIBDIRSUFFIX=""
- ;;
- *) SLKCFLAGS=${SLKCFLAGS:-"O2"}
+ *) SLKCFLAGS=${SLKCFLAGS:-"-O2"}
SLKLDFLAGS=${SLKLDFLAGS:-""}; LIBDIRSUFFIX=${LIBDIRSUFFIX:-""}
;;
esac
@@ -121,17 +118,18 @@ mkdir -p $TMP/tmp-$PRGNAM # location to build the source
mkdir -p $PKG # place for the package to be built
rm -rf $PKG/* # always erase old package's contents
rm -rf $TMP/tmp-$PRGNAM/* # remove the remnants of previous build
-rm -rf $OUTPUT/{configure,make,install,error,makepkg}-$PRGNAM.log
+rm -rf $OUTPUT/{autoreconf,configure,make,install,error,makepkg}-$PRGNAM.log
# remove old log files
# Source file availability:
if ! [ -f ${SOURCE} ]; then
+ echo "Source '$(basename ${SOURCE})' not available yet..."
+ # Check if the $SRCDIR is writable at all - if not, download to $OUTPUT
+ [ -w "$SRCDIR" ] || SOURCE="$OUTPUT/$(basename $SOURCE)"
+ if [ -f ${SOURCE} ]; then echo "Ah, found it!"; continue; fi
if ! [ "x${SRCURL}" == "x" ]; then
- # Check if the $SRCDIR is writable at all - if not, download to $OUTPUT
- [ -w "$SRCDIR" ] || SOURCE="$OUTPUT/$(basename $SOURCE)"
- echo "Source '$(basename ${SOURCE})' not available yet..."
echo "Will download file to $(dirname $SOURCE)"
- wget -nv -T 20 -O "${SOURCE}" "${SRCURL}" || true
+ wget --no-check-certificate -nv -T 20 -O "${SOURCE}" "${SRCURL}" || true
if [ $? -ne 0 -o ! -s "${SOURCE}" ]; then
echo "Downloading '$(basename ${SOURCE})' failed... aborting the build."
mv -f "${SOURCE}" "${SOURCE}".FAIL
@@ -159,9 +157,12 @@ echo "Extracting the source archive(s) for $PRGNAM..."
tar -xvf ${SOURCE}
cd ${PRGNAM}-${VERSION}
chown -R root:root .
-chmod -R u+w,go+r-w,a+X-s .
+chmod -R u+w,go+r-w,a+rX-st .
echo Building ...
+[ ! -x configure ] && autoreconf -vif \
+ 2>&1 | tee $OUTPUT/autoreconf-${PRGNAM}.log
+
LDFLAGS="$SLKLDFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
CFLAGS="$SLKCFLAGS" \
@@ -171,6 +172,9 @@ CFLAGS="$SLKCFLAGS" \
--mandir=/usr/man \
--localstatedir=/var \
--sysconfdir=/etc \
+ --enable-shared \
+ --enable-static \
+ --disable-examples \
--program-prefix= \
--program-suffix= \
--build=$TARGET \
@@ -193,6 +197,9 @@ if [ -d $PKG/usr/man ]; then
for i in $(find $PKG/usr/man -type l -name "*.?") ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
fi
+# Don't ship .la files:
+rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la
+
# Strip binaries (if any):
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
@@ -203,9 +210,9 @@ cat $SRCDIR/slack-desc > $PKG/install/slack-desc
# Build the package:
cd $PKG
-makepkg --linkadd y --chown n $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.tgz 2>&1 | tee $OUTPUT/makepkg-${PRGNAM}.log
+makepkg --linkadd y --chown n $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txz 2>&1 | tee $OUTPUT/makepkg-${PRGNAM}.log
cd $OUTPUT
-md5sum ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.tgz > ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.tgz.md5
+md5sum ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txz > ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txz.md5
cd -
cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txt