use Build/Configure/Default macro, Makefile 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 PKG_CAT:=bzcat
25
26 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
27 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
28
29 include $(INCLUDE_DIR)/package.mk
30
31 define Package/curl/Default
32 SECTION:=net
33 CATEGORY:=Network
34 URL:=http://curl.haxx.se/
35 endef
36
37 define Package/curl
38 $(call Package/curl/Default)
39 DEPENDS:=+libcurl
40 TITLE:=A client-side URL transfer library
41 endef
42
43 define Package/libcurl
44 $(call Package/curl/Default)
45 SECTION:=libs
46 CATEGORY:=Libraries
47 DEPENDS:=+libopenssl +zlib
48 TITLE:=A client-side URL transfer utility
49 endef
50
51 define Build/Configure
52 $(call Build/Configure/Default, \
53 --enable-shared \
54 --enable-static \
55 --disable-thread \
56 --enable-cookies \
57 --enable-crypto-auth \
58 --enable-nonblocking \
59 --enable-file \
60 --enable-ftp \
61 --enable-http \
62 --enable-ipv6 \
63 --disable-ares \
64 --disable-debug \
65 --disable-dict \
66 --disable-gopher \
67 --disable-ldap \
68 --disable-manual \
69 --disable-sspi \
70 --disable-telnet \
71 --disable-verbose \
72 --with-random="/dev/urandom" \
73 --with-ssl="$(STAGING_DIR)/usr" \
74 --without-ca-bundle \
75 --without-gnutls \
76 --without-libidn \
77 --with-zlib="$(STAGING_DIR)/usr" \
78 );
79 endef
80
81 define Build/Compile
82 $(MAKE) -C $(PKG_BUILD_DIR) \
83 DESTDIR="$(PKG_INSTALL_DIR)" \
84 all install
85 endef
86
87 define Build/InstallDev
88 mkdir -p $(STAGING_DIR)/usr/bin
89 $(CP) $(PKG_INSTALL_DIR)/usr/bin/curl-config $(STAGING_DIR)/usr/bin/
90 mkdir -p $(STAGING_DIR)/usr/include
91 $(CP) $(PKG_INSTALL_DIR)/usr/include/curl $(STAGING_DIR)/usr/include/
92 mkdir -p $(STAGING_DIR)/usr/lib
93 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurl.{a,so*} $(STAGING_DIR)/usr/lib/
94 $(SED) 's,-I/usr/include,,g' $(STAGING_DIR)/usr/bin/curl-config
95 $(SED) 's,-L/usr/lib,,g' $(STAGING_DIR)/usr/bin/curl-config
96 endef
97
98 define Build/UninstallDev
99 rm -rf $(STAGING_DIR)/usr/bin/curl-config \
100 $(STAGING_DIR)/usr/include/curl \
101 $(STAGING_DIR)/usr/lib/libcurl.{a,so*}
102 endef
103
104 define Package/curl/install
105 install -d -m0755 $(1)/usr/bin
106 $(CP) $(PKG_INSTALL_DIR)/usr/bin/curl $(1)/usr/bin/
107 endef
108
109 define Package/libcurl/install
110 install -d -m0755 $(1)/usr/lib
111 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurl.so.* $(1)/usr/lib/
112 endef
113
114 $(eval $(call BuildPackage,curl))
115 $(eval $(call BuildPackage,libcurl))