port curl to buildroot-ng
[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_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
17 PKG_SOURCE_URL:=http://curl.haxx.se/download/ \
18 http://www.mirrorspace.org/curl/ \
19 http://curl.mirror.internet.tp/download/ \
20 ftp://ftp.sunet.se/pub/www/utilities/curl/ \
21 ftp://ftp.planetmirror.com/pub/curl/ \
22 http://www.mirrormonster.com/curl/download/ \
23 http://curl.mirrors.cyberservers.net/download/
24 PKG_MD5SUM:=46ce665e47d37fce1a0bad935cce58a9
25 PKG_CAT:=bzcat
26
27 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
28
29 include $(INCLUDE_DIR)/package.mk
30
31 define Package/libcurl
32 SECTION:=libs
33 CATEGORY:=Libraries
34 DEPENDS:=+libopenssl +zlib
35 TITLE:=A client-side URL transfer utility
36 DESCRIPTION:=A client-side URL transfer utility.
37 URL:=http://curl.haxx.se/
38 endef
39
40 define Package/curl
41 SECTION:=libs
42 CATEGORY:=Libraries
43 DEPENDS:=libcurl
44 TITLE:=A client-side URL transfer library
45 DESCRIPTION:=A client-side URL transfer library.
46 URL:=http://curl.haxx.se/
47 endef
48
49 define Build/Configure
50 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
51 $(TARGET_CONFIGURE_OPTS) \
52 CFLAGS="$(strip $(TARGET_CFLAGS))" \
53 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
54 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
55 PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig" \
56 ./configure \
57 --target=$(GNU_TARGET_NAME) \
58 --host=$(GNU_TARGET_NAME) \
59 --build=$(GNU_HOST_NAME) \
60 --program-prefix="" \
61 --program-suffix="" \
62 --prefix=/usr \
63 --exec-prefix=/usr \
64 --bindir=/usr/bin \
65 --datadir=/usr/share \
66 --includedir=/usr/include \
67 --infodir=/usr/share/info \
68 --libdir=/usr/lib \
69 --libexecdir=/usr/lib \
70 --localstatedir=/var \
71 --mandir=/usr/share/man \
72 --sbindir=/usr/sbin \
73 --sysconfdir=/etc \
74 $(DISABLE_LARGEFILE) \
75 $(DISABLE_NLS) \
76 --enable-shared \
77 --enable-static \
78 --disable-rpath \
79 --with-gnu-ld \
80 --disable-thread \
81 --enable-cookies \
82 --enable-crypto-auth \
83 --enable-nonblocking \
84 --enable-file \
85 --enable-ftp \
86 --enable-http \
87 --enable-ipv6 \
88 --disable-ares \
89 --disable-debug \
90 --disable-dict \
91 --disable-gopher \
92 --disable-ldap \
93 --disable-manual \
94 --disable-sspi \
95 --disable-telnet \
96 --disable-verbose \
97 --with-random="/dev/urandom" \
98 --with-ssl="$(STAGING_DIR)/usr" \
99 --without-ca-bundle \
100 --without-gnutls \
101 --without-libidn \
102 --with-zlib="$(STAGING_DIR)/usr" \
103 );
104 endef
105
106 define Build/Compile
107 rm -rf $(PKG_INSTALL_DIR)
108 mkdir -p $(PKG_INSTALL_DIR)
109 $(MAKE) -C $(PKG_BUILD_DIR) \
110 DESTDIR="$(PKG_INSTALL_DIR)" \
111 all install
112 endef
113
114 define Package/libcurl/install
115 install -m0755 -d $(1)/usr/lib
116 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurl.so.* $(1)/usr/lib/
117 endef
118
119 define Package/curl/install
120 install -m0755 -d $(1)/usr/bin
121 $(CP) $(PKG_INSTALL_DIR)/usr/bin/curl $(1)/usr/bin/
122 endef
123
124 define Build/InstallDev
125 mkdir -p $(STAGING_DIR)/usr/bin
126 $(CP) $(PKG_INSTALL_DIR)/usr/bin/curl-config $(STAGING_DIR)/usr/bin/
127 mkdir -p $(STAGING_DIR)/usr/include
128 $(CP) $(PKG_INSTALL_DIR)/usr/include/curl $(STAGING_DIR)/usr/include/
129 mkdir -p $(STAGING_DIR)/usr/lib
130 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurl.{a,so*} $(STAGING_DIR)/usr/lib/
131 $(SED) 's,-I/usr/include,,g' $(STAGING_DIR)/usr/bin/curl-config
132 $(SED) 's,-L/usr/lib,,g' $(STAGING_DIR)/usr/bin/curl-config
133 endef
134
135 define Build/UninstallDev
136 rm -rf \
137 $(STAGING_DIR)/usr/bin/curl-config \
138 $(STAGING_DIR)/usr/include/curl \
139 $(STAGING_DIR)/usr/lib/libcurl.{a,so*}
140 endef
141
142 $(eval $(call BuildPackage,libcurl))
143 $(eval $(call BuildPackage,curl))