Commit 3c28d180b217db528d1c2134822814d5903ff825
Commits[COMMIT BEGIN]commit 3c28d180b217db528d1c2134822814d5903ff825 Author: 0x4248 <[email protected]> Date: Fri Mar 6 14:11:51 2026 +0000 npkg: Add bin to npkg diff --git a/npkg-testing/.gitignore b/npkg-testing/.gitignore new file mode 100644 index 0000000..08eb0a0 --- /dev/null +++ b/npkg-testing/.gitignore @@ -0,0 +1 @@ +!bin/ \ No newline at end of file diff --git a/npkg-testing/bin/hello_world/Makefile b/npkg-testing/bin/hello_world/Makefile new file mode 100644 index 0000000..f674546 --- /dev/null +++ b/npkg-testing/bin/hello_world/Makefile @@ -0,0 +1,29 @@ +# SPDX-License-Identifier: GPL-3.0 + +CC ?= gcc +CFLAGS ?= -O2 -Wall + +PKG_NAME = hello-world +PKG_VERSION = 0.1.0 + +PREFIX ?= /usr +DESTDIR ?= + +SRC = src/hello_world.c +BUILD_DIR = build +BIN = hello-world + +.PHONY: all clean install + +all: $(BUILD_DIR)/$(BIN) + +$(BUILD_DIR)/$(BIN): $(SRC) + @mkdir -p $(BUILD_DIR) + $(CC) $(CFLAGS) $(SRC) -o $(BUILD_DIR)/$(BIN) + +install: all + install -d $(DESTDIR)$(PREFIX)/bin + install -m 0755 $(BUILD_DIR)/$(BIN) $(DESTDIR)$(PREFIX)/bin/$(BIN) + +clean: + rm -rf $(BUILD_DIR) diff --git a/npkg-testing/bin/hello_world/npkg.conf b/npkg-testing/bin/hello_world/npkg.conf new file mode 100644 index 0000000..5412258 --- /dev/null +++ b/npkg-testing/bin/hello_world/npkg.conf @@ -0,0 +1,16 @@ +name = "hello-world" +version = "0.1.0" +description = "Tiny demo C package that installs /bin/hello-world" + +[build] +command = "make -C {package_dir} all" + +[stage] +command = "make -C {package_dir} install DESTDIR={stage_dir} PREFIX={prefix}" + +[clean] +command = "make -C {package_dir} clean" + +[capabilities] +installable = true +cleanable = true \ No newline at end of file diff --git a/npkg-testing/bin/hello_world/src/hello_world.c b/npkg-testing/bin/hello_world/src/hello_world.c new file mode 100644 index 0000000..fb98286 --- /dev/null +++ b/npkg-testing/bin/hello_world/src/hello_world.c @@ -0,0 +1,6 @@ +#include <stdio.h> + +int main(void) { + printf("hello from npkg-testing\n"); + return 0; +}[COMMIT END](C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.