mag

a binary package manager in one C file: apk and pacman repos, CRUX, Void and Exherbo ports
git clone https://github.com/tortr-rs/mag
Log | Files | Refs | README | LICENSE

commit 2f9ea84ead46651291d4aaeddac1c0edaeaa69b4
parent 6bee4030c47ee153c527917fae8d65599b13f19c
Author: torter <koubbamohamedrayan@gmail.com>
Date:   Sat, 14 Nov 2026 18:22:08 +0000

pkgsrc: FIND and friends, CONFIGURE_SCRIPT; libressl stands for openssl

Diffstat:
Mmag.c | 8++++++--
Mrepo/PROVIDES | 1+
2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/mag.c b/mag.c @@ -790,7 +790,7 @@ static struct recipe *parse_pkgsrc(const char *id, const char *dir, const char * { "LOCALBASE", "$PREFIX" }, { "PKGMANDIR", "man" }, { "SETENV", "env" }, { "TOOLS_SHELL", "/bin/sh" }, { "SH", "/bin/sh" }, { "CP", "cp" }, { "MV", "mv" }, { "RM", "rm" }, { "LN", "ln" }, { "MKDIR", "mkdir -p" }, { "ECHO", "echo" }, { "SED", "sed" }, { "CHMOD", "chmod" }, { "TRUE", "true" }, { "CAT", "cat" }, { "TEST", "test" }, { "TOUCH", "touch" }, { "MAKE", "make" }, - { "BSD_INSTALL_PROGRAM", "install -m 755" }, { "BSD_INSTALL_PROGRAM_DIR", "install -d -m 755" }, { "BSD_INSTALL_SCRIPT", "install -m 755" }, { "BSD_INSTALL_SCRIPT_DIR", "install -d -m 755" }, { "BSD_INSTALL_LIB", "install -m 755" }, { "BSD_INSTALL_LIB_DIR", "install -d -m 755" }, { "BSD_INSTALL_DATA", "install -m 644" }, { "BSD_INSTALL_DATA_DIR", "install -d -m 755" }, { "BSD_INSTALL_MAN", "install -m 644" }, { "BSD_INSTALL_MAN_DIR", "install -d -m 755" }, { "BSD_INSTALL_GAME", "install -m 755" }, { "BSD_INSTALL_GAME_DIR", "install -d -m 755" }, { "INSTALL", "install" }, { "INSTALL_PROGRAM", "install -m 755" }, { "INSTALL_LIB", "install -m 755" }, { "INSTALL_LIB_DIR", "install -d -m 755" }, { "INSTALL_GAME", "install -m 755" }, { "INSTALL_GAME_DATA", "install -m 644" }, { "INSTALL_SCRIPT", "install -m 755" }, { "INSTALL_DATA", "install -m 644" }, + { "BSD_INSTALL_PROGRAM", "install -m 755" }, { "BSD_INSTALL_PROGRAM_DIR", "install -d -m 755" }, { "BSD_INSTALL_SCRIPT", "install -m 755" }, { "BSD_INSTALL_SCRIPT_DIR", "install -d -m 755" }, { "BSD_INSTALL_LIB", "install -m 755" }, { "BSD_INSTALL_LIB_DIR", "install -d -m 755" }, { "BSD_INSTALL_DATA", "install -m 644" }, { "BSD_INSTALL_DATA_DIR", "install -d -m 755" }, { "BSD_INSTALL_MAN", "install -m 644" }, { "BSD_INSTALL_MAN_DIR", "install -d -m 755" }, { "BSD_INSTALL_GAME", "install -m 755" }, { "BSD_INSTALL_GAME_DIR", "install -d -m 755" }, { "INSTALL", "install" }, { "FIND", "find" }, { "XARGS", "xargs" }, { "AWK", "awk" }, { "GREP", "grep" }, { "EGREP", "grep -E" }, { "HEAD", "head" }, { "TAIL", "tail" }, { "TR", "tr" }, { "SORT", "sort" }, { "WC", "wc" }, { "CMP", "cmp" }, { "DIFF", "diff" }, { "BASENAME", "basename" }, { "DIRNAME", "dirname" }, { "PWD", "pwd" }, { "TOOLS_PLATFORM.pwd", "/bin/pwd" }, { "INSTALL_PROGRAM", "install -m 755" }, { "INSTALL_LIB", "install -m 755" }, { "INSTALL_LIB_DIR", "install -d -m 755" }, { "INSTALL_GAME", "install -m 755" }, { "INSTALL_GAME_DATA", "install -m 644" }, { "INSTALL_SCRIPT", "install -m 755" }, { "INSTALL_DATA", "install -m 644" }, { "INSTALL_MAN", "install -m 644" }, { "INSTALL_PROGRAM_DIR", "install -d -m 755" }, { "INSTALL_DATA_DIR", "install -d -m 755" }, { "INSTALL_SCRIPT_DIR", "install -d -m 755" }, { "INSTALL_MAN_DIR", "install -d -m 755" }, { "CC", "cc" }, { "LIBTOOL", "libtool" }, { "PKG_SYSCONFDIR", "/etc" }, { "VARBASE", "/var" }, { "MACHINE_GNU_ARCH", "x86_64" }, { "MACHINE_GNU_PLATFORM", "x86_64-pc-linux-gnu" }, { "PKG_SHELL", "" }, { "BINMODE", "755" }, { "NONBINMODE", "644" }, { "LIBMODE", "644" }, { "SHAREMODE", "644" }, { "MANMODE", "644" }, { "DIRMODE", "755" }, { "BINOWN", "$(id -un)" }, { "BINGRP", "$(id -gn)" }, { "SHAREOWN", "$(id -un)" }, { "SHAREGRP", "$(id -gn)" }, { "MANOWN", "$(id -un)" }, { "MANGRP", "$(id -gn)" }, { "REAL_ROOT_USER", "root" }, { "REAL_ROOT_GROUP", "root" }, { "RUN", "" }, { "RCD_SCRIPTS_DIR", "/etc/rc.d" }, { NULL, NULL } }; @@ -959,7 +959,11 @@ static struct recipe *parse_pkgsrc(const char *id, const char *dir, const char * cmd += sprintf(cmd, "P=patch; command -v nbpatch >/dev/null && P=nbpatch\nfor p in \"$RECIPE_DIR\"/%s/patch-*; do [ -f \"$p\" ] || continue; $P -p0 < \"$p\"; done\n", pd); if (hook[2]) cmd += sprintf(cmd, "%s\n", hook[2]); if (hook[3]) cmd += sprintf(cmd, "%s\n", hook[3]); - else if (hasconfig && !cmake) cmd += sprintf(cmd, "%s ./configure --prefix=$PREFIX --mandir=$PREFIX/man --sysconfdir=/etc --localstatedir=/var %s\n", cenv, cfg); + else if (hasconfig && !cmake) { + const char *scr = var_get(&vs, "CONFIGURE_SCRIPT") ? var_get(&vs, "CONFIGURE_SCRIPT") : "./configure"; + if (gnu || !var_get(&vs, "CONFIGURE_SCRIPT")) cmd += sprintf(cmd, "%s %s --prefix=$PREFIX --mandir=$PREFIX/man --sysconfdir=/etc --localstatedir=/var %s\n", cenv, scr, cfg); + else cmd += sprintf(cmd, "%s %s %s\n", cenv, scr, cfg); + } if (hook[4]) cmd += sprintf(cmd, "%s\n", hook[4]); if (cmake && !hook[3]) cmd += sprintf(cmd, "mkdir -p mag-build && cd mag-build && %s cmake -G Ninja -DCMAKE_INSTALL_PREFIX=$PREFIX %s ..\nsamu\n", cenv, cfg); else { diff --git a/repo/PROVIDES b/repo/PROVIDES @@ -12,3 +12,4 @@ needs editors/vim dev-libs/netbsd-curses lang/tcl - x11/tk - needs devel/nbpatch pkgtools/libnbcompat +security/openssl security/libressl