Retain symlinks. $(INSTALL_*) copys the contens of a file, so if we want to keep
[openwrt/svn-archive/archive.git] / libs / libaudiofile / Makefile
index ca3aaf2..a13965d 100644 (file)
@@ -1,5 +1,5 @@
-# 
-# Copyright (C) 2006 OpenWrt.org
+#
+# Copyright (C) 2006-2008 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -10,17 +10,17 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libaudiofile
 PKG_VERSION:=0.2.6
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.cti.ecp.fr/~beauxir5/peercast
 PKG_MD5SUM:=460f848ce5f4a33ae66b15a4fb7720ec
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION)
-PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
+PKG_FIXUP:=libtool
 
 include $(INCLUDE_DIR)/package.mk
 
+PKG_INSTALL=1
+
 define Package/libaudiofile
   SECTION:=libs
   CATEGORY:=Libraries
@@ -34,6 +34,8 @@ define Package/libaudiofile/description
        and raw data).
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Configure
        $(call Build/Configure/Default, \
                --enable-shared \
@@ -42,28 +44,36 @@ define Build/Configure
        )
 endef
 
-define Build/Compile
-       $(MAKE) -C $(PKG_BUILD_DIR) \
-               DESTDIR="$(PKG_INSTALL_DIR)" \
-               all install
-endef
-
 define Build/InstallDev
-       mkdir -p $(1)/usr/bin
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/audiofile-config $(1)/usr/bin/
-       mkdir -p $(1)/usr/include
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/af_vfs.h $(1)/usr/include/
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/audiofile.h $(1)/usr/include/
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/aupvlist.h $(1)/usr/include/
-       mkdir -p $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libaudiofile.{a,so*} $(1)/usr/lib/
-       mkdir -p $(1)/usr/lib/pkgconfig
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/audiofile.pc $(1)/usr/lib/pkgconfig/
+       $(INSTALL_DIR) $(2)/bin
+       $(INSTALL_BIN) \
+               $(PKG_INSTALL_DIR)/usr/bin/audiofile-config \
+               $(2)/bin/
+       $(SED) \
+               's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \
+               $(2)/bin/audiofile-config
+
+       $(INSTALL_DIR) $(1)/usr/include
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)/usr/include/{af_vfs,audiofile,aupvlist}.h \
+               $(1)/usr/include/
+
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libaudiofile.{la,a,so*} \
+               $(1)/usr/lib/
+
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/audiofile.pc \
+               $(1)/usr/lib/pkgconfig/
 endef
 
 define Package/libaudiofile/install
        $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libaudiofile.so.* $(1)/usr/lib/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libaudiofile.so.* \
+               $(1)/usr/lib/
 endef
 
 $(eval $(call BuildPackage,libaudiofile))