Thank you janhe and gnashley for your suggestions, the puzzling part of this problem was that as gnashley pointed out the script itself
in the tarball was fine. It was only when I examined the
installed script /usr/bin/pgm2txt that I noticed that in fact this script had been mangled during the installation with errors from line 111, where the path to PATH_TO_LANGUAGE_FILTER had been slammed in destroying the if statement.
I cannot yet see where this has happened during installation but I simply took the 'clean' script from the tarball, made the required configuration changes, fixed the 'IMAGE_VIWER' typo and copied it to /usr/bin, the program now works beautifully. Now to investigate what needs to be altered in the slackbuilds script which needs some obvious adjustments, can anybody see the culprit? Mind you I am a little chuffed that I have just now produced my first srt file courtesy of subtitle2pgm, pgm2txt and srttool
.
Edit: The error is
in here:
Code:
EXECUTE_PROCESS(
INPUT_FILE pgm2txt
OUTPUT_FILE pgm2txt.new
COMMAND sed s|PATH_TO_LANGUAGE_FILTER.*|PATH_TO_LANGUAGE_FILTER=@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/subtitleripper|
)
EXECUTE_PROCESS(
COMMAND mv pgm2txt.new pgm2txt
)
where sed makes the first necessary change and then the second and third changes that destroy the script. How to make sed just match the first?
Edit again: Too easy! There is an extra fix in there for the path to the filter files
Code:
COMMAND sed s|^PATH_TO_LANGUAGE_FILTER.*|PATH_TO_LANGUAGE_FILTER=@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/subtitleripper/|
Andrew