diff options
| author | PS <p@0x53.net> | 2026-02-07 11:32:47 +0100 |
|---|---|---|
| committer | PS <p@0x53.net> | 2026-02-07 11:32:47 +0100 |
| commit | c48083aed7a8d972598b97c742bc0a0da0b84080 (patch) | |
| tree | 1a0e7ef1857e3299668c5892f9b71133accecf9c | |
| parent | eb36640078ee6469427e85ca0695f8c920909ea0 (diff) | |
| download | goetia-freebsd-init-c48083aed7a8d972598b97c742bc0a0da0b84080.tar.gz goetia-freebsd-init-c48083aed7a8d972598b97c742bc0a0da0b84080.tar.bz2 goetia-freebsd-init-c48083aed7a8d972598b97c742bc0a0da0b84080.zip | |
Improve build system and doc
| -rw-r--r-- | AUTHORS | 2 | ||||
| -rw-r--r-- | CONTRIBUTING | 2 | ||||
| -rw-r--r-- | COPYING | 2 | ||||
| -rw-r--r-- | INSTALL | 30 | ||||
| -rw-r--r-- | Makefile | 19 | ||||
| -rw-r--r-- | NEWS | 4 | ||||
| -rw-r--r-- | package/deps.mak | 30 | ||||
| -rw-r--r-- | package/targets.mak | 35 | ||||
| -rwxr-xr-x | tools/gen-deps.sh | 18 | ||||
| -rwxr-xr-x | tools/gen-targets.sh | 49 |
10 files changed, 96 insertions, 95 deletions
@@ -1,5 +1,5 @@ Main author: - Paul Sopka <psopka@sopka.ch> + PS <p@0x53.net> Contributors: diff --git a/CONTRIBUTING b/CONTRIBUTING index 6279422..2e43fb3 100644 --- a/CONTRIBUTING +++ b/CONTRIBUTING @@ -1,4 +1,4 @@ - Please add a Signed-Off-By: line at the end of your commit, +Please add a Signed-Off-By: line at the end of your commit, which certifies that you have the right and authority to pass it on as an open-source patch, as explicited in the Developer's Certificate of Origin available in this project's DCO file, @@ -1,4 +1,4 @@ -Copyright (c) 2024-2025 Paul Sopka <psopka@sopka.ch> +Copyright (c) 2024-2026 PS <p@0x53.net> Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above @@ -4,48 +4,46 @@ Build Instructions * Requirements ------------ - - A POSIX-compliant set of utils - - A set of OS specific utils + - The FreeBSD userland + - execline https://skarnet.org/software/execline/ - s6 https://skarnet.org/software/s6/ - s6-rc https://skarnet.org/software/s6-rc/ - - execline https://skarnet.org/software/execline/ - This software will run on any operating system that implements -POSIX.1-2008, available at: - https://pubs.opengroup.org/onlinepubs/9699919799/ +This software will run on any operating system +that runs the requirements above. * Standard usage -------------- - ./configure && make && sudo make install + ./configure && make && make install - will work for most users. +will work for most users. * Customization ------------- - You can customize paths via flags given to configure. - See ./configure --help for a list of all available configure options. +You can customize paths via flags given to configure. +See ./configure --help for a list of all available configure options. * Make variables -------------- - You can invoke make with a few variables for more configuration. +You can invoke make with a few variables for more configuration. - INSTALL can be overridden on the make command line. This is +INSTALL can be overridden on the make command line. This is an even bigger hammer than running ./configure with environment variables, so it is advised to only do this when it is the only way of obtaining the behaviour you want. - DESTDIR can be given on the "make install" command line in order to +DESTDIR can be given on the "make install" command line in order to install to a staging directory. * The slashpackage convention --------------------------- - The slashpackage convention (http://cr.yp.to/slashpackage.html) +The slashpackage convention (http://cr.yp.to/slashpackage.html) is a package installation scheme that provides a few guarantees over other conventions such as the FHS, for instance fixed absolute pathnames. skarnet.org packages support it: use the @@ -66,7 +64,7 @@ location in the filesystem) --prefix is pretty much ignored when you use --enable-slashpackage. You should probably not use both --enable-slashpackage and --prefix. - When using slashpackage, two additional Makefile targets are +When using slashpackage, two additional Makefile targets are available after "make install": - "make update" changes the default version of the software to the freshly installed one. (This is useful when you have several installed @@ -78,6 +76,6 @@ default version of the binaries and shared libraries. * Out-of-tree builds ------------------ - This package does not support out-of-tree builds. It +This package does not support out-of-tree builds. It is small, so it does not cost much to duplicate the entire source tree if parallel builds are needed. @@ -36,11 +36,12 @@ distclean: clean tgz: distclean @. package/info && \ - rm -rf /tmp/$$package-$$version && \ - cp -a . /tmp/$$package-$$version && \ - cd /tmp && \ - tar -zpcv --owner=0 --group=0 --numeric-owner --exclude=.git* -f /tmp/$$package-$$version.tar.gz $$package-$$version && \ - exec rm -rf /tmp/$$package-$$version + rm -rf ../../stage/$$package-$$version && \ + cp -a . ../../stage/$$package-$$version && \ + cd ../../stage && \ + tar -zpcv --owner=0 --group=0 --numeric-owner --exclude=.git* -f $$package-$$version.tar.gz $$package-$$version && \ + sha256sum $$package-$$version.tar.gz > $$package-$$version.tar.gz.sha256 && \ + exec rm -rf $$package-$$version install: $(INSTALL_BINS) $(INSTALL_LIBS) $(INSTALL_EXTRAS) @@ -62,7 +63,7 @@ $(ALL_BINS) $(ALL_LIBS): -- $^ > $@ $(INSTALL_BINS) $(INSTALL_LIBS): - exec $(INSTALL) -D -m 644 $^ $@ + exec $(INSTALL) -D -m 644 $^ $(DESTDIR)/$@ grep -F -- $^ - < package/modes | { read name mode owner && \ if [ x$${mode} != x ] ; then chmod $${mode} $@ ; fi && \ if [ x$${owner} != x ] ; then chown -- $${owner} $@ ; fi ; } || exit 0 @@ -72,15 +73,11 @@ $(DESTDIR)$(exthome): exec $(INSTALL) -D -l $(package)-$(version) $@ $(SLASHCOMMAND_BINS): - exec $(INSTALL) -D -l $(exthome)/command/$$(basename $@) $@ + exec $(INSTALL) -D -l $(DESTDIR)$(exthome)/command/$$(basename $@) $@ update: $(DESTDIR)$(exthome) global-links: $(SLASHCOMMAND_BINS) -uninstall: - exec rm -f $(INSTALL_BINS) $(SLASHCOMMAND_BINS) - exec rm -Rf $(libdir) - .PHONY: \ it all clean distclean tgz update global-links \ install uninstall \ @@ -1,6 +1,6 @@ -Changelog for goetia-base. +Changelog for goetia-freebsd-init. -In 0.0.0.1 +In 0.3.0.0 ---------- - Initial release diff --git a/package/deps.mak b/package/deps.mak index 586b8a9..3e05a2d 100644 --- a/package/deps.mak +++ b/package/deps.mak @@ -3,32 +3,32 @@ # system-init: src/bin/system-init -$(DESTDIR)$(bindir)/system-init: system-init +$(bindir)/system-init: system-init system-shutdown: src/bin/system-shutdown -$(DESTDIR)$(bindir)/system-shutdown: system-shutdown +$(bindir)/system-shutdown: system-shutdown service/system/.s6-svscan/crash: src/lib/service/system/.s6-svscan/crash -$(DESTDIR)$(libdir)/service/system/.s6-svscan/crash: service/system/.s6-svscan/crash +$(libdir)/service/system/.s6-svscan/crash: service/system/.s6-svscan/crash service/system/.s6-svscan/SIGUSR1: src/lib/service/system/.s6-svscan/SIGUSR1 -$(DESTDIR)$(libdir)/service/system/.s6-svscan/SIGUSR1: service/system/.s6-svscan/SIGUSR1 +$(libdir)/service/system/.s6-svscan/SIGUSR1: service/system/.s6-svscan/SIGUSR1 service/system/.s6-svscan/finish: src/lib/service/system/.s6-svscan/finish -$(DESTDIR)$(libdir)/service/system/.s6-svscan/finish: service/system/.s6-svscan/finish +$(libdir)/service/system/.s6-svscan/finish: service/system/.s6-svscan/finish service/system/.s6-svscan/SIGQUIT: src/lib/service/system/.s6-svscan/SIGQUIT -$(DESTDIR)$(libdir)/service/system/.s6-svscan/SIGQUIT: service/system/.s6-svscan/SIGQUIT +$(libdir)/service/system/.s6-svscan/SIGQUIT: service/system/.s6-svscan/SIGQUIT service/system/.s6-svscan/SIGINT: src/lib/service/system/.s6-svscan/SIGINT -$(DESTDIR)$(libdir)/service/system/.s6-svscan/SIGINT: service/system/.s6-svscan/SIGINT +$(libdir)/service/system/.s6-svscan/SIGINT: service/system/.s6-svscan/SIGINT service/system/.s6-svscan/SIGUSR2: src/lib/service/system/.s6-svscan/SIGUSR2 -$(DESTDIR)$(libdir)/service/system/.s6-svscan/SIGUSR2: service/system/.s6-svscan/SIGUSR2 +$(libdir)/service/system/.s6-svscan/SIGUSR2: service/system/.s6-svscan/SIGUSR2 service/system/.s6-svscan/SIGWINCH: src/lib/service/system/.s6-svscan/SIGWINCH -$(DESTDIR)$(libdir)/service/system/.s6-svscan/SIGWINCH: service/system/.s6-svscan/SIGWINCH +$(libdir)/service/system/.s6-svscan/SIGWINCH: service/system/.s6-svscan/SIGWINCH service/system/.s6-svscan/SIGTERM: src/lib/service/system/.s6-svscan/SIGTERM -$(DESTDIR)$(libdir)/service/system/.s6-svscan/SIGTERM: service/system/.s6-svscan/SIGTERM +$(libdir)/service/system/.s6-svscan/SIGTERM: service/system/.s6-svscan/SIGTERM service/system/.s6-svscan/SIGPWR: src/lib/service/system/.s6-svscan/SIGPWR -$(DESTDIR)$(libdir)/service/system/.s6-svscan/SIGPWR: service/system/.s6-svscan/SIGPWR +$(libdir)/service/system/.s6-svscan/SIGPWR: service/system/.s6-svscan/SIGPWR service/system/goetia-shutdown/run: src/lib/service/system/goetia-shutdown/run -$(DESTDIR)$(libdir)/service/system/goetia-shutdown/run: service/system/goetia-shutdown/run +$(libdir)/service/system/goetia-shutdown/run: service/system/goetia-shutdown/run service/system/goetia-shutdown/stage3b: src/lib/service/system/goetia-shutdown/stage3b -$(DESTDIR)$(libdir)/service/system/goetia-shutdown/stage3b: service/system/goetia-shutdown/stage3b +$(libdir)/service/system/goetia-shutdown/stage3b: service/system/goetia-shutdown/stage3b service/system/goetia-shutdown/down: src/lib/service/system/goetia-shutdown/down -$(DESTDIR)$(libdir)/service/system/goetia-shutdown/down: service/system/goetia-shutdown/down +$(libdir)/service/system/goetia-shutdown/down: service/system/goetia-shutdown/down service/system/goetia-shutdown/stage4: src/lib/service/system/goetia-shutdown/stage4 -$(DESTDIR)$(libdir)/service/system/goetia-shutdown/stage4: service/system/goetia-shutdown/stage4 +$(libdir)/service/system/goetia-shutdown/stage4: service/system/goetia-shutdown/stage4 diff --git a/package/targets.mak b/package/targets.mak index 508898e..8ff628a 100644 --- a/package/targets.mak +++ b/package/targets.mak @@ -7,12 +7,12 @@ ALL_BINS ::= \ system-shutdown \ INSTALL_BINS ::= \ - $(DESTDIR)$(bindir)/system-init \ - $(DESTDIR)$(bindir)/system-shutdown \ + $(bindir)/system-init \ + $(bindir)/system-shutdown \ SLASHCOMMAND_BINS ::= \ - $(DESTDIR)$(sproot)/command/system-init \ - $(DESTDIR)$(sproot)/command/system-shutdown \ + $(sproot)/command/system-init \ + $(sproot)/command/system-shutdown \ ALL_LIBS ::= \ service/system/.s6-svscan/crash \ @@ -30,17 +30,16 @@ ALL_LIBS ::= \ service/system/goetia-shutdown/stage4 \ INSTALL_LIBS ::= \ - $(DESTDIR)$(libdir)/service/system/.s6-svscan/crash \ - $(DESTDIR)$(libdir)/service/system/.s6-svscan/SIGUSR1 \ - $(DESTDIR)$(libdir)/service/system/.s6-svscan/finish \ - $(DESTDIR)$(libdir)/service/system/.s6-svscan/SIGQUIT \ - $(DESTDIR)$(libdir)/service/system/.s6-svscan/SIGINT \ - $(DESTDIR)$(libdir)/service/system/.s6-svscan/SIGUSR2 \ - $(DESTDIR)$(libdir)/service/system/.s6-svscan/SIGWINCH \ - $(DESTDIR)$(libdir)/service/system/.s6-svscan/SIGTERM \ - $(DESTDIR)$(libdir)/service/system/.s6-svscan/SIGPWR \ - $(DESTDIR)$(libdir)/service/system/goetia-shutdown/run \ - $(DESTDIR)$(libdir)/service/system/goetia-shutdown/stage3b \ - $(DESTDIR)$(libdir)/service/system/goetia-shutdown/down \ - $(DESTDIR)$(libdir)/service/system/goetia-shutdown/stage4 \ - + $(libdir)/service/system/.s6-svscan/crash \ + $(libdir)/service/system/.s6-svscan/SIGUSR1 \ + $(libdir)/service/system/.s6-svscan/finish \ + $(libdir)/service/system/.s6-svscan/SIGQUIT \ + $(libdir)/service/system/.s6-svscan/SIGINT \ + $(libdir)/service/system/.s6-svscan/SIGUSR2 \ + $(libdir)/service/system/.s6-svscan/SIGWINCH \ + $(libdir)/service/system/.s6-svscan/SIGTERM \ + $(libdir)/service/system/.s6-svscan/SIGPWR \ + $(libdir)/service/system/goetia-shutdown/run \ + $(libdir)/service/system/goetia-shutdown/stage3b \ + $(libdir)/service/system/goetia-shutdown/down \ + $(libdir)/service/system/goetia-shutdown/stage4 \ diff --git a/tools/gen-deps.sh b/tools/gen-deps.sh index fafb347..23cd98f 100755 --- a/tools/gen-deps.sh +++ b/tools/gen-deps.sh @@ -2,17 +2,17 @@ . package/info -echo '#' -echo '# This file has been generated by tools/gen-deps.sh' -echo '#' -echo +printf '#\n' +printf '# This file has been generated by tools/gen-deps.sh\n' +printf '#\n' +printf '\n' if test -d src/bin then cd src/bin for FILE in $(find * -type f 2> /dev/null); do - echo "${FILE}: src/bin/${FILE}" - echo "\$(DESTDIR)\$(bindir)/${FILE}: ${FILE}" + printf "${FILE}: src/bin/${FILE}\n" + printf "\$(bindir)/${FILE}: ${FILE}\n" done cd ../.. fi @@ -21,8 +21,8 @@ if test -d src/lib then cd src/lib for FILE in $(find * -type f 2> /dev/null); do - echo "${FILE}: src/lib/${FILE}" - echo "\$(DESTDIR)\$(libdir)/${FILE}: ${FILE}" + printf "${FILE}: src/lib/${FILE}\n" + printf "\$(libdir)/${FILE}: ${FILE}\n" done cd ../.. fi @@ -30,6 +30,6 @@ fi if test -f package/extras then for EXTRA in $(cat package/extras); do - echo "\$(DESTDIR)\$(libdir)/${EXTRA}: ${EXTRA}" + printf "\$(libdir)/${EXTRA}: ${EXTRA}\n" done fi diff --git a/tools/gen-targets.sh b/tools/gen-targets.sh index 3280748..f772754 100755 --- a/tools/gen-targets.sh +++ b/tools/gen-targets.sh @@ -2,55 +2,62 @@ . package/info -echo '#' -echo '# This file has been generated by tools/gen-targets.sh' -echo '#' -echo +printf '#\n' +printf '# This file has been generated by tools/gen-targets.sh\n' +printf '#\n' +printf '\n' if test -d src/bin then cd src/bin - echo "ALL_BINS ::= \\" + printf "ALL_BINS ::= \\" + printf "\n" for FILE in $(find * -type f 2> /dev/null) ; do - echo "\t${FILE} \\" + printf "\t${FILE} \\" + printf "\n" done - echo - echo "INSTALL_BINS ::= \\" + printf "\n" + printf "INSTALL_BINS ::= \\" + printf "\n" for FILE in $(find * -type f 2> /dev/null) ; do - echo "\t\$(DESTDIR)\$(bindir)/${FILE} \\" + printf "\t\$(bindir)/${FILE} \\" + printf "\n" done - echo - echo "SLASHCOMMAND_BINS ::= \\" + printf "\n" + printf "SLASHCOMMAND_BINS ::= \\" + printf "\n" for FILE in $(find * -type f 2> /dev/null) ; do - echo "\t\$(DESTDIR)\$(sproot)/command/${FILE} \\" + printf "\t\$(sproot)/command/${FILE} \\" + printf "\n" done cd ../.. - echo + printf "\n" fi if test -d src/lib then cd src/lib - echo "ALL_LIBS ::= \\" + printf "ALL_LIBS ::= \\" + printf "\n" for FILE in $(find * -type f 2> /dev/null) ; do - echo "\t${FILE} \\" + printf "\t${FILE} \\" + printf "\n" done - echo + printf "\n" - echo "INSTALL_LIBS ::= \\" + printf "INSTALL_LIBS ::= \\" + printf "\n" for FILE in $(find * -type f 2> /dev/null) ; do - echo "\t\$(DESTDIR)\$(libdir)/${FILE} \\" + printf "\t\$(libdir)/${FILE} \\" + printf "\n" done - - cd ../.. - echo fi |
