Name: ftplib Version: 3.1 Release: 1 Summary: Library of FTP routines Group: System Environment/Libraries License: LGPLv2+ URL: http://nbpfaus.net/~pfau/ftplib/ Source0: http://nbpfaus.net/~pfau/ftplib/%{name}-%{version}-1.tar.gz Patch0: %{name}-%{version}-1-modernize.patch Patch1: %{name}-%{version}-aix.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: patch, make %define _libdir64 %{_prefix}/lib64 %description ftplib is a set of routines that implement the FTP protocol. They allow applications to create and access remote files through function calls instead of needing to fork and exec an interactive ftp client program. %package devel Summary: Development files for %{name} Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel Development libraries and headers for %{name}. %package -n qftp Summary: Simple ftp client application Group: Applications/Internet License: GPLv2+ %description -n qftp Command line driven ftp file transfer program using %{name}. %prep %setup -q -n %{name}-%{version}-1 export PATH=/opt/freeware/bin:$PATH %patch0 -p1 %patch1 %build cd src/ # first build the 64-bit version export OBJECT_MODE=64 gmake %{?_smp_mflags} DEBUG="$CFLAGS" libftp.a CreateExportList -X64 %{name}.exp libftp.a ${CC} -q64 -qmkshrobj libftp.a -o ../libftp.so.3.1 -bE:%{name}.exp rm -f %{name}.exp gmake clean # now build the 32-bit version export OBJECT_MODE=32 gmake %{?_smp_mflags} DEBUG="$CFLAGS" libftp.a CreateExportList -X32 %{name}.exp libftp.a ${CC} -q32 -qmkshrobj libftp.a -o libftp.so.3.1 -bE:%{name}.exp rm -f %{name}.exp libftp.a # now create the AIX-style shared library /usr/bin/ar -X32 -rv libftp.a libftp.so.3.1 /usr/bin/ar -X64 -q libftp.a ../libftp.so.3.1 # finally create the qftp binary gmake qftp %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} cd src/ mkdir -p ${RPM_BUILD_ROOT}%{_bindir} cp qftp ${RPM_BUILD_ROOT}%{_bindir}/ chmod 0755 ${RPM_BUILD_ROOT}%{_bindir}/* /usr/bin/strip ${RPM_BUILD_ROOT}%{_bindir}/* || : mkdir -p ${RPM_BUILD_ROOT}%{_libdir} cp libftp.a libftp.so.3.1 ${RPM_BUILD_ROOT}%{_libdir}/ chmod 0644 ${RPM_BUILD_ROOT}%{_libdir}/*.a ( cd ${RPM_BUILD_ROOT}%{_libdir} ln -sf libftp.so.3.1 libftp.so ) chmod 0755 ${RPM_BUILD_ROOT}%{_libdir}/*.so* mkdir -p ${RPM_BUILD_ROOT}%{_libdir64} cp ../libftp.so.3.1 ${RPM_BUILD_ROOT}%{_libdir64}/ ( cd ${RPM_BUILD_ROOT}%{_libdir64} ln -sf libftp.so.3.1 libftp.so ) chmod 755 ${RPM_BUILD_ROOT}%{_libdir64}/* mkdir -p ${RPM_BUILD_ROOT}%{_includedir} cp %{name}.h ${RPM_BUILD_ROOT}%{_includedir}/ chmod 0644 ${RPM_BUILD_ROOT}%{_includedir}/* cd ${RPM_BUILD_ROOT}%{_bindir} for f in ftpdir ftpget ftplist ftprm ftpsend ; do ln -s qftp $f done ( cd ${RPM_BUILD_ROOT} for dir in bin include lib lib64 do mkdir -p usr/${dir} cd usr/${dir} ln -sf ../..%{_prefix}/${dir}/* . cd - done ) %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system) %doc CHANGES TODO NOTES %{_libdir}/*.a %{_libdir}/*.so* %{_libdir64}/*.so* /usr/lib/*.a %files devel %defattr(-,root,system) %doc additional_rfcs README.ftplib* RFC959.txt html/ %{_includedir}/* /usr/include/* %files -n qftp %defattr(-,root,system) %doc README.qftp %{_bindir}/* /usr/bin/* %changelog * Wed Nov 17 2010 Michael Perzl - 3.1-1 - first version for AIX V5.1 and higher