use Build/Configure/Default macro, Makefile cleanup
[openwrt/svn-archive/archive.git] / libs / libaudiofile / 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:=libaudiofile
12 PKG_VERSION:=0.2.6
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://www.cti.ecp.fr/~beauxir5/peercast
17 PKG_MD5SUM:=460f848ce5f4a33ae66b15a4fb7720ec
18 PKG_CAT:=zcat
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION)
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/libaudiofile
26 SECTION:=libs
27 CATEGORY:=Libraries
28 TITLE:=Audio File library
29 DESCRIPTION:=\
30 The audiofile library allows the processing of audio data to and from audio \\\
31 files of many common formats (currently AIFF, AIFF-C, WAVE, NeXT/Sun, BICS, \\\
32 and raw data).
33 URL:=http://www.68k.org/~michael/audiofile/
34 endef
35
36 define Build/Configure
37 $(call Build/Configure/Default, \
38 --enable-shared \
39 --enable-static \
40 --with-build-cc="$(HOSTCC)" \
41 )
42 endef
43
44 define Build/Compile
45 $(MAKE) -C $(PKG_BUILD_DIR) \
46 DESTDIR="$(PKG_INSTALL_DIR)" \
47 all install
48 endef
49
50 define Build/InstallDev
51 mkdir -p $(STAGING_DIR)/usr/bin
52 $(CP) $(PKG_INSTALL_DIR)/usr/bin/audiofile-config $(STAGING_DIR)/usr/bin/
53 mkdir -p $(STAGING_DIR)/usr/include
54 $(CP) $(PKG_INSTALL_DIR)/usr/include/af_vfs.h $(STAGING_DIR)/usr/include/
55 $(CP) $(PKG_INSTALL_DIR)/usr/include/audiofile.h $(STAGING_DIR)/usr/include/
56 $(CP) $(PKG_INSTALL_DIR)/usr/include/aupvlist.h $(STAGING_DIR)/usr/include/
57 mkdir -p $(STAGING_DIR)/usr/lib
58 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libaudiofile.{a,so*} $(STAGING_DIR)/usr/lib/
59 mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig
60 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/audiofile.pc $(STAGING_DIR)/usr/lib/pkgconfig/
61 $(SED) 's,-I$$$${includedir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/audiofile.pc
62 $(SED) 's,-L$$$${libdir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/audiofile.pc
63 endef
64
65 define Build/UninstallDev
66 rm -rf \
67 $(STAGING_DIR)/usr/include/af_vfs.h \
68 $(STAGING_DIR)/usr/include/audiofile.h \
69 $(STAGING_DIR)/usr/include/aupvlist.h \
70 $(STAGING_DIR)/usr/lib/libaudiofile.{a,so*} \
71 $(STAGING_DIR)/usr/lib/pkgconfig/libaudiofile.pc
72 endef
73
74 define Package/libaudiofile/install
75 install -d -m0755 $(1)/usr/lib
76 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libaudiofile.so.* $(1)/usr/lib/
77 endef
78
79 $(eval $(call BuildPackage,libaudiofile))