diff options
Diffstat (limited to 'l/libmad/libmad.SlackBuild')
-rwxr-xr-x | l/libmad/libmad.SlackBuild | 78 |
1 files changed, 42 insertions, 36 deletions
diff --git a/l/libmad/libmad.SlackBuild b/l/libmad/libmad.SlackBuild index 0a78183..ae6d2c0 100755 --- a/l/libmad/libmad.SlackBuild +++ b/l/libmad/libmad.SlackBuild @@ -37,19 +37,14 @@ fi NUMJOBS=${NUMJOBS:-" -j7 "} -if [ "$ARCH" = "i486" ]; then - SLKCFLAGS="-O2 -march=i486 -mtune=i686" - LIBDIRSUFFIX="" -elif [ "$ARCH" = "s390" ]; then - SLKCFLAGS="-O2" - LIBDIRSUFFIX="" -elif [ "$ARCH" = "x86_64" ]; then - SLKCFLAGS="-O2 -fPIC" - LIBDIRSUFFIX="64" -else - SLKCFLAGS="-O2" - LIBDIRSUFFIX="" -fi +case "${HOST_TRIPLET}" in + i686-w64-mingw32) + ENABLE_FPM="intel" + ;; + x86_64-w64-mingw32) + ENABLE_FPM="64bit" + ;; +esac CWD=$(pwd) TMP=${TMP:-/tmp} @@ -70,17 +65,26 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \; +cp ${CWD}/configure.ac ${CWD}/Makefile.am ${CWD}/mad.pc.in . + +sed -i '/bin_PROGRAMS = minimad/ s/minimad//' Makefile.am + +autoreconf -fiv + # Configure: -CFLAGS="$SLKCFLAGS" \ +CFLAGS="-O2" \ +LDFLAGS="-L/${PREFIX}/lib${LIBDIRSUFFIX}" \ ./configure \ - --prefix=/usr \ - --libdir=/usr/lib${LIBDIRSUFFIX} \ + --prefix=/${PREFIX} \ + --libdir=/${PREFIX}/lib${LIBDIRSUFFIX} \ --sysconfdir=/etc \ - --mandir=/usr/man \ + --mandir=/${PREFIX}/man \ --disable-static \ --disable-debugging \ --program-prefix= \ --program-suffix= \ + --host=${HOST_TRIPLET} \ + --enable-fpm=${ENABLE_FPM} \ --build=$ARCH-slackware-linux # Build and install: @@ -88,17 +92,17 @@ make $NUMJOBS || make || exit 1 make install DESTDIR=$PKG || exit 1 # This is what happens when every distro makes up its own standards -mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}/pkgconfig -sed -e "s#/lib#/lib${LIBDIRSUFFIX}#" $CWD/mad.pc \ - > $PKG/usr/lib${LIBDIRSUFFIX}/pkgconfig/mad.pc +# mkdir -p $PKG/${PREFIX}/lib${LIBDIRSUFFIX}/pkgconfig +# sed -e "s#/lib#/lib${LIBDIRSUFFIX}#" $CWD/mad.pc \ +# > $PKG/${PREFIX}/lib${LIBDIRSUFFIX}/pkgconfig/mad.pc -# Strip binaries: -find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ - | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null +find $PKG | xargs file | egrep -e "executable|shared object" \ + | grep ${HOST_EXE_FORMAT} | cut -f 1 -d : \ + | xargs ${HOST_STRIP} --strip-unneeded 2> /dev/null # Compress and link manpages, if any: -if [ -d $PKG/usr/man ]; then - ( cd $PKG/usr/man +if [ -d $PKG/${PREFIX}/man ]; then + ( cd $PKG/${PREFIX}/man for manpagedir in $(find . -type d -name "man*") ; do ( cd $manpagedir for eachpage in $( find . -type l -maxdepth 1) ; do @@ -112,22 +116,24 @@ if [ -d $PKG/usr/man ]; then fi # Compress info files, if any: -if [ -d $PKG/usr/info ]; then - ( cd $PKG/usr/info +if [ -d $PKG/${PREFIX}/info ]; then + ( cd $PKG/${PREFIX}/info rm -f dir gzip -9 * ) fi # Add a documentation directory: -mkdir -p $PKG/usr/doc/${PKGNAM}-$VERSION +mkdir -p $PKG/${PREFIX}/doc/${PKGNAM}-$VERSION cp -a \ CHANGES COPYING* COPYRIGHT CREDITS README* TODO VERSION \ - $PKG/usr/doc/${PKGNAM}-$VERSION - -mkdir -p $PKG/install -cat $CWD/slack-desc > $PKG/install/slack-desc - -cd $PKG -/sbin/makepkg -l y -c n $TMP/${PKGNAM}-$VERSION-$ARCH-$BUILD.txz - + $PKG/${PREFIX}/doc/${PKGNAM}-$VERSION + +cat ${CWD}/libmad.yypkg.script | sed \ + -e "s/%{PKG}/libmad/" \ + -e "s/%{HST}/${HOST_TRIPLET}/" \ + -e "s/%{TGT}//" \ + -e "s/%{VER}/${VERSION}/" \ + -e "s/%{BUILD}/${BUILD}/" \ + -e "s/%{DESCR}/${DESCR:-"No description"}/" \ + | yypkg --makepkg --output ${YYOUTPUT} --script - --directory "${PKG}/${PREFIX}" |