###############################################################################
name = expect
-version = 5.45
-release = 2
+version = 5.45.4
+release = 1
thisapp = %{name}%{version}
groups = Development/Languages
-url = http://expect.nist.gov/
+url = https://core.tcl-lang.org/expect/index
license = Public Domain
summary = A program-script interaction and testing utility.
control another program and interact with it.
end
-source_dl = http://downloads.sourceforge.net/project/expect/Expect/%{version}/
+source_dl = https://downloads.sourceforge.net/project/expect/Expect/%{version}/
build
requires
- autoconf
- automake
- chrpath
tcl-devel
end
- prepare_cmds
- aclocal
- autoconf
-
- cd testsuite
- autoconf -I..
- end
-
configure_options += \
- --mandir=%{mandir} \
--with-tcl=%{libdir} \
--with-tclinclude=%{includedir} \
--enable-shared
end
install_cmds
- # Install lib to right location.
- mkdir -pv %{BUILDROOT}%{libdir}
- mv -v %{BUILDROOT}/%{libdir}/tcl*/expect%{version}/libexpect%{version}.so \
- %{BUILDROOT}%{libdir}
- ln -svf libexpect%{version}.so %{BUILDROOT}%{libdir}/libexpect.so
-
- # Remove rpath.
- chrpath --delete %{BUILDROOT}%{libdir}/libexpect%{version}.so
-
- # remove cryptdir/decryptdir, as Linux has no crypt command
- rm -f %{BUILDROOT}/usr/bin/{cryptdir,decryptdir}
- rm -f %{BUILDROOT}/usr/share/man1/{cryptdir,decryptdir}.1*
- rm -f %{BUILDROOT}/usr/bin/autopasswd
+ # Remove cryptdir/decryptdir, as Linux has no crypt command
+ rm -vf %{BUILDROOT}/usr/bin/{cryptdir,decryptdir}
+ rm -vf %{BUILDROOT}/usr/share/man1/{cryptdir,decryptdir}.1*
+ rm -vf %{BUILDROOT}/usr/bin/autopasswd
end
end
+++ /dev/null
-diff -up expect-5.44.1.15/example/mkpasswd.orig expect-5.44.1.15/example/mkpasswd
---- expect-5.44.1.15/example/mkpasswd.orig 2010-03-08 16:01:05.518378075 +0100
-+++ expect-5.44.1.15/example/mkpasswd 2010-03-08 16:01:27.408388162 +0100
-@@ -92,7 +92,14 @@ proc insert {pvar char} {
- }
-
- proc rand {m} {
-- expr {int($m*rand())}
-+ set device /dev/urandom ;# /dev/random can block
-+ set fileId [open $device r]
-+ binary scan [read $fileId 4] i1 number
-+ set clipped [expr $number % $m]
-+# puts "number is $number"
-+# puts "clipped is $clipped"
-+ close $fileId
-+ return $clipped
- }
-
- # choose left or right starting hand
+++ /dev/null
-diff -up expect-5.44.1.15/exp_log.c.orig expect-5.44.1.15/exp_log.c
---- expect-5.44.1.15/exp_log.c.orig 2010-03-08 15:45:20.581378309 +0100
-+++ expect-5.44.1.15/exp_log.c 2010-03-08 15:45:38.838398279 +0100
-@@ -374,7 +374,7 @@ expDiagChannelOpen(interp,filename)
- Tcl_DStringAppend(&tsdPtr->diagFilename,filename,-1);
- }
-
-- tsdPtr->diagChannel = Tcl_OpenFileChannel(interp,newfilename,"a",0777);
-+ tsdPtr->diagChannel = Tcl_OpenFileChannel(interp,newfilename,"a",0666);
- if (!tsdPtr->diagChannel) {
- Tcl_DStringFree(&tsdPtr->diagFilename);
- return TCL_ERROR;
+++ /dev/null
-diff -up expect5.45/configure.in.orig expect5.45/configure.in
---- expect5.45/configure.in.orig 2011-01-18 16:58:14.860806442 +0100
-+++ expect5.45/configure.in 2011-01-18 16:58:30.378753210 +0100
-@@ -977,6 +977,7 @@ AC_SUBST(EXP_CC_SEARCH_FLAGS)
- AC_SUBST(SETUID)
- AC_SUBST(SETPGRP_VOID)
- AC_SUBST(DEFAULT_STTY_ARGS)
-+AC_SUBST(TCL_VERSION)
- # Expect uses these from tclConfig.sh to make the main executable
- AC_SUBST(TCL_DL_LIBS)
- AC_SUBST(TCL_CC_SEARCH_FLAGS)
-diff -up expect5.45/Makefile.in.orig expect5.45/Makefile.in
---- expect5.45/Makefile.in.orig 2011-01-18 16:58:37.787723824 +0100
-+++ expect5.45/Makefile.in 2011-01-18 17:05:10.697636907 +0100
-@@ -121,8 +121,8 @@ includedir = @includedir@
- DESTDIR =
-
- PKG_DIR = $(PACKAGE_NAME)$(PACKAGE_VERSION)
--pkgdatadir = $(datadir)/$(PKG_DIR)
--pkglibdir = $(libdir)/$(PKG_DIR)
-+pkgdatadir = $(datadir)/tcl@TCL_VERSION@/$(PKG_DIR)
-+pkglibdir = $(libdir)/tcl@TCL_VERSION@/$(PKG_DIR)
- pkgincludedir = $(includedir)/$(PKG_DIR)
-
- top_builddir = .
-@@ -263,7 +263,7 @@ install-doc: doc
- else true; fi ; \
- done
-
--test: binaries libraries
-+test: binaries libraries pkgIndex.tcl-test
- $(TCLSH) `@CYGPATH@ $(srcdir)/tests/all.tcl` $(TESTFLAGS)
-
- shell: binaries libraries
-@@ -331,6 +331,11 @@ pkgIndex.tcl:
- pkgIndex.tcl-hand:
- (echo 'if {![package vsatisfies [package provide Tcl] @TCL_VERSION@]} {return}' ; \
- echo 'package ifneeded Expect $(PACKAGE_VERSION) \
-+ [list load [file join $$dir .. .. $(PKG_LIB_FILE)]]'\
-+ ) > pkgIndex.tcl
-+
-+pkgIndex.tcl-test:
-+ (echo 'package ifneeded Expect $(PACKAGE_VERSION) \
- [list load [file join $$dir $(PKG_LIB_FILE)]]'\
- ) > pkgIndex.tcl
-
+++ /dev/null
-diff -up expect5.45/example/passmass.orig expect5.45/example/passmass
---- expect5.45/example/passmass.orig 2011-07-27 16:09:31.013843393 +0200
-+++ expect5.45/example/passmass 2011-07-27 16:10:55.667843578 +0200
-@@ -107,6 +107,10 @@ for {set i 0} {$i<$argc} {incr i} {
- set login "ssh"
- continue
- } "-telnet" {
-+ if {[file executable /usr/bin/telnet] == 0} {
-+ send_user "It seems that telnet is not installed. Please install telnet in order to use the script with this option.\n"
-+ exit 1
-+ }
- set login "telnet"
- continue
- } "-program" {
-diff -up expect5.45/example/weather.orig expect5.45/example/weather
---- expect5.45/example/weather.orig 2011-07-27 15:49:57.878843862 +0200
-+++ expect5.45/example/weather 2011-07-27 16:08:48.067843491 +0200
-@@ -33,6 +33,11 @@ set timeout 60
-
- set env(TERM) vt100 ;# actual value doesn't matter, just has to be set
-
-+if {[file executable /usr/bin/telnet] == 0} {
-+ send_user "It seems that telnet is not installed. Please install telnet in order to use this script.\n"
-+ exit 1
-+}
-+
- spawn telnet rainmaker.wunderground.com 3000
- while {1} {
- expect timeout {
--- /dev/null
+--- a/exp_clib.c.orig 2017-03-24 10:34:37.269183513 -0400
++++ b/exp_clib.c 2017-03-24 10:34:41.171117943 -0400
+@@ -1938,8 +1938,8 @@
+ char *str;
+ {
+ if (exp_is_debugging) {
+- fprintf(stderr,str);
+- if (exp_logfile) fprintf(exp_logfile,str);
++ fprintf(stderr, "%s", str);
++ if (exp_logfile) fprintf(exp_logfile, "%s", str);
+ }
+ }
+
+++ /dev/null
-diff -up expect5.45/expect.man.orig expect5.45/expect.man
---- expect5.45/expect.man.orig 2011-09-06 13:15:57.081827720 +0200
-+++ expect5.45/expect.man 2011-09-06 13:16:19.463826364 +0200
-@@ -173,7 +173,8 @@ way, use the
- .B \-b
- flag.
- (When using Expectk, this option is specified as
--.BR \-buffer .) Note that stdio-buffering may still take place however this shouldn't cause problems when reading from a fifo or stdin.
-+.BR \-buffer .)
-+Note that stdio-buffering may still take place however this shouldn't cause problems when reading from a fifo or stdin.
- .PP
- If the string "\-" is supplied as a filename, standard input is read instead.
- (Use "./\-" to read from a file actually named "\-".)
+++ /dev/null
-diff -up expect5.45/expect.c.orig expect5.45/expect.c
---- expect5.45/expect.c.orig 2012-02-06 14:15:13.469490744 +0100
-+++ expect5.45/expect.c 2012-02-06 14:16:23.596837896 +0100
-@@ -2363,7 +2363,12 @@ expMatchProcess(
-
- /* "!e" means no case matched - transfer by default */
- if (!e || e->transfer) {
-- int remainder = numchars-match;
-+ int remainder;
-+ if (match > numchars) {
-+ match = numchars;
-+ eo->matchlen = match;
-+ }
-+ remainder = numchars-match;
- /* delete matched chars from input buffer */
- esPtr->printed -= match;
- if (numchars != 0) {
+++ /dev/null
-diff -up expect5.45/example/mkpasswd.orig expect5.45/example/mkpasswd
---- expect5.45/example/mkpasswd.orig 2011-03-16 13:23:23.125480017 +0100
-+++ expect5.45/example/mkpasswd 2011-03-16 13:24:08.739353139 +0100
-@@ -202,7 +202,8 @@ if {[info exists user]} {
- expect {
- "assword*:" {
- # some systems say "Password (again):"
-- send "$password\r"
-+ send -- "$password\r"
-+ # "--" because of passwords beginning with dash
- exp_continue
- }
- }
+++ /dev/null
-diff -up expect5.45/example/passmass.orig expect5.45/example/passmass
---- expect5.45/example/passmass.orig 2011-09-06 13:04:41.439875491 +0200
-+++ expect5.45/example/passmass 2011-09-06 13:04:54.663874571 +0200
-@@ -178,7 +178,7 @@ for {set i 0} {$i<$argc} {incr i} {
- }
-
- if ($su) {
-- send "su -\r"
-+ send "/bin/su -\r"
- expect -nocase "password:"
- send "$password(old)\r"
- expect "# "