libfetch: update to 2.34; includes a patch for the select(2) timeout with SSL.

This commit is contained in:
Juan RP 2013-01-13 17:27:31 +01:00
parent 187acc10ca
commit be6c89b64e
4 changed files with 30 additions and 92 deletions

View file

@ -1,68 +0,0 @@
prefix = /usr
DESTDIR =
DEBUG = false
FETCH_WITH_INET6 = true
FETCH_WITH_OPENSSL = true
WARNINGS = -Wall -Wstrict-prototypes -Wsign-compare -Wchar-subscripts \
-Wpointer-arith -Wcast-align
CFLAGS ?= -O2 -pipe
CFLAGS += -fPIC $(WARNINGS)
CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES
CFLAGS += -DFTP_COMBINE_CWDS -DNETBSD
ifeq ($(strip $(FETCH_WITH_INET6)), true)
CFLAGS += -DINET6
endif
ifeq ($(strip $(FETCH_WITH_OPENSSL)), true)
CFLAGS += -DWITH_SSL
LDADD += -Wl,-lssl -Wl,-lcrypto
endif
INSTALL = install -c -D
OBJS= fetch.o common.o ftp.o http.o file.o
INCS= fetch.h common.h
GEN = ftperr.h httperr.h
MAN = libdownload.3
all: libfetch.so libfetch.a
.PHONY: all
%.o: %.c $(INCS) $(GEN)
$(CC) $(CFLAGS) -c $<
ftperr.h: ftp.errors Makefile errlist.sh
./errlist.sh ftp_errlist FTP ftp.errors > $@
httperr.h: http.errors Makefile errlist.sh
./errlist.sh http_errlist HTTP http.errors > $@
libfetch.so: $(GEN) $(INCS) $(OBJS)
rm -f $@
$(CC) $(LDFLAGS) $(OBJS) $(LDADD) -shared -fPIC -o $@
libfetch.a: $(GEN) $(INCS) $(OBJS)
rm -f $@
$(AR) rcs $@ $(OBJS)
clean:
rm -f libfetch.so libfetch.a *.o $(GEN)
.PHONY: clean
install: all
$(INSTALL) -m 755 libfetch.so $(DESTDIR)$(prefix)/lib/libfetch.so
$(INSTALL) -m 644 libfetch.a $(DESTDIR)$(prefix)/lib/libfetch.a
$(INSTALL) -m 644 fetch.h $(DESTDIR)$(prefix)/include/fetch.h
$(INSTALL) -m 644 fetch.3 $(DESTDIR)$(prefix)/share/man/man3/fetch.3
.PHONY: install
uninstall:
rm -f $(DESTDIR)$(prefix)/lib/libfetch.so
rm -f $(DESTDIR)$(prefix)/lib/libfetch.a
rm -f $(DESTDIR)$(prefix)/include/fetch.h
rm -f $(DESTDIR)$(prefix)/share/man/man3/fetch.3
.PHONY: uninstall

View file

@ -1,15 +1,10 @@
# Template file for 'libfetch-devel'.
#
depends="openssl-devel libfetch"
depends="openssl-devel libfetch>=${version}"
short_desc="${short_desc} - development files"
long_desc="${long_desc}
This package contains files for development, headers, static libs, etc."
do_install()
{
mkdir -p ${DESTDIR}/usr/lib
mv ${SRCPKGDESTDIR}/usr/{include,share} ${DESTDIR}/usr
mv ${SRCPKGDESTDIR}/usr/lib/*.a ${DESTDIR}/usr/lib
do_install() {
vmove usr/include usr
vmove usr/share usr
vmove "usr/lib/*.a" usr/lib
}

View file

@ -0,0 +1,18 @@
select() times out if there's no IO ready in the socket which sometimes
might happen due to OpenSSL buffering.
Use SSL_pending(3) to make sure SSL_read(3) sucks in last buffered bytes.
--- common.c.orig 2013-01-13 17:12:06.434631196 +0100
+++ common.c 2013-01-13 17:12:36.185921621 +0100
@@ -529,6 +529,10 @@ fetch_read(conn_t *conn, char *buf, size
fetch_syserr();
return (-1);
}
+#ifdef WITH_SSL
+ if (conn->ssl && SSL_pending(conn->ssl))
+ break;
+#endif
errno = 0;
r = select(conn->sd + 1, &readfds, NULL, NULL, &waittv);
if (r == -1) {

View file

@ -1,20 +1,13 @@
# Template file for 'libfetch'
pkgname=libfetch
version=2.33
distfiles="ftp://ftp.archlinux.org/other/$pkgname/$pkgname-$version.tar.gz"
version=2.34
revision=1
build_style=gnu-makefile
revision=2
subpackages="${pkgname}-devel"
makedepends="openssl-devel"
short_desc="File Transfer Library for URLs"
maintainer="Juan RP <xtraeme@gmail.com>"
checksum=3226f53d5ad29cc27510db968ef0d37bf4554b8aaaeadcd56e23067213b08943
long_desc="
libfetch provides a high-level library for retrieving and uploading
files using Uniform Resource Locators (URLs)."
subpackages="$pkgname-devel"
pre_build()
{
cp ${FILESDIR}/Makefile ${wrksrc}
}
homepage="http://www.FreeBSD.org"
license="Modified BSD"
distfiles="http://xbps.nopcode.org/distfiles/${pkgname}-${version}.tar.xz"
checksum=4e6d4541f213c9ab42ea94d49c2573f0a6f54b04f14668530960f1424b04f722