1affa3360d940625a05539549ed401be74d2fd10
[openwrt/svn-archive/archive.git] / libs / libmad / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=libmad
12 PKG_VERSION:=0.15.1b
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=@SF/mad \
17 ftp://ftp.mars.org/pub/mpeg/
18 PKG_MD5SUM:=1be543bc30c56fb6bea1d7bf6a64e66c
19 PKG_CAT:=zcat
20
21 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
22 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
23
24 include $(INCLUDE_DIR)/package.mk
25
26 FPM:=default
27 ifeq ($(ARCH),i386)
28 FPM:=intel
29 endif
30 ifeq ($(ARCH),mipsel)
31 FPM:=mips
32 endif
33
34 define Package/libmad
35 SECTION:=libs
36 CATEGORY:=Libraries
37 TITLE:=An high-quality MPEG audio decoding library
38 DESCRIPTION:=\
39 MAD is a high-quality MPEG audio decoder. It currently supports \\\
40 MPEG-1 and the MPEG-2 extension to lower sampling frequencies, \\\
41 as well as the de facto MPEG 2.5 format. All three audio layers - \\\
42 Layer I, Layer II, and Layer III (i.e. MP3) - are fully implemented.
43 URL:=http://www.underbit.com/products/mad/
44 endef
45
46 define Build/Configure
47 $(call Build/Configure/Default, \
48 --enable-shared \
49 --enable-static \
50 --enable-fpm="$(FPM)" \
51 --disable-debugging \
52 --enable-speed \
53 )
54 endef
55
56 define Build/Compile
57 $(MAKE) -C $(PKG_BUILD_DIR) \
58 DESTDIR="$(PKG_INSTALL_DIR)" \
59 all install
60 endef
61
62 define Build/InstallDev
63 mkdir -p $(STAGING_DIR)/usr/include
64 $(CP) $(PKG_INSTALL_DIR)/usr/include/mad.h $(STAGING_DIR)/usr/include/
65 mkdir -p $(STAGING_DIR)/usr/lib
66 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmad.{a,so*} $(STAGING_DIR)/usr/lib/
67 endef
68
69 define Build/UninstallDev
70 rm -rf \
71 $(STAGING_DIR)/usr/include/mad.h \
72 $(STAGING_DIR)/usr/lib/libmad.{a,so*}
73 endef
74
75 define Package/libmad/install
76 install -d -m0755 $(1)/usr/lib
77 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmad.so.* $(1)/usr/lib/
78 endef
79
80 $(eval $(call BuildPackage,libmad))