Joe Orton wrote:

Can you post them for review first?

The patch is to buildconf. It creates apr.spec from apr.spec.in on platforms that support "cut".


On other platforms, this code is ignored.

The apr.spec.in file is modified to include the version number from apr_version.h. Whether the apr.spec.in file is bogus or not does not affect buildconf.

This code was taken from the buildconf currently present inside httpd-2.0.

Regards,
Graham
--
? apr.spec
? build/rpm
Index: buildconf
===================================================================
RCS file: /home/cvs/apr/buildconf,v
retrieving revision 1.30
diff -u -r1.30 buildconf
--- buildconf	6 Jun 2004 21:19:19 -0000	1.30
+++ buildconf	30 Jun 2004 15:45:59 -0000
@@ -83,4 +83,20 @@
 echo "Generating 'make' outputs ..."
 build/gen-build.py make
 
+# Create RPM Spec file
+if [ -f `which cut` ]; then
+  echo rebuilding rpm spec file
+  ( REVISION=`build/get-version.sh all include/apr_version.h APR`
+    VERSION=`echo $REVISION | cut -d- -s -f1`
+    RELEASE=`echo $REVISION | cut -d- -s -f2`
+    if [ "x$VERSION" = "x" ]; then
+      VERSION=$REVISION
+      RELEASE=1
+    fi
+    cat ./build/rpm/apr.spec.in | \
+    sed -e "s/APR_VERSION/$VERSION/" \
+        -e "s/APR_RELEASE/$RELEASE/" \
+    > apr.spec )
+fi
+
 exit 0
%define aprver 1

Summary: Apache Portable Runtime library
Name: apr
Version: APR_VERSION
Release: APR_RELEASE
License: Apache Software License
Group: System Environment/Libraries
URL: http://apr.apache.org/
Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildPrereq: autoconf, libtool, doxygen
Conflicts: subversion < 0.20.1-2

%description
The mission of the Apache Portable Runtime (APR) is to provide a
free library of C data structures and routines, forming a system
portability layer to as many operating systems as possible,
including Unices, MS Win32, BeOS and OS/2.

%package devel
Group: Development/Libraries
Summary: APR library development kit
Requires: apr = %{version}
Conflicts: subversion-devel < 0.20.1-2

%description devel
This package provides the support files which can be used to 
build applications using the APR library.  The mission of the
Apache Portable Runtime (APR) is to provide a free library of 
C data structures and routines.

%prep
%setup -q

%build
# regenerate configure script etc.
./buildconf
%configure \
        --prefix=/usr \
        --includedir=%{_includedir}/apr-%{aprver} \
        --with-installbuilddir=%{_libdir}/apr/build \
        --with-devrandom=/dev/urandom \
        CC=gcc CXX=g++
make %{?_smp_mflags} && make dox

%check
# Run non-interactive tests
%ifarch x86_64
# https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=97611
excludes=testlock
%endif
pushd test
make %{?_smp_mflags} testall CFLAGS=-fno-strict-aliasing
TZ=PST8PDT ./testall -v ${excludes+-x $excludes} || exit 1
popd

%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT

# These are referenced by apr_rules.mk
for f in make_exports.awk make_var_export.awk apr_common.m4 find_apr.m4; do
    install -m 644 build/${f} $RPM_BUILD_ROOT%{_libdir}/apr/build/${f}
done

install -m 755 build/config.sub $RPM_BUILD_ROOT%{_libdir}/apr/build/config.sub
install -m 755 build/mkdir.sh $RPM_BUILD_ROOT%{_libdir}/apr/build/mkdir.sh
install -m 755 build/install.sh $RPM_BUILD_ROOT%{_libdir}/apr/build/install.sh
install -m 755 build/gen-build.py 
$RPM_BUILD_ROOT%{_libdir}/apr/build/gen-build.py

# Sanitize apr_rules.mk
sed -e "/^apr_build/d" \
    -e 's|$(apr_builders)|%{_libdir}/apr/build|g' \
    -e 's|$(apr_builddir)|%{_libdir}/apr/build|g' \
    < build/apr_rules.mk > $RPM_BUILD_ROOT%{_libdir}/apr/build/apr_rules.mk

# Move docs to more convenient location
mv docs/dox/html html

# Unpackaged files:
rm -f $RPM_BUILD_ROOT%{_libdir}/apr.exp

%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc CHANGES LICENSE 
%{_libdir}/libapr-%{aprver}.so.*

%files devel
%defattr(-,root,root,-)
%doc docs/APRDesign.html docs/canonical_filenames.html
%doc docs/incomplete_types docs/non_apr_programs
%doc --parents html
%{_bindir}/apr-config
%{_libdir}/libapr-%{aprver}.*a
%{_libdir}/libapr-%{aprver}.so
%dir %{_libdir}/apr
%dir %{_libdir}/apr/build
%{_libdir}/apr/build/*
%{_libdir}/pkgconfig/apr.pc
%dir %{_includedir}/apr-%{aprver}
%{_includedir}/apr-%{aprver}/*.h

%changelog
* Tue Jun 22 2004 Graham Leggett <[EMAIL PROTECTED]> 1.0.0-1
- update to support v1.0.0 of APR

* Tue Jun 15 2004 Elliot Lee <[EMAIL PROTECTED]>
- rebuilt

* Thu Jun 10 2004 Joe Orton <[EMAIL PROTECTED]> 0.9.4-15
- add support for setuid/setgid/sticky bits (André Malo)
- add apr_threadattr_{guardsize,stacksize}_set() (latter by Jeff Trawick)

* Mon Jun  7 2004 Joe Orton <[EMAIL PROTECTED]> 0.9.4-14
- enable posixsem and process-shared pthread mutex support, but
  ensure that sysvsem remains the default mechanism

* Mon May 24 2004 Joe Orton <[EMAIL PROTECTED]> 0.9.4-13
- entirely remove 2Gb file size limit from apr_file_copy();
  fixes "svnadmin hotcopy" on repos with >2Gb strings table
- work around getnameinfo bugs with v4-mapped addresses
- fix apr_time_exp_get() for dates in 2038 (Philip Martin)

* Thu May 13 2004 Joe Orton <[EMAIL PROTECTED]> 0.9.4-12
- use APR_LARGEFILE in apr_file_{copy,append}

* Wed Mar 24 2004 Joe Orton <[EMAIL PROTECTED]> 0.9.4-11
- add APR_LARGEFILE flag

* Mon Mar 15 2004 Joe Orton <[EMAIL PROTECTED]> 0.9.4-10
- fix configure check for mmap of /dev/zero
- just put -D_GNU_SOURCE in CPPFLAGS not _{BSD,SVID,XOPEN}_SOURCE

* Tue Mar 02 2004 Elliot Lee <[EMAIL PROTECTED]> 0.9.4-9.1
- rebuilt

* Thu Feb 19 2004 Joe Orton <[EMAIL PROTECTED]> 0.9.4-9
- undocument apr_dir_read() ordering constraint and fix tests

* Sun Feb 15 2004 Joe Orton <[EMAIL PROTECTED]> 0.9.4-8
- rebuilt without -Wall -Werror

* Fri Feb 13 2004 Elliot Lee <[EMAIL PROTECTED]> 0.9.4-7
- rebuilt

* Tue Feb  3 2004 Joe Orton <[EMAIL PROTECTED]> 0.9.4-6
- define apr_off_t as int/long/... to prevent it changing
  with _FILE_OFFSET_BITS on 32-bit platforms

* Mon Jan 12 2004 Joe Orton <[EMAIL PROTECTED]> 0.9.4-5
- add apr_temp_dir_get fixes from HEAD

* Thu Jan  8 2004 Joe Orton <[EMAIL PROTECTED]> 0.9.4-4
- ensure that libapr is linked against libpthread
- don't link libapr against -lnsl

* Thu Nov 13 2003 Joe Orton <[EMAIL PROTECTED]> 0.9.4-3
- -devel package no longer requires libtool

* Fri Oct  3 2003 Joe Orton <[EMAIL PROTECTED]> 0.9.4-2
- disable tests on x86_64 (#97611)

* Fri Oct  3 2003 Joe Orton <[EMAIL PROTECTED]> 0.9.4-1
- update to 0.9.4, enable tests
- ensure that libresolv is not used

* Sun Sep  7 2003 Joe Orton <[EMAIL PROTECTED]> 0.9.3-14
- use /dev/urandom (#103049)

* Thu Jul 24 2003 Joe Orton <[EMAIL PROTECTED]> 0.9.3-13
- add back CC=gcc, CXX=g++

* Tue Jul 22 2003 Nalin Dahyabhai <[EMAIL PROTECTED]> 0.9.3-12
- rebuild

* Mon Jul 14 2003 Joe Orton <[EMAIL PROTECTED]> 0.9.3-11
- work round useless autoconf 2.57 AC_DECL_SYS_SIGLIST

* Thu Jul 10 2003 Joe Orton <[EMAIL PROTECTED]> 0.9.3-10
- support --cc and --cpp arguments in apr-config

* Thu Jul  3 2003 Joe Orton <[EMAIL PROTECTED]> 0.9.3-9
- force libtool to use CC=gcc, CXX=g++

* Thu Jul  3 2003 Joe Orton <[EMAIL PROTECTED]> 0.9.3-8
- fix libtool location in apr_rules.mk

* Mon Jun 30 2003 Joe Orton <[EMAIL PROTECTED]> 0.9.3-7
- use AI_ADDRCONFIG in getaddrinfo() support (#73350)
- include a working libtool script rather than relying on
 /usr/bin/libtool (#97695)

* Wed Jun 18 2003 Joe Orton <[EMAIL PROTECTED]> 0.9.3-6
- don't use /usr/bin/libtool

* Wed Jun 04 2003 Elliot Lee <[EMAIL PROTECTED]>
- rebuilt

* Tue May 20 2003 Joe Orton <[EMAIL PROTECTED]> 0.9.3-5
- add fix for psprintf memory corruption (CAN-2003-0245)
- remove executable bit from apr_poll.h

* Thu May  1 2003 Joe Orton <[EMAIL PROTECTED]> 0.9.3-4
- link libapr against libpthread
- make apr-devel conflict with old subversion-devel
- fix License

* Tue Apr 29 2003 Joe Orton <[EMAIL PROTECTED]> 0.9.3-3
- run ldconfig in post/postun

* Tue Apr 29 2003 Joe Orton <[EMAIL PROTECTED]> 0.9.3-2
- patch test suite to not care if IPv6 is disabled

* Mon Apr 28 2003 Joe Orton <[EMAIL PROTECTED]> 0.9.3-1
- initial build

Reply via email to