diff --git a/srcpkgs/libfetch/files/Makefile b/srcpkgs/libfetch/files/Makefile deleted file mode 100644 index 34f3b1d9993..00000000000 --- a/srcpkgs/libfetch/files/Makefile +++ /dev/null @@ -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 diff --git a/srcpkgs/libfetch/libfetch-devel.template b/srcpkgs/libfetch/libfetch-devel.template index a6dc175cffc..f091ebcfa21 100644 --- a/srcpkgs/libfetch/libfetch-devel.template +++ b/srcpkgs/libfetch/libfetch-devel.template @@ -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 } diff --git a/srcpkgs/libfetch/patches/use-ssl-pending.patch b/srcpkgs/libfetch/patches/use-ssl-pending.patch new file mode 100644 index 00000000000..458f1d38129 --- /dev/null +++ b/srcpkgs/libfetch/patches/use-ssl-pending.patch @@ -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) { diff --git a/srcpkgs/libfetch/template b/srcpkgs/libfetch/template index 153025e5ba6..d08f838e7f3 100644 --- a/srcpkgs/libfetch/template +++ b/srcpkgs/libfetch/template @@ -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 " -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