From 65fb6c194eb6c992d1d7f72bb5e0311eec66069e Mon Sep 17 00:00:00 2001 From: dtb Date: Sat, 7 Jan 2023 17:24:56 -0500 Subject: [PATCH 1/2] make packaging simexec(1) easier --- simexec/packaging.md | 40 ++++++++++++++++++++++++++++++++++++++++ simexec/simexec.c | 5 ++++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 simexec/packaging.md diff --git a/simexec/packaging.md b/simexec/packaging.md new file mode 100644 index 0000000..5157527 --- /dev/null +++ b/simexec/packaging.md @@ -0,0 +1,40 @@ +# Packaging simexec.c + +## License + +Simexec is Public Domain so there are basically no barriers when it comes to +licensing. And if you somehow violate my already-forfeited copyright, I promise +I won't sue you. + +## Files + +Simexec is a single C file (`simexec.c`) that builds to a single executable, +which should be named `simexec` and placed in a user-accessible binaries +directory. A `Makefile` is provided as courtesy but isn't really necessary. + +The `src/simexec` directory can be moved to a system sources directory if you +wish to keep the source on hand; it doesn't reference anything else in the +repository. + +The included manual page, `simexec.1` can be placed in the appropriate manual +pages directory. If it displays weirdly feel free to e-mail me and I'll attempt +to fix it. + +## Compilation + +On systems that provide ``, the following is all that's needed: + +``` +cc -o simexec simexec.c +``` + +If you're not sure whether your system provides ``, try it and see. +If it doesn't work, compile `simexec.c` with the following: + +``` +cc -DEX_USAGE=1 -o simexec simexec.c +``` + +Other than `` simexec(1) only relies on headers found in the C +standard library. Outside of POSIX environments `simexec.c` probably won't work +but it wouldn't be of much use anyway. diff --git a/simexec/simexec.c b/simexec/simexec.c index 069adf4..f8ae7d3 100644 --- a/simexec/simexec.c +++ b/simexec/simexec.c @@ -1,7 +1,10 @@ #include /* fprintf(3), NULL */ -#include /* EX_USAGE */ #include /* execv(3), */ +#if !defined EX_USAGE +# include /* EX_USAGE */ +#endif + static char *program_name = "simexec"; int main(int argc, char *argv[]){ From c00d19e7ff2402c2b19729a4b6b7de1e4be2bb34 Mon Sep 17 00:00:00 2001 From: dtb Date: Sat, 7 Jan 2023 17:39:01 -0500 Subject: [PATCH 2/2] refinement --- simexec/packaging.md | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/simexec/packaging.md b/simexec/packaging.md index 5157527..ec567a5 100644 --- a/simexec/packaging.md +++ b/simexec/packaging.md @@ -8,33 +8,43 @@ I won't sue you. ## Files -Simexec is a single C file (`simexec.c`) that builds to a single executable, -which should be named `simexec` and placed in a user-accessible binaries -directory. A `Makefile` is provided as courtesy but isn't really necessary. +- `src/simexec` + - Can be moved to a system sources directory if it's desirable to keep + system sources on hand. Doesn't reference anything else in the + repository. -The `src/simexec` directory can be moved to a system sources directory if you -wish to keep the source on hand; it doesn't reference anything else in the -repository. +- `simexec.1` + - Included manual page for `simexec`. Can be placed in the appropriate + manual pages directory. If it displays weirdly and your fix is + portable, mail me and I'll probably bring it upstream. + +- `simexec.c` + - A single C file that builds to a single executable, which should be + named `simexec`. -The included manual page, `simexec.1` can be placed in the appropriate manual -pages directory. If it displays weirdly feel free to e-mail me and I'll attempt -to fix it. +- `simexec` + - Program binary. Should be placed in a user-accessible binaries + directory. + +## Dependencies + +- `` + - Ignored if `EX_USAGE` is already defined. + +- C standard library ## Compilation -On systems that provide ``, the following is all that's needed: - ``` cc -o simexec simexec.c ``` -If you're not sure whether your system provides ``, try it and see. -If it doesn't work, compile `simexec.c` with the following: +Or without ``: ``` cc -DEX_USAGE=1 -o simexec simexec.c ``` -Other than `` simexec(1) only relies on headers found in the C -standard library. Outside of POSIX environments `simexec.c` probably won't work -but it wouldn't be of much use anyway. +## Known packages + +- [On the Arch User Repository](https://aur.archlinux.org/packages/simexec-git).