Magellan Linux

Contents of /branches/R11-unstable/extras/libmad/libmad-0.15.1b-r12.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 25540 - (show annotations) (download)
Tue Nov 25 03:54:25 2014 UTC (9 years, 5 months ago) by niro
File size: 1655 byte(s)
-release branches/R11-unstable
1 # $Id$
2
3 PNAME="libmad"
4 PVER="0.15.1b"
5 PBUILD="r12"
6
7 PCAT="media-libs"
8
9 DESCRIPTION="MAD is a high-quality MPEG audio decoder."
10 HOMEPAGE="http://www.underbit.com/products/mad/"
11
12 DEPEND=">= virtual/glibc"
13
14 SRCFILE="${PNAME}-${PVER}.tar.gz"
15 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
16
17 sminclude mtools
18
19 SRC_URI=(
20 ftp://ftp.mars.org/pub/mpeg/${SRCFILE}
21 sourceforge://mad/${SRCFILE}
22 mirror://${PNAME}/${SRCFILE}
23 )
24
25 UP2DATE="updatecmd_sourceforge mad libmad"
26
27 src_prepare()
28 {
29 munpack ${SRCFILE} || die
30 cd ${SRCDIR}
31
32 # fix libtool
33 rm ${SRCDIR}/ltmain.sh || die
34 mlibtoolize || die
35
36 # remove unsupported cflags with gcc-4.3
37 sed -i "s:-fforce-mem::g" configure.ac || die
38 # create missing files
39 touch NEWS AUTHORS ChangeLog || die
40 export WANT_AUTOMAKE=1.10
41 mautoreconf || die
42 }
43
44 src_compile()
45 {
46 cd ${SRCDIR}
47
48 # arch special preprocessor
49 local myconf
50 [[ ${ARCH} = x86_64 ]] && myconf="--enable-fpm=64bit"
51 [[ ${ARCH} = i*86 ]] && myconf="--enable-fpm=intel"
52
53 mconfigure --enable-accuracy --disable-debugging ${myconf} || die
54 mmake || die
55 }
56
57 src_install()
58 {
59 cd ${SRCDIR}
60 mmake DESTDIR=${BINDIR} install || die
61
62 # must be updated with every update
63 cat > ${SRCDIR}/mad.pc << "EOF"
64 prefix=/usr
65 exec_prefix=${prefix}
66 EOF
67
68 # fix libdir
69 echo "libdir=\${exec_prefix}/$(mlibdir)" >> ${SRCDIR}/mad.pc
70
71 cat >> ${SRCDIR}/mad.pc << "EOF"
72 includedir=${prefix}/include
73
74 Name: mad
75 Description: MPEG Audio Decoder
76 Requires:
77 EOF
78 echo "Version: ${PVER}" >> ${SRCDIR}/mad.pc
79 cat >> ${SRCDIR}/mad.pc << "EOF"
80 Libs: -L${libdir} -lmad -lm
81 Cflags: -I${includedir}
82 EOF
83 minstalldir /usr/$(mlibdir)/pkgconfig || die
84 minstallfile mad.pc /usr/$(mlibdir)/pkgconfig || die
85 }