Compare commits

...

7 Commits
v1.0 ... master

  1. 34
      README.md
  2. 10
      freebsd-port/sysutils/lua-sysmount/Makefile
  3. 6
      freebsd-port/sysutils/lua-sysmount/distinfo

34
README.md

@ -15,34 +15,38 @@ This module allows Lua scripts to query active storage mounts and filesystem typ
## Installation
### Method 1: Build & Install via FreeBSD Ports Framework (Recommended)
### Method 1: Build & Install via FreeBSD Ports Framework
This method automatically handles Lua `FLAVORS` and registers the module in the system package database (`pkg`).
Use this method to compile the module as a native FreeBSD package (`pkg`) with full `FLAVORS` support. The port is configured to securely fetch the release archive directly from the Gitea repository attachments.
1. Copy the port directory to your local ports tree:
1. Clone this repository and navigate to the directory:
```bash
cp -R port/sysutils/lua-sysmount /usr/ports/sysutils/
git clone https://git.dc365.ru/digital-freak/lua-sysmount.git
cd lua-sysmount
```
2. Build and install for your default Lua version (e.g., Lua 5.4):
2. Symlink the port skeleton into your system's ports tree:
```bash
sudo ln -s $(pwd)/freebsd-port/sysutils/lua-sysmount /usr/ports/sysutils/lua-sysmount
```
3. Build and generate the binary package for your desired Lua flavor (e.g., Lua 5.4):
```bash
cd /usr/ports/sysutils/lua-sysmount
sudo make install clean
sudo make FLAVOR=lua54 package
```
3. Alternatively, target a specific Lua flavor (e.g., Lua 5.3):
4. Install the newly created package:
```bash
sudo make FLAVOR=lua53 install clean
sudo make FLAVOR=lua54 install clean
```
### Method 2: Manual Standalone Build
If you don't want to use the ports tree, you can compile the `.so` module directly in any directory. It will use `pkg-config` to discover your active Lua setup.
If you don't want to use the ports tree infrastructure, you can compile and install the `.so` module directly from the source directory using `pkg-config`.
```bash
# Clone the repository and navigate to the source directory
git clone https://github.com
cd lua-sysmount/src
# Compile and install globally
make
sudo make install
make clean
@ -59,8 +63,8 @@ You can test the native binding directly from your interactive Lua shell:
```lua
$ lua54
Lua 5.4.8 Copyright (C) 1994-2025 Lua.org, PUC-Rio
> local sysmount = require("sysmount")
> local mounts = sysmount.getfsstat()
> sysmount = require("sysmount")
> mounts = sysmount.getfsstat()
>
> -- Print the first mount point entry
> print(mounts[1].dev, "->", mounts[1].mnt, "[" .. mounts[1].type .. "]")

10
freebsd-port/sysutils/lua-sysmount/Makefile

@ -1,15 +1,21 @@
PORTNAME= sysmount
PORTVERSION= 1.0
DISTVERSION= 1.0
CATEGORIES= sysutils
MASTER_SITES= http://your-server.local
MASTER_SITES= https://git.dc365.ru/digital-freak/lua-sysmount/releases/download/v${DISTVERSION}/
PKGNAMEPREFIX= ${LUA_PKGNAMEPREFIX}
MAINTAINER= root@dc365.ru
COMMENT= Native getfsstat binding for Lua
WWW= https://git.dc365.ru/digital-freak/lua-sysmount
LICENSE= BSD2CLAUSE
USES= lua:module pkgconfig tar:xz
DISTNAME= ${PORTNAME}-v${DISTVERSION}
MAKE_ARGS= LUA_MODDIR=${LUA_MODLIBDIR}
PLIST_FILES= ${LUA_MODLIBDIR}/sysmount.so
.include <bsd.port.mk>

6
freebsd-port/sysutils/lua-sysmount/distinfo

@ -1,3 +1,3 @@
TIMESTAMP = 1779060791
SHA256 (sysmount-1.0.tar.xz) = ddc305dc21b7689a33ae5f4f04ac28cfc6a925bd8019de60627e4e758e8f1fac
SIZE (sysmount-1.0.tar.xz) = 1356
TIMESTAMP = 1779138069
SHA256 (sysmount-v1.0.tar.xz) = 8fa9f5c42686b3caa34ae4b477e51938d8cc3f0912dfb31448a9bcf94c1f78f5
SIZE (sysmount-v1.0.tar.xz) = 1356