Add apr package

This commit is contained in:
Alexpux 2013-11-05 23:31:04 +04:00
parent 22f186c9f5
commit a8938f4697
7 changed files with 246 additions and 0 deletions

80
apr/PKGBUILD Normal file
View File

@ -0,0 +1,80 @@
# Maintainer: Alexey Pavlov <alexpux@gmail.com>
pkgname=('apr' 'apr-devel')
pkgver=1.4.8
pkgrel=1
pkgdesc="The Apache Portable Runtime"
arch=('i686' 'x86_64')
url="http://apr.apache.org/"
depends=('libcrypt')
options=('!libtool')
license=('APACHE')
source=(http://www.apache.org/dist/apr/apr-${pkgver}.tar.bz2
apr-1.4.8-msys2.patch
binary-copy.patch
no-undefined.patch
tests-disable_testproc.patch
tests-fix_paths.patch
tests.patch
fix-debian-layout.patch)
md5sums=('ce2ab01a0c3cdb71cf0a6326b8654f41'
'6e42ea624a137cf8846c96a807a00491'
'b2815ff4d642ff19fc659b36cb243eed'
'05e21f412debfdac21599f3f1369f56d'
'678d0d714f063e67b0f537d472e14d11'
'b6671ff8d5051160e7bf1901d7d6c2e9'
'c485befb8f43b5471af01a8bd8def669'
'7e5d21ea2948914d23f73dd49dc5d04f')
prepare() {
cd "${srcdir}/apr-${pkgver}"
patch -p1 -i ${srcdir}/binary-copy.patch
patch -p1 -i ${srcdir}/no-undefined.patch
patch -p1 -i ${srcdir}/tests-disable_testproc.patch
patch -p1 -i ${srcdir}/tests.patch
patch -p1 -i ${srcdir}/tests-fix_paths.patch
patch -p1 -i ${srcdir}/apr-1.4.8-msys2.patch
patch -p1 -i ${srcdir}/fix-debian-layout.patch
autoreconf -fi
}
build() {
cd "${srcdir}/apr-${pkgver}"
./configure --build=${CHOST} \
--prefix=/usr \
--libexecdir=/usr/lib/apr/modules \
--datadir=/usr/share/apr \
--enable-layout=Debian \
ac_cv_header_windows_h=no \
ac_cv_header_winsock2_h=no
make
make DESTDIR="${srcdir}/dest" install
}
check() {
cd "${srcdir}/apr-${pkgver}"
make -j1 check
}
package_apr() {
groups=('libraries')
mkdir -p ${pkgdir}/usr/{bin,share}
cp -f ${srcdir}/dest/usr/bin/*.dll ${pkgdir}/usr/bin/
#cp -rf ${srcdir}/dest/usr/share/doc ${pkgdir}/usr/share/
}
package_apr-devel() {
pkgdesc="Libapr headers and libraries"
groups=('development')
options=('staticlibs')
mkdir -p ${pkgdir}/usr/{bin,share}
cp -f ${srcdir}/dest/usr/bin/*-config ${pkgdir}/usr/bin/
cp -rf ${srcdir}/dest/usr/include ${pkgdir}/usr/
cp -rf ${srcdir}/dest/usr/lib ${pkgdir}/usr/
cp -rf ${srcdir}/dest/usr/share/apr ${pkgdir}/usr/share/
}

31
apr/binary-copy.patch Normal file
View File

@ -0,0 +1,31 @@
From: David Rothenberger <d.rothenberger@entomo.com>
---
file_io/unix/copy.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/file_io/unix/copy.c b/file_io/unix/copy.c
index df3a49c..aa2836f 100644
--- a/file_io/unix/copy.c
+++ b/file_io/unix/copy.c
@@ -29,7 +29,7 @@ static apr_status_t apr_file_transfer_contents(const char *from_path,
apr_fileperms_t perms;
/* Open source file. */
- status = apr_file_open(&s, from_path, APR_FOPEN_READ, APR_OS_DEFAULT, pool);
+ status = apr_file_open(&s, from_path, APR_FOPEN_READ | APR_FOPEN_BINARY, APR_OS_DEFAULT, pool);
if (status)
return status;
@@ -46,7 +46,7 @@ static apr_status_t apr_file_transfer_contents(const char *from_path,
perms = to_perms;
/* Open dest file. */
- status = apr_file_open(&d, to_path, flags, perms, pool);
+ status = apr_file_open(&d, to_path, flags | APR_FOPEN_BINARY, perms, pool);
if (status) {
apr_file_close(s); /* toss any error */
return status;

View File

@ -0,0 +1,11 @@
--- apr-1.4.8/config.layout.orig 2004-11-25 01:51:51.000000000 +0300
+++ apr-1.4.8/config.layout 2013-11-05 19:12:38.554600000 +0400
@@ -216,7 +216,7 @@
# Debian layout
<Layout Debian>
prefix:
- exec_prefix: ${prefix}/usr
+ exec_prefix: ${prefix}
bindir: ${exec_prefix}/bin
sbindir: ${exec_prefix}/sbin
libdir: ${exec_prefix}/lib

22
apr/no-undefined.patch Normal file
View File

@ -0,0 +1,22 @@
From: David Rothenberger <d.rothenberger@entomo.com>
---
configure.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/configure.in b/configure.in
index 9c20dd7..4c175ac 100644
--- a/configure.in
+++ b/configure.in
@@ -283,7 +283,7 @@ AC_ARG_WITH(libtool, [ --without-libtool avoid using libtool to link the
if test "x$use_libtool" = "xyes"; then
lt_compile='$(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -o $@ -c $< && touch $@'
LT_VERSION="-version-info `$get_version libtool $version_hdr APR`"
- link="\$(LIBTOOL) \$(LTFLAGS) --mode=link \$(LT_LDFLAGS) \$(COMPILE) \$(LT_VERSION) \$(ALL_LDFLAGS) -o \$@"
+ link="\$(LIBTOOL) \$(LTFLAGS) --mode=link \$(LT_LDFLAGS) \$(COMPILE) \$(LT_VERSION) -no-undefined \$(ALL_LDFLAGS) -o \$@"
so_ext='lo'
lib_target='-rpath $(libdir) $(OBJECTS)'
export_lib_target='-rpath \$(libdir) \$(OBJECTS)'

View File

@ -0,0 +1,23 @@
From: David Rothenberger <d.rothenberger@entomo.com>
---
test/abts_tests.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/test/abts_tests.h b/test/abts_tests.h
index 13d8b4e..65a4cbb 100644
--- a/test/abts_tests.h
+++ b/test/abts_tests.h
@@ -50,7 +50,9 @@ const struct testlist {
{testpipe},
{testpoll},
{testpool},
+#if ! defined CYGWIN || ! defined MSYS
{testproc},
+#endif
{testprocmutex},
{testrand},
{testsleep},

31
apr/tests-fix_paths.patch Normal file
View File

@ -0,0 +1,31 @@
From: David Rothenberger <d.rothenberger@entomo.com>
---
test/testutil.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/testutil.h b/test/testutil.h
index ee68dfb..d33c2ff 100644
--- a/test/testutil.h
+++ b/test/testutil.h
@@ -25,7 +25,7 @@
* and part of apr, itself
*/
-#ifdef WIN32
+#if defined WIN32 && ! defined CYGWIN && ! defined MSYS
#ifdef BINPATH
#define TESTBINPATH APR_STRINGIFY(BINPATH) "/"
#else
@@ -35,7 +35,7 @@
#define TESTBINPATH "./"
#endif
-#ifdef WIN32
+#if defined WIN32 && ! defined CYGWIN && ! defined MSYS
#define EXTENSION ".exe"
#elif NETWARE
#define EXTENSION ".nlm"

48
apr/tests.patch Normal file
View File

@ -0,0 +1,48 @@
From: David Rothenberger <d.rothenberger@entomo.com>
---
test/Makefile.in | 6 +++---
test/testdso.c | 3 +++
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/test/Makefile.in b/test/Makefile.in
index b371074..af1c38b 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -118,16 +118,16 @@ mod_test.lo: $(srcdir)/mod_test.c
$(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -prefer-pic -o $@ \
-c $(srcdir)/mod_test.c
-OBJECTS_mod_test = mod_test.lo
+OBJECTS_mod_test = mod_test.lo $(LOCAL_LIBS)
mod_test.la: $(OBJECTS_mod_test)
$(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -rpath `pwd` -module \
- -avoid-version $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ \
+ -avoid-version -no-undefined $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ \
$(OBJECTS_mod_test)
OBJECTS_libmod_test = mod_test.lo $(LOCAL_LIBS)
libmod_test.la: $(OBJECTS_libmod_test)
$(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -rpath `pwd` \
- -avoid-version $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ \
+ -avoid-version -no-undefined $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ \
$(OBJECTS_libmod_test) $(ALL_LIBS)
OBJECTS_occhild = occhild.lo $(LOCAL_LIBS)
diff --git a/test/testdso.c b/test/testdso.c
index 0d9f27b..ec81c16 100644
--- a/test/testdso.c
+++ b/test/testdso.c
@@ -35,6 +35,9 @@
# define MOD_NAME "mod_test.so"
#elif defined(WIN32)
# define MOD_NAME TESTBINPATH "mod_test.dll"
+#elif defined(CYGWIN)
+# define MOD_NAME ".libs/mod_test.dll"
+# define LIB_NAME ".libs/cygmod_test.dll"
#elif defined(DARWIN)
# define MOD_NAME ".libs/mod_test.so"
# define LIB_NAME ".libs/libmod_test.dylib"