diff --git a/packages/task-spooler/build.sh b/packages/task-spooler/build.sh index ac9d95f699..876e87b057 100644 --- a/packages/task-spooler/build.sh +++ b/packages/task-spooler/build.sh @@ -2,19 +2,12 @@ TERMUX_PKG_HOMEPAGE=https://vicerveza.homeunix.net/~viric/soft/ts/ TERMUX_PKG_DESCRIPTION="Task spooler is a Unix batch system where the tasks spooled run one after the other" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_MAINTAINER="@termux" -TERMUX_PKG_VERSION="2.0.0" -TERMUX_PKG_SRCURL=https://github.com/justanhduc/task-spooler/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz -TERMUX_PKG_SHA256=ffffa86f95071e837af619e23fb4a037432b0b079d872d58dc530883d1d33557 -TERMUX_PKG_AUTO_UPDATE=true +TERMUX_PKG_VERSION=1:1.0.2 +TERMUX_PKG_SRCURL=https://vicerveza.homeunix.net/~viric/soft/ts/ts-${TERMUX_PKG_VERSION:2}.tar.gz +TERMUX_PKG_SHA256=f73452aed80e2f9a7764883e9353aa7f40e65d3c199ad1f3be60fd58b58eafec TERMUX_PKG_CONFLICTS="moreutils" -TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --DTASK_SPOOLER_COMPILE_CUDA=OFF -" -termux_step_pre_configure() { - # if $TERMUX_ON_DEVICE_BUILD; then - if [ "$TERMUX_ON_DEVICE_BUILD" = "false" ]; then - sed -i '/add_executable(makeman man.c)/d' ${TERMUX_PKG_SRCDIR}/CMakeLists.txt - gcc -o ${TERMUX_PKG_BUILDDIR}/makeman ${TERMUX_PKG_SRCDIR}/man.c - fi +termux_step_post_make_install() { + install -Dm600 -t $TERMUX_PREFIX/share/man/man1 \ + $TERMUX_PKG_SRCDIR/ts.1 } diff --git a/packages/task-spooler/fix-hardcoded-paths.patch b/packages/task-spooler/fix-hardcoded-paths.patch index 8ec48fce94..cb7a13e3ce 100644 --- a/packages/task-spooler/fix-hardcoded-paths.patch +++ b/packages/task-spooler/fix-hardcoded-paths.patch @@ -1,18 +1,5 @@ -+++ a/CMakeLists.txt -@@ -84,8 +84,8 @@ - endif(TASK_SPOOLER_COMPILE_CUDA) - - # install --install(CODE "execute_process(COMMAND install -c -d /usr/local/bin)") --install(CODE "execute_process(COMMAND install -c ts /usr/local/bin)") -+install(CODE "execute_process(COMMAND install -c -d @TERMUX_PREFIX@/bin)") -+install(CODE "execute_process(COMMAND install -c ts @TERMUX_PREFIX@/bin)") - install(CODE "execute_process(COMMAND ./makeman)") --install(CODE "execute_process(COMMAND install -c -d /usr/local/share/man/man1)") --install(CODE "execute_process(COMMAND install -c -m 644 ts.1 /usr/local/share/man/man1)") -+install(CODE "execute_process(COMMAND install -c -d @TERMUX_PREFIX@/share/man/man1)") -+install(CODE "execute_process(COMMAND install -c -m 644 ./ts.1 @TERMUX_PREFIX@/share/man/man1)") -+++ a/env.c +--- a/env.c ++++ b/env.c @@ -40,8 +40,8 @@ if (p[1] != 1 && p[1] != 2) close(p[1]); @@ -24,159 +11,42 @@ case -1: error("Fork error"); default: -+++ a/execute.c -@@ -155,7 +155,7 @@ - /* Prepare path */ - int lname; +--- a/execute.c ++++ b/execute.c +@@ -163,7 +163,7 @@ char *outfname_full; -- char *outdir = tmpdir == NULL ? "/tmp" : tmpdir; -+ char *outdir = tmpdir == NULL ? "@TERMUX_PREFIX@/tmp" : tmpdir; - lname = strlen(outdir) + strlen(outfname) + 1 /* \0 */; - outfname_full = (char *) malloc(lname); -+++ a/list.c -@@ -29,7 +29,7 @@ - char *line; + if (tmpdir == NULL) +- tmpdir = "/tmp"; ++ tmpdir = "@TERMUX_PREFIX@/tmp"; + lname = strlen(tmpdir) + strlen(outfname) + 1 /* \0 */; + + outfname_full = (char *)malloc(lname); +--- a/list.c ++++ b/list.c +@@ -19,7 +19,7 @@ + char * line; line = malloc(600); - snprintf(line, 600, "#!/bin/sh\n# - task spooler (ts) job dump\n" + snprintf(line, 600, "#!@TERMUX_PREFIX@/bin/sh\n# - task spooler (ts) job dump\n" - "# This file has been created because a SIGTERM killed\n" - "# your queue server.\n" - "# The finished commands are listed first.\n" -+++ a/mail.c -@@ -34,7 +34,7 @@ + "# This file has been created because a SIGTERM killed\n" + "# your queue server.\n" + "# The finished commands are listed first.\n" +--- a/mail.c ++++ b/mail.c +@@ -36,7 +36,7 @@ close(2); - close(p[1]); + close(p[1]); dup2(p[0], 0); - execl("/usr/sbin/sendmail", "sendmail", "-oi", dest, NULL); + execl("@TERMUX_PREFIX@/bin/sendmail", "sendmail", "-oi", dest, NULL); error("run sendmail"); case -1: error("fork sendmail"); -+++ a/man.c -@@ -105,7 +105,7 @@ - ", or to the\n" - ".B $USER\n" - "using\n" -- ".B /usr/sbin/sendmail.\n" -+ ".B @TERMUX_PREFIX@/bin/sendmail.\n" - "Look at\n" - ".B ENVIRONMENT.\n" - ".TP\n" -@@ -137,7 +137,7 @@ - ".B \"\\-E\"\n" - "Keep two different output files for the command stdout and stderr. stdout goes to\n" - "the file announced by ts (look at \\fB\\-o\\fR), and stderr goes to the stdout file\n" -- "with an additional \".e\". For example, /tmp/ts-out.SKsDw8 and /tmp/ts-out.SKsDw8.e.\n" -+ "with an additional \".e\". For example, @TERMUX_PREFIX@/tmp/ts-out.SKsDw8 and @TERMUX_PREFIX@/tmp/ts-out.SKsDw8.e.\n" - "Only the stdout file gets created with \\fBmkstemp\\fR, ensuring it does not overwrite\n" - "any other; the \".e\" will be overwritten if it existed.\n" - ".TP\n" -@@ -338,7 +338,7 @@ - "temporary directory, \n" - ".B TMPDIR\n" - "will be used if defined, or\n" -- ".B /tmp\n" -+ ".B @TERMUX_PREFIX@/tmp\n" - "otherwise.\n" - ".TP\n" - ".B \"TS_SOCKET\"\n" -@@ -362,7 +362,7 @@ - "or if not defined,\n" - ".B nobody.\n" - "The system\n" -- ".B /usr/sbin/sendmail\n" -+ ".B @TERMUX_PREFIX@/bin/sendmail\n" - "is used. The\n" - "job outputs are not sent as an attachment, so understand the consequences if you\n" - "use the\n" -@@ -382,12 +382,12 @@ - ".TP\n" - ".B \"TS_ENV\"\n" - "This has a command to be run at enqueue time through\n" -- "\\fB/bin/sh\\fR. The output of the command will be readable through the option\n" -+ "\\fB@TERMUX_PREFIX@/bin/sh\\fR. The output of the command will be readable through the option\n" - "\\fB\\-i\\fR. You can use a command which shows relevant environment for the command run.\n" - "For example, you may use \\fBTS_ENV='pwd;set;mount'\\fR.\n" - ".SH FILES\n" - ".TP\n" -- ".B /tmp/ts.error\n" -+ ".B @TERMUX_PREFIX@/tmp/ts.error\n" - "if\n" - ".B ts\n" - "finds any internal problem, you should find an error report there.\n" -@@ -405,7 +405,7 @@ - "in order to set redirections to the command run.\n" - "\n" - "If an internal problem is found in runtime, a file\n" -- ".B /tmp/ts.error\n" -+ ".B @TERMUX_PREFIX@/tmp/ts.error\n" - "is created, which you can submit to the developer in order to fix the bug.\n" - "\n" - ".SH SEE ALSO\n" -@@ -504,7 +504,7 @@ - ", or to the\n" - ".B $USER\n" - "using\n" -- ".B /usr/sbin/sendmail.\n" -+ ".B @TERMUX_PREFIX@/bin/sendmail.\n" - "Look at\n" - ".B ENVIRONMENT.\n" - ".TP\n" -@@ -536,7 +536,7 @@ - ".B \"\\-E\"\n" - "Keep two different output files for the command stdout and stderr. stdout goes to\n" - "the file announced by ts (look at \\fB\\-o\\fR), and stderr goes to the stdout file\n" -- "with an additional \".e\". For example, /tmp/ts-out.SKsDw8 and /tmp/ts-out.SKsDw8.e.\n" -+ "with an additional \".e\". For example, @TERMUX_PREFIX@/tmp/ts-out.SKsDw8 and @TERMUX_PREFIX@/tmp/ts-out.SKsDw8.e.\n" - "Only the stdout file gets created with \\fBmkstemp\\fR, ensuring it does not overwrite\n" - "any other; the \".e\" will be overwritten if it existed.\n" - ".TP\n" -@@ -718,7 +718,7 @@ - "temporary directory, \n" - ".B TMPDIR\n" - "will be used if defined, or\n" -- ".B /tmp\n" -+ ".B @TERMUX_PREFIX@/tmp\n" - "otherwise.\n" - ".TP\n" - ".B \"TS_SOCKET\"\n" -@@ -742,7 +742,7 @@ - "or if not defined,\n" - ".B nobody.\n" - "The system\n" -- ".B /usr/sbin/sendmail\n" -+ ".B @TERMUX_PREFIX@/bin/sendmail\n" - "is used. The\n" - "job outputs are not sent as an attachment, so understand the consequences if you\n" - "use the\n" -@@ -762,12 +762,12 @@ - ".TP\n" - ".B \"TS_ENV\"\n" - "This has a command to be run at enqueue time through\n" -- "\\fB/bin/sh\\fR. The output of the command will be readable through the option\n" -+ "\\fB@TERMUX_PREFIX@/bin/sh\\fR. The output of the command will be readable through the option\n" - "\\fB\\-i\\fR. You can use a command which shows relevant environment for the command run.\n" - "For example, you may use \\fBTS_ENV='pwd;set;mount'\\fR.\n" - ".SH FILES\n" - ".TP\n" -- ".B /tmp/ts.error\n" -+ ".B @TERMUX_PREFIX@/tmp/ts.error\n" - "if\n" - ".B ts\n" - "finds any internal problem, you should find an error report there.\n" -@@ -785,7 +785,7 @@ - "in order to set redirections to the command run.\n" - "\n" - "If an internal problem is found in runtime, a file\n" -- ".B /tmp/ts.error\n" -+ ".B @TERMUX_PREFIX@/tmp/ts.error\n" - "is created, which you can submit to the developer in order to fix the bug.\n" - "\n" - ".SH SEE ALSO\n" -+++ a/server_start.c -@@ -49,7 +49,7 @@ +--- a/server_start.c ++++ b/server_start.c +@@ -51,7 +51,7 @@ /* Create the path */ tmpdir = getenv("TMPDIR"); if (tmpdir == NULL) @@ -185,4 +55,56 @@ sprintf(userid, "%u", (unsigned int) getuid()); - +--- a/ts.1 ++++ b/ts.1 +@@ -70,7 +70,7 @@ + , or to the + .B $USER + using +-.B /usr/sbin/sendmail. ++.B @TERMUX_PREFIX@/bin/sendmail. + Look at + .B ENVIRONMENT. + .TP +@@ -237,7 +237,7 @@ + temporary directory, + .B TMPDIR + will be used if defined, or +-.B /tmp ++.B @TERMUX_PREFIX@/tmp + otherwise. + .TP + .B "TS_SOCKET" +@@ -261,7 +261,7 @@ + or if not defined, + .B nobody. + The system +-.B /usr/sbin/sendmail ++.B @TERMUX_PREFIX@/bin/sendmail + is used. The + job outputs are not sent as an attachment, so understand the consequences if you + use the +@@ -281,12 +281,12 @@ + .TP + .B "TS_ENV" + This has a command to be run at enqueue time through +-\fB/bin/sh\fR. The output of the command will be readable through the option ++\fB@TERMUX_PREFIX@/bin/sh\fR. The output of the command will be readable through the option + \fB\-i\fR. You can use a command which shows relevant environment for the command run. + For example, you may use \fBTS_ENV='pwd;set;mount'\fR. + .SH FILES + .TP +-.B /tmp/ts.error ++.B @TERMUX_PREFIX@/tmp/ts.error + if + .B ts + finds any internal problem, you should find an error report there. +@@ -304,7 +304,7 @@ + in order to set redirections to the command run. + + If an internal problem is found in runtime, a file +-.B /tmp/ts.error ++.B @TERMUX_PREFIX@/tmp/ts.error + is created, which you can submit to the developer in order to fix the bug. + + .SH SEE ALSO