[packages] Use default templates instead of custom reimplementations where applicable
[packages.git] / libs / faad2 / Makefile
1 #
2 # Copyright (C) 2008 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=faad2
11 PKG_VERSION:=2.7
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=@SF/faac
16 PKG_MD5SUM:=4c332fa23febc0e4648064685a3d4332
17
18 PKG_FIXUP:=libtool
19 PKG_INSTALL:=1
20
21 include $(INCLUDE_DIR)/package.mk
22
23 TARGET_CFLAGS += $(FPIC)
24
25 define Package/faad2/Default
26   URL:=http://www.audiocoding.com/faad2.html
27   TITLE:=Freeware Advanced Audio Decoder
28 endef
29
30 define Package/faad2/Default/description
31         FAAD2 is the fastest ISO AAC audio decoder available.
32         FAAD2 correctly decodes all MPEG-4 and MPEG-2 MAIN,
33         LOW, LTP, LD and ER object type AAC files.
34 endef
35
36 define Package/faad2
37 $(call Package/faad2/Default)
38   SECTION:=sound
39   CATEGORY:=Sound
40   TITLE+=player
41   DEPENDS:=+libfaad2
42 endef
43
44 define Package/faad2/description
45 $(call Package/faad2/Default/description)
46   This package contains a binary to play AAC or MP4 files.
47 endef
48
49 define Package/libfaad2
50 $(call Package/faad2/Default)
51   SECTION:=libs
52   CATEGORY:=Libraries
53   TITLE+=library
54 endef
55
56 define Package/libfaad2/description
57 $(call Package/faad2/Default/description)
58   This package contains the library.
59 endef
60
61 define Build/Configure
62         # This replacement were do according to many comments on the web because of gcc 3.4.5 version (.6 included).-
63         # wich doesn't recognices the -iquote parameter to AM_CFLAGS
64         ($(SED) 's,-iquote $$$$(top_srcdir),-I$$$$(top_srcdir),g' $(PKG_BUILD_DIR)/libfaad/Makefile.am; \
65         $(SED) 's,-iquote $$$$(top_srcdir),-I$$$$(top_srcdir),g' $(PKG_BUILD_DIR)/libfaad/Makefile.in);
66         (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status}; \
67                 autoreconf -vif \
68         );
69         $(call Build/Configure/Default, \
70                 --with-mp4v2 \
71                 --without-xmms \
72                 , \
73                 FAAD2_CPPFLAGS="-fno-builtin-cos -fno-builtin-sin -fno-builtin-log" \
74         )
75 endef
76
77 define Build/InstallDev
78         $(INSTALL_DIR) $(1)/usr/include
79         $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include
80         $(INSTALL_DIR) $(1)/usr/lib
81         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfaad.{a,so*} $(1)/usr/lib/
82 endef
83
84 define Package/faad2/install
85         $(INSTALL_DIR) $(1)/usr/bin
86         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/faad $(1)/usr/bin/
87 endef
88
89 define Package/libfaad2/install
90         $(INSTALL_DIR) $(1)/usr/lib
91         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfaad.so.* $(1)/usr/lib/
92 endef
93
94 $(eval $(call BuildPackage,faad2))
95 $(eval $(call BuildPackage,libfaad2))