Browse Source

add APR-util plus my latest APR-util UUID patches

master
parent
commit
3d1361ecc5
  1. 56
      apr/apr.patch
  2. 51
      apr/apr.spec

56
apr/apr.patch

@ -0,0 +1,56 @@
Index: apr-util-1.2.6/crypto/getuuid.c
--- apr-util-1.2.6/crypto/getuuid.c.orig 2005-02-04 21:45:35 +0100
+++ apr-util-1.2.6/crypto/getuuid.c 2006-04-04 19:49:37 +0200
@@ -131,7 +131,7 @@
/* crap. this isn't crypto quality, but it will be Good Enough */
- get_system_time(&time_now);
+ time_now = apr_time_now();
srand((unsigned int)(((time_now >> 32) ^ time_now) & 0xffffffff));
return rand() & 0x0FFFF;
@@ -151,7 +151,7 @@
static apr_interval_time_t time_last = 0;
static apr_interval_time_t fudge = 0;
- time_now = apr_time_now();
+ get_system_time(&time_now);
/* if clock reading changed since last UUID generated... */
if (time_last != time_now) {
@@ -188,17 +188,26 @@
get_current_time(&timestamp);
- d[0] = (unsigned char)timestamp;
- d[1] = (unsigned char)(timestamp >> 8);
- d[2] = (unsigned char)(timestamp >> 16);
- d[3] = (unsigned char)(timestamp >> 24);
- d[4] = (unsigned char)(timestamp >> 32);
- d[5] = (unsigned char)(timestamp >> 40);
- d[6] = (unsigned char)(timestamp >> 48);
- d[7] = (unsigned char)(((timestamp >> 56) & 0x0F) | 0x10);
+ /* UUID field: time_low */
+ d[0] = (unsigned char)(timestamp >> (8*3));
+ d[1] = (unsigned char)(timestamp >> (8*2));
+ d[2] = (unsigned char)(timestamp >> (8*1));
+ d[3] = (unsigned char)(timestamp);
+
+ /* UUID field: time_mid */
+ d[4] = (unsigned char)(timestamp >> (8*5));
+ d[5] = (unsigned char)(timestamp >> (8*4));
+
+ /* UUID field: time_hi_and_version */
+ d[6] = (unsigned char)(((timestamp >> (8*7)) & 0x0F) | 0x10);
+ d[7] = (unsigned char)(timestamp >> (8*6));
+ /* UUID field: clk_seq_hi_res */
d[8] = (unsigned char)(((uuid_state_seqnum >> 8) & 0x3F) | 0x80);
+
+ /* UUID field: clk_seq_low */
d[9] = (unsigned char)uuid_state_seqnum;
+ /* UUID field: node */
memcpy(&d[10], uuid_state_node, NODE_LENGTH);
}

51
apr/apr.spec

@ -33,10 +33,12 @@ Class: PLUS
Group: System
License: Apache
Version: 1.2.6
Release: 20060324
Release: 20060404
# list of sources
Source0: http://www.apache.org/dist/apr/apr-%{version}.tar.gz
Source1: http://www.apache.org/dist/apr/apr-util-%{version}.tar.gz
Patch0: apr.patch
# build information
Prefix: %{l_prefix}
@ -60,24 +62,49 @@ Conflicts: apache2
url = http://www.apache.org/dist/apr/
regex = apr-(__VER__)\.tar\.gz
}
prog apr:apr-util = {
version = %{version}
url = http://www.apache.org/dist/apr/
regex = apr-util-(__VER__)\.tar\.gz
}
%prep
%setup -q
%setup -q -c
%setup -q -D -T -a 1
%patch -p0
%build
CC="%{l_cc}" \
CFLAGS="%{l_cflags -O}" \
./configure \
--prefix=%{l_prefix} \
--includedir=%{l_prefix}/include/apr \
--enable-layout=GNU \
--disable-threads \
--disable-shared
%{l_make} %{l_mflags -O}
( cd apr-%{version}
CC="%{l_cc}" \
CFLAGS="%{l_cflags -O}" \
./configure \
--prefix=%{l_prefix} \
--includedir=%{l_prefix}/include/apr \
--enable-layout=GNU \
--disable-threads \
--disable-shared
%{l_make} %{l_mflags -O}
) || exit $?
( cd apr-util-%{version}
CC="%{l_cc}" \
CFLAGS="%{l_cflags -O}" \
./configure \
--with-apr=`pwd`/../apr-%{version} \
--prefix=%{l_prefix} \
--includedir=%{l_prefix}/include/apr \
--enable-layout=GNU \
--disable-shared
%{l_make} %{l_mflags -O}
) || exit $?
%install
rm -rf $RPM_BUILD_ROOT
%{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
( cd apr-%{version}
%{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
) || exit $?
( cd apr-util-%{version}
%{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
) || exit $?
rm -rf $RPM_BUILD_ROOT%{l_prefix}/build
rm -rf $RPM_BUILD_ROOT%{l_prefix}/share
rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/apr.exp

Loading…
Cancel
Save