%define _libdir64 %{_prefix}/lib64 Name: klish Version: 1.6.2 Release: 1 Summary: A modular framework for implementing a CISCO-like CLI on a *NIX system Group: System Environment/Shells License: GPLv2 URL: https://code.google.com/p/klish/ Source0: https://klish.googlecode.com/files/%{name}-%{version}.tar.bz2 Patch0: %{name}-%{version}-aix.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: expat-devel >= 2.0.1-3 Requires: expat >= 2.0.1-3 %description The klish is a framework for implementing a CISCO-like CLI on a UNIX systems. It is configurable by XML files. The KLISH stands for Kommand Line Interface Shell. I know that "command" starts with "c" :) . The klish is a fork of clish 0.7.3 project (http://sourceforge.net/projects/clish/). The klish obtain some new features but it is compatible (as much as possible) with clish's XML configuration files. The library is available as 32-bit and 64-bit. %package devel Summary: Development files for the klish Library Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel Development libraries and header files for klish. 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 "xlc -q64" or "gcc -maix64". %prep %setup -q %patch0 mkdir ../32bit mv * ../32bit mv ../32bit . mkdir 64bit cd 32bit && tar cf - . | (cd ../64bit ; tar xpf -) %build export CONFIG_SHELL=/usr/bin/ksh export CONFIG_ENV_ARGS=/usr/bin/ksh export CC="xlc_r" cd 64bit # first build the 64-bit version export OBJECT_MODE=64 export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" ./configure \ --prefix=%{_prefix} \ --libdir=%{_libdir64} make %{?_smp_mflags} cd ../32bit # now build the 32-bit version export OBJECT_MODE=32 export LDFLAGS="-L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" ./configure \ --prefix=%{_prefix} make %{?_smp_mflags} %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} cd 64bit export OBJECT_MODE=64 make DESTDIR=${RPM_BUILD_ROOT} install ( cd ${RPM_BUILD_ROOT}%{_bindir} for f in * ; do mv -f ${f} ${f}_64 done ) cd ../32bit export OBJECT_MODE=32 make DESTDIR=${RPM_BUILD_ROOT} install /usr/bin/strip -X32_64 ${RPM_BUILD_ROOT}%{_bindir}/* || : ( cd ${RPM_BUILD_ROOT}%{_libdir64} for f in *.a ; do /usr/bin/ar -X64 -x ${f} done cd ${RPM_BUILD_ROOT}%{_libdir} for f in *.a ; do /usr/bin/ar -X32 -x ${f} done ) # add the 64-bit shared objects to the shared libraries containing already the # 32-bit shared objects for i in clish konf lub tinyrl ; do /usr/bin/ar -X64 -q ${RPM_BUILD_ROOT}%{_libdir}/lib${i}.a ${RPM_BUILD_ROOT}%{_libdir64}/lib${i}.so* 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 32bit/README 32bit/xml-examples %{_bindir}/* %{_libdir}/*.a %{_libdir}/*.so* %{_libdir64}/*.so* /usr/bin/* /usr/lib/*.a /usr/lib/*.so* /usr/lib64/*.so* %files devel %defattr(-,root,system,-) %{_includedir}/clish %{_includedir}/konf/*.h %{_includedir}/lub/*.h %{_includedir}/tinyrl/*.h %{_libdir}/*.la %{_libdir64}/*.la /usr/include/clish /usr/include/konf/*.h /usr/include/lub/*.h /usr/include/tinyrl/*.h /usr/lib/*.la /usr/lib64/*.la %changelog * Tue Dec 04 2012 Michael Perzl - 1.6.2-1 - updated to version 1.6.2 * Tue Sep 04 2012 Michael Perzl - 1.6.1-1 - updated to version 1.6.1 * Thu Jul 05 2012 Michael Perzl - 1.6.0-1 - first version for AIX V5.1 and higher