add curl pkgconfig dev file, add libtool fixes, cleanup
[openwrt/svn-archive/archive.git] / libs / curl / 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:=curl
12 PKG_VERSION:=7.14.0
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=http://curl.haxx.se/download/ \
17 http://www.mirrorspace.org/curl/ \
18 http://curl.mirror.internet.tp/download/ \
19 ftp://ftp.sunet.se/pub/www/utilities/curl/ \
20 ftp://ftp.planetmirror.com/pub/curl/ \
21 http://www.mirrormonster.com/curl/download/ \
22 http://curl.mirrors.cyberservers.net/download/
23 PKG_MD5SUM:=46ce665e47d37fce1a0bad935cce58a9
24
25 include $(INCLUDE_DIR)/package.mk
26
27 define Package/curl/Default
28 SECTION:=net
29 CATEGORY:=Network
30 URL:=http://curl.haxx.se/
31 endef
32
33 define Package/curl
34 $(call Package/curl/Default)
35 DEPENDS:=+libcurl
36 TITLE:=A client-side URL transfer library
37 endef
38
39 define Package/libcurl
40 $(call Package/curl/Default)
41 SECTION:=libs
42 CATEGORY:=Libraries
43 DEPENDS:=+libopenssl +zlib
44 TITLE:=A client-side URL transfer utility
45 endef
46
47 CONFIGURE_ARGS += \
48 --enable-shared \
49 --enable-static \
50 --disable-thread \
51 --enable-cookies \
52 --enable-crypto-auth \
53 --enable-nonblocking \
54 --enable-file \
55 --enable-ftp \
56 --enable-http \
57 --enable-ipv6 \
58 --disable-ares \
59 --disable-debug \
60 --disable-dict \
61 --disable-gopher \
62 --disable-ldap \
63 --disable-manual \
64 --disable-sspi \
65 --disable-telnet \
66 --disable-verbose \
67 --with-random="/dev/urandom" \
68 --with-ssl="$(STAGING_DIR)/usr" \
69 --without-ca-bundle \
70 --without-gnutls \
71 --without-libidn \
72 --with-zlib="$(STAGING_DIR)/usr" \
73
74 define Build/Configure
75 $(call Build/Configure/Default)
76 $(call libtool_disable_rpath)
77 endef
78
79 define Build/Compile
80 $(MAKE) -C $(PKG_BUILD_DIR) all
81 $(call libtool_fixup_libdir,$(PKG_INSTALL_DIR))
82 $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" install
83 endef
84
85 define Build/InstallDev
86 mkdir -p $(STAGING_DIR)/usr/bin
87 $(CP) $(PKG_INSTALL_DIR)/usr/bin/curl-config $(STAGING_DIR)/usr/bin/
88 mkdir -p $(STAGING_DIR)/usr/include
89 $(CP) $(PKG_INSTALL_DIR)/usr/include/curl $(STAGING_DIR)/usr/include/
90 mkdir -p $(STAGING_DIR)/usr/lib
91 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurl.{a,so*} $(STAGING_DIR)/usr/lib/
92 mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig
93 $(CP) $(PKG_BUILD_DIR)/libcurl.pc $(STAGING_DIR)/usr/lib/pkgconfig/
94 $(SED) 's,-L$$$${exec_prefix}/lib,,g' $(STAGING_DIR)/usr/bin/curl-config
95 $(SED) 's,^includedir=.*,includedir=$(STAGING_DIR)/usr/include,g' $(STAGING_DIR)/usr/lib/pkgconfig/libcurl.pc
96 $(SED) 's,^libdir=.*,libdir=$(STAGING_DIR)/usr/lib,g' $(STAGING_DIR)/usr/lib/pkgconfig/libcurl.pc
97 $(SED) 's,$(TARGET_LDFLAGS),,g' $(STAGING_DIR)/usr/lib/pkgconfig/libcurl.pc
98 endef
99
100 define Build/UninstallDev
101 rm -rf $(STAGING_DIR)/usr/bin/curl-config \
102 $(STAGING_DIR)/usr/include/curl \
103 $(STAGING_DIR)/usr/lib/libcurl.{a,so*} \
104 $(STAGING_DIR)/usr/lib/pkconfig/libcurl.pc
105 endef
106
107 define Package/curl/install
108 $(INSTALL_DIR) $(1)/usr/bin
109 $(CP) $(PKG_INSTALL_DIR)/usr/bin/curl $(1)/usr/bin/
110 endef
111
112 define Package/libcurl/install
113 $(INSTALL_DIR) $(1)/usr/lib
114 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurl.so.* $(1)/usr/lib/
115 endef
116
117 $(eval $(call BuildPackage,curl))
118 $(eval $(call BuildPackage,libcurl))