new package: lrzip

This commit is contained in:
Tee KOBAYASHI 2022-11-15 22:31:51 +09:00 committed by xtkoba
parent 1f96f22189
commit 0341dd2bb0
3 changed files with 83 additions and 0 deletions

21
packages/lrzip/build.sh Normal file
View File

@ -0,0 +1,21 @@
TERMUX_PKG_HOMEPAGE=https://github.com/ckolivas/lrzip
TERMUX_PKG_DESCRIPTION="A compression utility that excels at compressing large files"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=0.651
TERMUX_PKG_SRCURL=https://github.com/ckolivas/lrzip/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=f4c84de778a059123040681fd47c17565fcc4fec0ccc68fcf32d97fad16cd892
TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_DEPENDS="bash, libbz2, libc++, liblz4, liblzo, zlib"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
--enable-asm=no
"
# Avoid conflicting with lrzsz.
TERMUX_PKG_RM_AFTER_INSTALL="
bin/lrz
share/man/man1/lrz.1
"
termux_step_pre_configure() {
autoreconf -fi
}

View File

@ -0,0 +1,11 @@
--- a/configure.ac
+++ b/configure.ac
@@ -107,7 +107,7 @@
AC_C_BIGENDIAN
-AC_CHECK_LIB(pthread, pthread_create, ,
+AC_CHECK_LIB(c, pthread_create, ,
AC_MSG_ERROR([Could not find pthread library - please install libpthread]))
AC_CHECK_LIB(m, sqrt, ,
AC_MSG_ERROR([Could not find math library - please install libm]))

View File

@ -0,0 +1,51 @@
--- a/doc/lrzip.conf.example
+++ b/doc/lrzip.conf.example
@@ -48,7 +48,7 @@
# REPLACEFILE = YES
# Override for Temporary Directory. Only valid when stdin/out or Test is used
-# TMPDIR = /tmp
+# TMPDIR = @TERMUX_PREFIX@/tmp
# Whether to use encryption on compression YES, NO (-e)
# ENCRYPT = NO
--- a/lrzip.c
+++ b/lrzip.c
@@ -470,10 +470,10 @@
/* Use /tmp if nothing is writeable so far */
if (fd_in == -1) {
dealloc(control->infile);
- control->infile = malloc(20);
+ control->infile = malloc(sizeof("@TERMUX_PREFIX@/tmp/lrzipin.XXXXXX"));
if (unlikely(!control->infile))
fatal_return(("Failed to allocate infile name\n"), -1);
- strcpy(control->infile, "/tmp/lrzipin.XXXXXX");
+ strcpy(control->infile, "@TERMUX_PREFIX@/tmp/lrzipin.XXXXXX");
fd_in = mkstemp(control->infile);
}
--- a/man/lrzip.conf.5
+++ b/man/lrzip.conf.5
@@ -12,7 +12,7 @@
three places\&:
.nf
$PWD \- Current Directory
-/etc/lrzip
+@TERMUX_PREFIX@/etc/lrzip
$HOME/\&.lrzip
.PP
Parameters are set in \fBPARAMETER\&=VALUE\fP fashion where any line
--- a/util.c
+++ b/util.c
@@ -209,9 +209,9 @@
}
}
if (fp == NULL) {
- fp = fopen("/etc/lrzip/lrzip.conf", "r");
+ fp = fopen("@TERMUX_PREFIX@/etc/lrzip/lrzip.conf", "r");
if (fp)
- fprintf(control->msgout, "Using configuration file /etc/lrzip/lrzip.conf\n");
+ fprintf(control->msgout, "Using configuration file @TERMUX_PREFIX@/etc/lrzip/lrzip.conf\n");
}
if (fp == NULL)
return false;