Summary: Character set conversion library, portable iconv implementation Name: libiconv Version: 1.12 Release: 3 Group: System Environment/Libraries License: LGPL URL: http://www.gnu.org/software/libiconv/ Source0: http://ftp.gnu.org/pub/gnu/%{name}/%{name}-%{version}.tar.gz Source1: http://ftp.gnu.org/pub/gnu/%{name}/%{name}-%{version}.tar.gz.sig BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: gettext Requires: gettext %description GNU libiconv provides an iconv() implementation for use on systems which don't have one or whose implementation cannot convert from/to Unicode. It supports all the important encodings in use today. The library is available as 32-bit and 64-bit. If you are compiling a 32-bit program, no special compiler options are needed. If you are compiling a 64-bit program, you have to compile and link your application with "cc -q64" or "gcc -maix64". %prep %setup -q %build # setup environment for 32-bit and 64-bit builds export AR="/usr/bin/ar -X32_64" export NM="/usr/bin/nm -X32_64" # first build the 64-bit version export CC="cc -q64" ./configure \ --prefix=%{_prefix} \ --mandir=%{_mandir} \ --enable-shared --disable-static \ --enable-extra-encodings make %{?_smp_mflags} cp lib/.libs/libiconv.so.2 . cp libcharset/lib/.libs/libcharset.so.1 . make distclean # now build the 32-bit version export CC="cc" ./configure \ --prefix=%{_prefix} \ --mandir=%{_mandir} \ --enable-shared --disable-static \ --enable-extra-encodings make %{?_smp_mflags} %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} make DESTDIR=${RPM_BUILD_ROOT} install # we need to work around the wrong strategy in the libiconv Makefile, therefore # we create the shared libraries from scratch ourselves export AR="/usr/bin/ar -X32_64" /usr/bin/rm -f ${RPM_BUILD_ROOT}%{_libdir}/*.a ${AR} -rv ${RPM_BUILD_ROOT}%{_libdir}/libcharset.a libcharset/lib/.libs/libcharset.so.1 ${AR} -q ${RPM_BUILD_ROOT}%{_libdir}/libcharset.a ./libcharset.so.1 ${AR} -rv ${RPM_BUILD_ROOT}%{_libdir}/libiconv.a lib/.libs/libiconv.so.2 ${AR} -q ${RPM_BUILD_ROOT}%{_libdir}/libiconv.a ./libiconv.so.2 /usr/bin/strip ${RPM_BUILD_ROOT}%{_bindir}/* || : # create symbolic links ( cd ${RPM_BUILD_ROOT} for dir in bin include lib do mkdir -p usr/linux/${dir} cd usr/linux/${dir} ln -sf ../../..%{_prefix}/${dir}/* . cd - done ) %post # we need to include all shared members of the system wide /usr/lib/libiconv.a # as otherwise if the shared library search order is changed and our library # in /opt/freeware/lib/libiconv.a is found first - e.g. by setting $LIBPATH - # then all system binaries will core dump as they don't find their required # shared members in libiconv.a. export AR="ar -X32_64" export TMPDIR="/tmp/libiconv-hack.tmp" /usr/bin/mkdir -p ${TMPDIR} list=`${AR} -t /usr/lib/libiconv.a` ${AR} -x /usr/lib/libiconv.a cat ${list} | /usr/bin/xargs /usr/bin/strip -X32_64 -e for f in ${list} ; do ${AR} -q %{_libdir}/libiconv.a ${f} done cd /tmp /usr/bin/rm -rf ${TMPDIR} %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system) %doc AUTHORS* COPYING.LIB* ChangeLog* DESIGN* %doc INSTALL.generic* NEWS* NOTES* PORTS* README* THANKS* %{_bindir}/* %{_includedir}/* %{_libdir}/*.*a %{_mandir}/man?/* %{_datadir}/locale/*/*/* /usr/linux/bin/* /usr/linux/include/* /usr/linux/lib/*.a* %changelog * Tue Jul 06 2010 Michael Perzl - 1.12-3 - removed dependency on gettext >= 0.17 - changed way how to include the original /usr/lib/libiconv.a shared members * Thu Oct 16 2008 Michael Perzl - 1.12-2 - fixed the generation of the 64-bit version of the library * Sat Mar 28 2008 Michael Perzl - 1.12-1 - first version for AIX V5.1 and higher