The build of lang/expect looks fine and drags in tcl86-8.6.8 and builds that correctly but at the end result the autoexpect script gets installed down into /usr/local/share/expect/autoexpect when it should be in /usr/local/bin as well as chmod 755. # ls -lapb /usr/local/share/expect/autoexpect -rw-r--r-- 1 root wheel 7706 Oct 26 22:02 /usr/local/share/expect/autoexpect That is wrong.
Created attachment 198682 [details] svn-diff-expect If I am right, this should solve it.
Created attachment 198683 [details] svn-diff-expect_v2 There was a little error in pkg-plist.
cool .. this was an issue that came up on the irc chan and I had built expect/tk/tcl and friends over and over during the past twenty years or so and was surprised that this was .. well .. where it ended up. Looks like an easy fix. Thank you.
Sorry, but it is wriong: https://svnweb.freebsd.org/ports?view=revision&revision=346491 it conflicts with weather, so the patch is not ok.
The only thing it is needed chmod -R 0755 /usr/local/share/expect
And: ln -s /usr/local/bin/tclsh8.6 /usr/local/bin/tcls and add /usr/local/share/expect to $PATH
typo, should be ln -s /usr/local/bin/tclsh8.6 /usr/local/bin/tclsh
(In reply to w.schwarzenfeld from comment #6) The script is supposed to be in /usr/local/bin as per usual and there is no need to add anything to a PATH. It would "just work"(tm).
Yes, see comment4, it was conflicting with astro/weather. And it seems it was no good change. I postet above only as quick workaround for the moment, could never be a solution.
Created attachment 198696 [details] svn-diff-expect_v3 Found a better solution.
Comment on attachment 198696 [details] svn-diff-expect_v3 expect should definitely *not* symlink tclsh8.6 to tclsh. lang/tcl-wrapper is what you're looking for.
The issue, in general, is that expect installs several scripts with names identical to other well-established packages. astro/weather is an example, mail/rftp would be another. I think it's still reasonable to have them all in the dedicated directory %%DATADIR%% and let users either add that to PATH if needed, or call the scripts with tclsh8.6 /usr/local/share/expect/foo. On the other hand, since the scripts invoke tclsh in their shebangs, I think it's reasonable to let expect depend on tcl-wrapper. Would that work for you?
Better yet, modify the scripts to invoke the correct TCLSH. That would be as simple as: @@ -9,11 +9,12 @@ -for i in $(SCRIPT_LIST) ; do \ if [ -f $$i ] ; then \ - $(INSTALL_PROGRAM) $$i $(DESTDIR)$(prefix)/bin/$$i ; \ ++ sed -i'' -e 's|tclsh|${TCLSH_PROG}|' $$i ; \ + $(INSTALL_SCRIPT) $$i $(DESTDIR)$(datadir)/$$i ; \ rm -f $$i ; \ else true; fi ; \ done
If you install it in %%DATADIR%% you have to make at least a pkg-message. The manpage should not in %%DATADIR%%. You cannot call it there. ---- Your solution with tclsh is better. I know mine was not good, but had no better idea.
And it you decide for %%DATADIR%% it would be nice for the user, you can add something like a "start-script" for the scripts in it. something like expect-scripts if [ -e $1 ]; then /usr/local/share/expect/S1 fi (I did not care in the moment of the parameters....)
(In reply to w.schwarzenfeld from comment #14) > If you install it in %%DATADIR%% you have to make at least a pkg-message. I think this is a reasonable proposition. (In reply to w.schwarzenfeld from comment #14) > The manpage should not in %%DATADIR%%. You cannot call it there. If you put them in man1, you will likely not have solved the conflict problem. (In reply to w.schwarzenfeld from comment #15) > And it you decide for %%DATADIR%% it would be nice for the user, you can add something like a "start-script" for the scripts in it. Not sure I get this part. Can you please elaborate / provide a patch?
Put the manpages in man3, like I have done. expect-scripts #I use this name, name it like you want #!/usr/local/bin/bash string=$@ if [ "$string" == "" ]; then echo "USAGE: expect-scripts command parameters" echo "example: expect-scripts autoexpect ftp ftp.myserver.org" exit fi command=/usr/local/share/expect/$string if [ -e /usr/local/share/expect/$1 ]; then eval "$command" fi
Added error message and --help #!/usr/local/bin/bash string=$@ if [ "$string" == "" -o "--help" ]; then echo "USAGE: expect-scripts command parameters" echo "example: expect-scripts autoexpect ftp ftp.myserver.org" exit fi command=/usr/local/share/expect/$string if [ -e /usr/local/share/expect/$1 ]; then eval "$command" else echo "command not found or syntax-error" fi
man3 is wrong - that's for system library functions. So, how is having to use "my_wrapper weather arg1 arg2 arg3" an improvement over using "/usr/loca/share/expect/weather arg1 arg2 arg3"?
There is on e man directory for misc. How can you call the man page from /usr/local/share/expect/some_script ? man -M /usr/local/.... does not work. > So, how is having to use "my_wrapper weather arg1 arg2 arg3" an improvement over using >"/usr/loca/share/expect/weather arg1 arg2 arg3 How ever we did, I should work simple,without to type the whole path.
lot of typos How ever we do, it should work simple,without to type the whole path.
(In reply to w.schwarzenfeld from comment #20) > There is on e man directory for misc. How can you call the man page from /usr/local/share/expect/some_script man /usr/local/share/expect/some_script > How ever we do, it should work simple,without to type the whole path. Add /usr/local/share/expect to PATH, so you don't have to introduce any additional wrapper script. Or nullfs mount it over to /usr/local/bin. There are multiple options to work around the nuisance of having the scripts in a separate location. There is no option to have the scripts in /usr/local/bin and not conflict with other ports. I think things are reasonable as they are.
We could think of putting man pages in the n section, where Tcl man pages usually go. I'll try and see if it doesn't raise any conflicts.
Or rename all scripts and manpages with an "expect-" prefix. /usr/local/bin/expect-mkpasswd /usr/local/man/man1/expect-mkpasswd.1.gz
That's an idea. But don't forget it to mention it in pkg-message.
Patches are welcome, as always.
Created attachment 198744 [details] svn-diff-expect_v4 Here it is. I hope it is right.
Created attachment 198756 [details] svn-diff-expect_v5 Remove chmod from Makefile (did it in pkg-plist). Bump PORTEPOCH, pet portlint.
A commit references this bug: Author: gahr Date: Tue Oct 30 11:03:31 UTC 2018 New revision: 483467 URL: https://svnweb.freebsd.org/changeset/ports/483467 Log: lang/expect: install example scripts and manpages in the proper location This commit changes the location of the example scripts and manpages. They are now installed in the proper PREFIX/bin and PREFIX/man/man1 - so they are in path and reachable by man(1) - and are renamed with an expect_ prefix to avoid conflicts due to their common names. A pkg-message has been added to notify users of this change. Portrevision has been bumped. PR: 232732 (based on) Submitted by: Walter Schwarzenfeld <w.schwarzenfeld@utanet.at> Reported by: Dennis Clarke <dclarke@blastwave.org> Changes: head/lang/expect/Makefile head/lang/expect/files/patch-Makefile.in head/lang/expect/files/patch-tclconfig_tcl.m4 head/lang/expect/files/pkg-message.in head/lang/expect/pkg-plist
I opted for expect_ as a prefix, which is what debian does too: https://packages.debian.org/stretch/amd64/expect/filelist