%define dotests 1 %define _libdir64 %{_prefix}/lib64 %define TCL_Version 8.6.8 %define TK_Version 8.6.8 Summary: A program-script interaction and testing utility Name: expect Version: 5.45.4 Release: 1 License: Public Domain Group: Development/Languages URL: http://expect.nist.gov/ Source0: http://expect.nist.gov/src/%{name}%{version}.tar.gz # Patch0:fixes change log file permissions Patch0: %{name}-%{version}-log_file.patch # Patch1:fixes install location, change pkgIndex Patch1: %{name}-%{version}-pkgpath.patch # examples patches # Patch100: changes random function Patch100: expect-%{version}-random.patch # Patch101: fixes bz674184 - mkpasswd fails randomly Patch101: expect-%{version}-mkpasswd-dash.patch Patch102: expect-%{version}-tclprogpath.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: tcl-devel >= 8.6.8-3 BuildRequires: patch Requires: tcl >= 8.6.8-3 Requires: libgcc >= 6.3.0 %description Expect is a tcl application for automating and testing interactive applications such as telnet, ftp, passwd, fsck, rlogin, tip, etc. Expect makes it easy for a script to control another program and interact with it. This package contains expect and some scripts that use it. %package devel Summary: A program-script interaction and testing utility Group: Development/Languages Requires: %{name} = %{version}-%{release} Requires: tcl-devel >= 8.6.8-3 Requires: tk-devel >= 8.6.8-3 %description devel Expect is a tcl application for automating and testing interactive applications such as telnet, ftp, passwd, fsck, rlogin, tip, etc. Expect makes it easy for a script to control another program and interact with it. This package contains development files for the expect library. %package -n expectk Summary: A program-script interaction and testing utility Group: Development/Languages Requires: %{name} = %{version}-%{release} Requires: tcl >= 8.6.8-3 Requires: tk >= 8.6.8-3 %description -n expectk Expect is a tcl application for automating and testing interactive applications such as telnet, ftp, passwd, fsck, rlogin, tip, etc. Expect makes it easy for a script to control another program and interact with it. This package contains expectk and some scripts that use it. %prep %setup -q -n %{name}%{version} export PATH=/opt/freeware/bin:$PATH %patch0 -p1 -b .log_file %patch1 -p1 -b .pkgpath # examples fixes %patch100 -p1 -b .random %patch101 -p1 -b .mkpasswd-dash # Duplicate source for 32 & 64 bits rm -rf /tmp/%{name}-%{version}-32bit cp -pr . /tmp/%{name}-%{version}-32bit rm -fr * mv /tmp/%{name}-%{version}-32bit 32bit cp -pr 32bit 64bit %build # First build 64 bit cd 64bit export CC="gcc -maix64" 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" export CFLAGS="$CFLAGS -I%{_includedir} -Wl,-brtl" ./configure \ --prefix=%{_prefix} \ --mandir=%{_mandir} \ --libdir=%{_libdir64} \ --enable-shared --enable-static \ --enable-64bit \ --with-tcl=%{_libdir64} \ --with-tclinclude=%{_includedir} \ --with-tkinclude=%{_includedir} \ --with-x make %{?_smp_mflags} if [ "%{dotests}" == 1 ] then ( gmake -k test || true ) /usr/sbin/slibclean fi #Now build 32bit cd ../32bit export CC="gcc -maix32" export OBJECT_MODE=32 export LDFLAGS="-L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" export CFLAGS="$CFLAGS -I%{_includedir} -Wl,-brtl" ./configure \ --prefix=%{_prefix} \ --mandir=%{_mandir} \ --libdir=%{_libdir} \ --with-tcl=%{_libdir} \ --enable-shared --enable-static \ --with-tclinclude=${_includedir} \ --with-tkinclude=${_includedir} \ --with-x make %{?_smp_mflags} if [ "%{dotests}" == 1 ] then ( gmake -k test || true ) /usr/sbin/slibclean fi %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} # install on 64bit mode cd 64bit export OBJECT_MODE=64 make DESTDIR=${RPM_BUILD_ROOT} install # remove cryptdir/decryptdir, as AIX has no crypt command rm -f ${RPM_BUILD_ROOT}%{_bindir}/*cryptdir rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/*cryptdir.1 rm -f ${RPM_BUILD_ROOT}%{_bindir}/autopasswd /usr/bin/strip ${RPM_BUILD_ROOT}%{_bindir}/* || ( cd ${RPM_BUILD_ROOT}/%{_prefix}/bin for fic in $(ls -1| grep -v -e _32 -e _64) do mv $fic "$fic"_64 done ) ln -s tcl8.6/%{name}%{version}/libexpect%{version}.so ${RPM_BUILD_ROOT}%{_libdir64}/libexpect%{version}.so ln -s libexpect%{version}.so ${RPM_BUILD_ROOT}%{_libdir64}/libexpect.so # install on 32bit mode cd ../32bit export OBJECT_MODE=32 make DESTDIR=${RPM_BUILD_ROOT} install # remove cryptdir/decryptdir, as AIX has no crypt command rm -f ${RPM_BUILD_ROOT}%{_bindir}/*cryptdir rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/*cryptdir.1 rm -f ${RPM_BUILD_ROOT}%{_bindir}/autopasswd /usr/bin/strip ${RPM_BUILD_ROOT}%{_bindir}/* || : ( cd ${RPM_BUILD_ROOT}%{_prefix}/bin for fic in $(ls -1| grep -v -e _32 -e _64) do mv $fic "$fic"_32 ln -sf "$fic"_64 $fic done ) # for linking with -lexpect ln -s tcl8.6/%{name}%{version}/libexpect%{version}.so ${RPM_BUILD_ROOT}%{_libdir}/libexpect%{version}.so ln -s libexpect%{version}.so ${RPM_BUILD_ROOT}%{_libdir}/libexpect.so ( cd ${RPM_BUILD_ROOT} for dir in bin do mkdir -p usr/linux/${dir} cd usr/linux/${dir} ln -sf ../../..%{_prefix}/${dir}/* . cd - done ) rm ${RPM_BUILD_ROOT}/usr/linux/bin/mkpasswd mkdir -p ${RPM_BUILD_ROOT}%{_prefix}/expect/bin mv ${RPM_BUILD_ROOT}%{_bindir}/mkpasswd* ${RPM_BUILD_ROOT}%{_prefix}/expect/bin ( mkdir -p ${RPM_BUILD_ROOT}/usr/linux/bin cd ${RPM_BUILD_ROOT}/usr/linux/bin ln -sf ../../..%{_prefix}/expect/bin/mkpasswd . cd - ) %pre lppchk -f expect.base >/dev/null 2>&1 if [[ $? -ne 0 ]] then echo "****expect.base fileset is overwritten by previous release of expect rpm, please reinstall the same from aix media. \ This release onwards we will be shipping mkpasswd in /opt/freeware/expect/bin and softlink in /usr/linux/bin to avoid overwriting \ mkpasswd binary of expect.base****" fi %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc 32bit/FAQ 32bit/HISTORY 32bit/NEWS 32bit/README %{_bindir}/autoexpect %{_bindir}/autoexpect_32 %{_bindir}/autoexpect_64 %{_bindir}/dislocate %{_bindir}/dislocate_32 %{_bindir}/dislocate_64 %{_bindir}/expect %{_bindir}/expect_32 %{_bindir}/expect_64 %{_bindir}/ftp-rfc %{_bindir}/ftp-rfc_32 %{_bindir}/ftp-rfc_64 %{_bindir}/kibitz %{_bindir}/kibitz_32 %{_bindir}/kibitz_64 %{_bindir}/lpunlock %{_bindir}/lpunlock_32 %{_bindir}/lpunlock_64 %{_prefix}/expect/bin/* %{_bindir}/passmass %{_bindir}/passmass_32 %{_bindir}/passmass_64 %{_bindir}/rftp %{_bindir}/rftp_32 %{_bindir}/rftp_64 %{_bindir}/rlogin-cwd %{_bindir}/rlogin-cwd_32 %{_bindir}/rlogin-cwd_64 %{_bindir}/timed-read %{_bindir}/timed-read_32 %{_bindir}/timed-read_64 %{_bindir}/timed-run %{_bindir}/timed-run_32 %{_bindir}/timed-run_64 %{_bindir}/unbuffer %{_bindir}/unbuffer_32 %{_bindir}/unbuffer_64 %{_bindir}/weather %{_bindir}/weather_32 %{_bindir}/weather_64 %{_bindir}/xkibitz %{_bindir}/xkibitz_32 %{_bindir}/xkibitz_64 %{_libdir}/lib*.so %{_libdir}64/lib*.so %dir %{_libdir}/tcl8.6/%{name}%{version} %{_libdir}/tcl8.6/%{name}%{version}/* %dir %{_libdir}64/tcl8.6/%{name}%{version} %{_libdir}64/tcl8.6/%{name}%{version}/* %{_mandir}/man1/autoexpect.1 %{_mandir}/man1/dislocate.1 %{_mandir}/man1/expect.1 %{_mandir}/man1/kibitz.1 %{_mandir}/man1/mkpasswd.1 %{_mandir}/man1/passmass.1 %{_mandir}/man1/tknewsbiff.1 %{_mandir}/man1/unbuffer.1 %{_mandir}/man1/xkibitz.1 /usr/linux/bin/autoexpect /usr/linux/bin/dislocate /usr/linux/bin/expect /usr/linux/bin/ftp-rfc /usr/linux/bin/kibitz /usr/linux/bin/lpunlock /usr/linux/bin/mkpasswd /usr/linux/bin/passmass /usr/linux/bin/rftp /usr/linux/bin/rlogin-cwd /usr/linux/bin/timed-read /usr/linux/bin/timed-run /usr/linux/bin/unbuffer /usr/linux/bin/weather /usr/linux/bin/xkibitz %files devel %defattr(-,root,system,-) %{_includedir}/* %{_mandir}/man3/libexpect.3* %files -n expectk %defattr(-,root,system,-) %{_bindir}/multixterm %{_bindir}/multixterm_32 %{_bindir}/multixterm_64 %{_bindir}/tknewsbiff %{_bindir}/tknewsbiff_32 %{_bindir}/tknewsbiff_64 %{_bindir}/tkpasswd %{_bindir}/tkpasswd_32 %{_bindir}/tkpasswd_64 %{_bindir}/xpstat %{_bindir}/xpstat_32 %{_bindir}/xpstat_64 %{_mandir}/man1/multixterm.1 %{_mandir}/man1/tknewsbiff.1 /usr/linux/bin/multixterm /usr/linux/bin/tknewsbiff /usr/linux/bin/tkpasswd /usr/linux/bin/xpstat %changelog * Fri Dec 20 2019 Ashwini Chandrappa - 5.45.4-1 - Updated to 5.45.4 - Built with gcc - Added 64bit support - Fixed issue of overwritting "mkpasswd" of expect.rte - by shipping it in /opt/freeware/expect/bin and softlink - in /usr/linux/bin - updated with latest version of tcl and tk * Thu Jun 22 2017 Ravi Hirekurabar - 5.45-3 - Updated to 5.45 * Thu Oct 27 2016 Michael Perzl - 5.45-2 - fixed collision with AIX provided expect.base - rebuilt against latest version of tcl * Wed Apr 13 2011 Michael Perzl - 5.45-1 - updated to version 5.45 * Thu Oct 21 2010 Michael Perzl - 5.44.1.15-1 - updated to version 5.44.1.15 * Thu Apr 24 2008 Michael Perzl - 5.43.0-1 - first version for AIX V5.1 and higher