new package: pkgfile

This commit is contained in:
Tee KOBAYASHI 2022-03-11 00:47:09 +09:00 committed by xtkoba
parent 8a5fe78e76
commit db79876425
5 changed files with 73 additions and 0 deletions

30
packages/pkgfile/build.sh Normal file
View File

@ -0,0 +1,30 @@
TERMUX_PKG_HOMEPAGE=https://github.com/falconindy/pkgfile
TERMUX_PKG_DESCRIPTION="An alpm .files metadata explorer"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=21
TERMUX_PKG_SRCURL=https://github.com/falconindy/pkgfile/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=809d75738cae785839950c85371ac087bc3b450eed497a565eca01b653f254a5
TERMUX_PKG_DEPENDS="libandroid-glob, libarchive, libcurl, pcre"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
-Dsystemd_units=false
"
termux_step_pre_configure() {
LDFLAGS+=" -landroid-glob"
}
termux_step_create_debscripts() {
cat <<- EOF > ./postinst
#!$TERMUX_PREFIX/bin/sh
mkdir -p $TERMUX_PREFIX/var/cache/pkgfile
EOF
cat <<- EOF > ./prerm
#!$TERMUX_PREFIX/bin/sh
if [ "$TERMUX_PACKAGE_FORMAT" != "pacman" ] && [ "\$1" != "remove" ]; then
exit 0
fi
rm -rf $TERMUX_PREFIX/var/cache/pkgfile
EOF
}

View File

@ -0,0 +1,11 @@
--- a/meson.build
+++ b/meson.build
@@ -42,7 +42,7 @@
pod2man = find_program('pod2man')
pkgconfig = find_program('pkg-config')
-mkdir_p = 'mkdir -p $DESTDIR/@0@'
+mkdir_p = 'mkdir -p @TERMUX_PREFIX@/@0@'
pkgfile_sources = files('''
src/match.c src/match.h

View File

@ -0,0 +1,10 @@
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,6 +1,6 @@
option('cachedir',
type : 'string',
- value : '/var/cache/pkgfile',
+ value : '@TERMUX_PREFIX@/var/cache/pkgfile',
description : 'default directory to store pkgfile data')
option('systemd_units',

View File

@ -0,0 +1,11 @@
--- a/src/update.c
+++ b/src/update.c
@@ -360,7 +360,7 @@
tmpdir = getenv("TMPDIR");
if (tmpdir == NULL) {
- tmpdir = "/tmp";
+ tmpdir = "@TERMUX_PREFIX@/tmp";
}
#ifdef O_TMPFILE

View File

@ -0,0 +1,11 @@
--- a/src/update.h
+++ b/src/update.h
@@ -2,7 +2,7 @@
#include <curl/curl.h>
-#define PACMANCONFIG "/etc/pacman.conf"
+#define PACMANCONFIG "@TERMUX_PREFIX@/etc/pacman.conf"
struct config_t;
struct repovec_t;