port gnutls to buildroot-ng
[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_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=@SF/mad \
18 ftp://ftp.mars.org/pub/mpeg/
19 PKG_MD5SUM:=1be543bc30c56fb6bea1d7bf6a64e66c
20 PKG_CAT:=zcat
21
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:=An high-quality MPEG audio decoding library.\\\
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 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
48 $(TARGET_CONFIGURE_OPTS) \
49 CFLAGS="$(strip $(TARGET_CFLAGS))" \
50 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
51 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
52 PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig" \
53 ./configure \
54 --target=$(GNU_TARGET_NAME) \
55 --host=$(GNU_TARGET_NAME) \
56 --build=$(GNU_HOST_NAME) \
57 --program-prefix="" \
58 --program-suffix="" \
59 --prefix=/usr \
60 --exec-prefix=/usr \
61 --bindir=/usr/bin \
62 --datadir=/usr/share \
63 --includedir=/usr/include \
64 --infodir=/usr/share/info \
65 --libdir=/usr/lib \
66 --libexecdir=/usr/lib \
67 --localstatedir=/var \
68 --mandir=/usr/share/man \
69 --sbindir=/usr/sbin \
70 --sysconfdir=/etc \
71 $(DISABLE_LARGEFILE) \
72 $(DISABLE_NLS) \
73 --enable-shared \
74 --enable-static \
75 --disable-rpath \
76 --with-gnu-ld \
77 --enable-fpm=$(FPM) \
78 --disable-debugging \
79 --enable-speed \
80 );
81 endef
82
83 define Build/Compile
84 rm -rf $(PKG_INSTALL_DIR)
85 mkdir -p $(PKG_INSTALL_DIR)
86 $(MAKE) -C $(PKG_BUILD_DIR) \
87 DESTDIR="$(PKG_INSTALL_DIR)" \
88 all install
89 endef
90
91 define Package/libmad/install
92 install -m0755 -d $(1)/usr/lib
93 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmad.so.* $(1)/usr/lib/
94 endef
95
96 define Build/InstallDev
97 mkdir -p $(STAGING_DIR)/usr/include
98 $(CP) $(PKG_INSTALL_DIR)/usr/include/mad.h $(STAGING_DIR)/usr/include/
99 mkdir -p $(STAGING_DIR)/usr/lib
100 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmad.{a,so*} $(STAGING_DIR)/usr/lib/
101 endef
102
103 define Build/UninstallDev
104 rm -rf \
105 $(STAGING_DIR)/usr/include/mad.h \
106 $(STAGING_DIR)/usr/lib/libmad.{a,so*}
107 endef
108
109 $(eval $(call BuildPackage,libmad))