clean up, replace old libtool fixup calls with PKG_FIXUP
[packages.git] / libs / libtorrent / Makefile
1
2 # Copyright (C) 2007 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:=libtorrent
12 PKG_VERSION:=0.11.7
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://libtorrent.rakshasa.no/downloads/
17 PKG_MD5SUM:=86cdfca2d1c3cfb3b6b316d9beaa25e0
18
19 PKG_BUILD_DEPENDS:=libtool
20
21 PKG_FIXUP = libtool
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/libtorrent
26   SECTION:=libs
27   CATEGORY:=Libraries
28   TITLE:=Rakshasa's BitTorrent library
29   URL:=http://libtorrent.rakshasa.no/
30   DEPENDS:=+libsigcxx
31 endef
32
33 define Package/libtorrent/description
34  LibTorrent is a BitTorrent library written in C++ for *nix, with a focus 
35  on high performance and good code. The library differentiates itself from 
36  other implementations by transfering directly from file pages to the 
37  network stack. On high-bandwidth connections it is able to seed at 3 times 
38  the speed of the official client.
39 endef
40
41 CONFIGURE_ARGS+= \
42         --enable-shared \
43         --enable-static \
44         --enable-aligned \
45         --disable-debug \
46         --disable-openssl \
47
48 CONFIGURE_VARS += \
49         CXX="g++-uc+std" \
50         CXXFLAGS="$$$$CXXFLAGS -fno-rtti"  \
51
52 define Build/Configure
53         $(call Build/Configure/Default,)
54         $(SED) 's|^sys_lib_dlsearch_path_spec=.*|sys_lib_dlsearch_path_spec="$(STAGING_DIR)/usr/lib"|g' \
55                 $(PKG_BUILD_DIR)/libtool
56         $(SED) 's|^postdeps=.*|postdeps=|g' $(PKG_BUILD_DIR)/libtool
57 endef
58
59 define Build/Compile
60         $(MAKE) -C $(PKG_BUILD_DIR) all
61         $(call libtool_fixup_libdir,$(PKG_INSTALL_DIR))
62         $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" install
63 endef
64
65 define Build/InstallDev
66         mkdir -p $(1)/usr/include
67         $(CP) $(PKG_INSTALL_DIR)/usr/include/torrent $(1)/usr/include/
68         mkdir -p $(1)/usr/lib
69         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtorrent.{a,so*} $(1)/usr/lib/
70         mkdir -p $(1)/usr/lib/pkgconfig
71         $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libtorrent.pc $(1)/usr/lib/pkgconfig/
72         $(SED) 's,$(TARGET_LDFLAGS),,g' $(1)/usr/lib/pkgconfig/libtorrent.pc
73 endef
74
75 define Package/libtorrent/install
76         $(INSTALL_DIR) $(1)/usr/lib
77         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtorrent.so.* $(1)/usr/lib/
78 endef
79
80 $(eval $(call BuildPackage,libtorrent))
81