Hi all,

The attached patch attempts to bring apr_iconv more in line with the build structure of apr and apr-util, and includes a spec file.

- The Makefile.in has been patched to prepend ${DESTDIR} onto the output paths on make install.

- The ./buildconf has been altered to create the apr-iconv.spec file from apr-iconv.spec.in in the same way it is done on apr and apr-util.

- A spec file has been added.

- build/get-version.sh has been added from apr/apr-util to be consistent (and make the spec file work)

For some reason apr-iconv's make all target does not do anything on my platform (Linux RHEL3), but this is a separate issue unrelated to the changes above.

Comments?

Regards,
Graham
--
? Makefile
? apr-iconv.spec
? autom4te.cache
? build/get-version.sh
? build/rpm
? build/rules.mk
? ccs/Makefile
? ces/Makefile
? lib/Makefile
? util/Makefile
Index: Makefile.in
===================================================================
RCS file: /home/cvs/apr-iconv/Makefile.in,v
retrieving revision 1.6
diff -u -r1.6 Makefile.in
--- Makefile.in	26 Sep 2003 07:47:13 -0000	1.6
+++ Makefile.in	2 Jul 2004 00:11:13 -0000
@@ -26,25 +26,25 @@
 MKINSTALLDIRS=$(abs_srcdir)/build/mkdir.sh
 
 install:
-	if [ ! -d $(includedir) ]; then \
-	    $(MKINSTALLDIRS) $(includedir); \
+	if [ ! -d $(DESTDIR)$(includedir) ]; then \
+	    $(MKINSTALLDIRS) $(DESTDIR)$(includedir); \
 	fi; \
-	cp -p $(abs_srcdir)/include/*.h $(includedir); \
-	cp -p $(abs_srcdir)/lib/*.h $(includedir); \
-	cp -p $(abs_builddir)/lib/*.h $(includedir); \
+	cp -p $(abs_srcdir)/include/*.h $(DESTDIR)$(includedir); \
+	cp -p $(abs_srcdir)/lib/*.h $(DESTDIR)$(includedir); \
+	cp -p $(abs_builddir)/lib/*.h $(DESTDIR)$(includedir); \
 	if [ ! -d $(lib_prefix) ]; then \
-	    $(MKINSTALLDIRS) $(lib_prefix); \
+	    $(MKINSTALLDIRS) $(DESTDIR)$(lib_prefix); \
 	fi;
-	(cd lib; $(LIBTOOL) --mode=install cp $(TARGET_LIB) $(lib_prefix))
-	if [ ! -d $(libdir) ]; then \
-	    $(MKINSTALLDIRS) $(libdir); \
+	(cd lib; $(LIBTOOL) --mode=install cp $(TARGET_LIB) $(DESTDIR)$(lib_prefix))
+	if [ ! -d $(DESTDIR)$(libdir) ]; then \
+	    $(MKINSTALLDIRS) $(DESTDIR)$(libdir); \
 	fi; \
-	(cd ccs; for i in *.la; do $(LIBTOOL) --mode=install cp $$i $(libdir); done)
-	(cd ces; for i in *.la; do $(LIBTOOL) --mode=install cp $$i $(libdir); done)
-	if [ ! -d $(exec_prefix) ]; then \
-	    $(MKINSTALLDIRS) $(exec_prefix); \
+	(cd ccs; for i in *.la; do $(LIBTOOL) --mode=install cp $$i $(DESTDIR)$(libdir); done)
+	(cd ces; for i in *.la; do $(LIBTOOL) --mode=install cp $$i $(DESTDIR)$(libdir); done)
+	if [ ! -d $(DESTDIR)$(exec_prefix) ]; then \
+	    $(MKINSTALLDIRS) $(DESTDIR)$(exec_prefix); \
 	fi; \
-	(cd util; $(LIBTOOL) --mode=install cp iconv $(exec_prefix))
+	(cd util; $(LIBTOOL) --mode=install cp iconv $(DESTDIR)$(exec_prefix))
 
 docs:
 	mkdir ./docs
Index: buildconf
===================================================================
RCS file: /home/cvs/apr-iconv/buildconf,v
retrieving revision 1.3
diff -u -r1.3 buildconf
--- buildconf	26 Sep 2003 07:47:13 -0000	1.3
+++ buildconf	2 Jul 2004 00:11:13 -0000
@@ -60,3 +60,21 @@
   echo "autoconf failed"
   exit 1
 fi
+
+# Create RPM Spec file
+if [ -f `which cut` ]; then
+  echo rebuilding rpm spec file
+  ( REVISION=`build/get-version.sh all include/api_version.h API`
+    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-iconv.spec.in | \
+    sed -e "s/API_VERSION/$VERSION/" \
+        -e "s/API_RELEASE/$RELEASE/" \
+    > apr-iconv.spec )
+fi
+
+exit 0
%define apiver 1

Summary: Apache Portable Runtime ICONV Charset Conversion library
Name: apr-iconv
Version: API_VERSION
Release: API_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, apr-devel >= 0:{version}-{release}
BuildPrereq: perl

%description
The mission of the Apache Portable Runtime (APR) is to provide a
free library of C data structures and routines.  This library
allows conversion between various charsets (character encoding schemes)
and the command line utility (iconv).

%package devel
Group: Development/Libraries
Summary: APR iconv library development kit
Requires: apr-iconv = %{version}-%{release}, apr-devel
#Requires: openldap-devel, db4-devel, expat-devel

%description devel
This package provides the support files which can be used to 
build applications using the APR iconv 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
%configure --prefix=/usr \
           --with-apr=%{_prefix} \
           --includedir=%{_includedir}/apr-%{apiver} \
make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
make %{?_smp_mflags} install DESTDIR=$RPM_BUILD_ROOT

# Documentation
#mv docs/dox/html html

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

%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc CHANGES LICENSE NOTICE
%{_libdir}/libapriconv-%{apiver}.so.*

%files devel
%defattr(-,root,root,-)
%{_bindir}/api-config
%{_bindir}/api-%{apiver}-config
%{_libdir}/libapriconv-%{apiver}.*a
%{_libdir}/libapriconv-%{apiver}.so
%{_libdir}/pkgconfig/apr-iconv-%{apiver}.pc
%{_includedir}/api-%{apiver}/*.h
%doc --parents html

%changelog
* Tue Jun 22 2004 Graham Leggett <[EMAIL PROTECTED]> 1.0.0-1
- update to support v1.0.0 of APR
                                                                                
* Tue Jun 22 2004 Graham Leggett <[EMAIL PROTECTED]> 1.0.0-1
- derived from Fedora Core apr-util.spec

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to