From f231ae551665972b56b38636c8c7fab6beba9938 Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Sat, 5 Apr 2025 23:30:41 -0600 Subject: [PATCH 01/30] Update Makefile: Only call "make all" for "src" directory It's the only one that did anything with "deps". --- Makefile | 3 --- 1 file changed, 3 deletions(-) diff --git a/Makefile b/Makefile index 929a38292..206a3d918 100644 --- a/Makefile +++ b/Makefile @@ -22,9 +22,6 @@ endif %: @make -C src $@ - @make -C config_repo $@ - @make -C notificationImages $@ - @make -C scripts $@ deps: @make -C src $@ From c1f53f6938f59ce4c24e41156b1236f4c42656d6 Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Sat, 5 Apr 2025 23:40:36 -0600 Subject: [PATCH 02/30] Update Makefile: Install ffmpeg lftp imagemagick bc in "install.sh", not here --- src/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Makefile b/src/Makefile index 4b9eb647f..3e4ea5690 100644 --- a/src/Makefile +++ b/src/Makefile @@ -85,7 +85,7 @@ endif CFLAGS += $(DEFS) $(ZWOSDK) -all:check_deps capture_ZWO capture_RPi startrails keogram sunwait uhubctl +all: check_deps capture_ZWO capture_RPi startrails keogram sunwait uhubctl .PHONY : all ifneq ($(shell id -u), 0) @@ -95,7 +95,7 @@ deps: else deps: @echo `date +%F\ %R:%S` Installing build dependencies... - @apt update && apt -y install libopencv-dev libusb-dev libusb-1.0-0-dev ffmpeg lftp imagemagick bc + @apt update && apt -y install libopencv-dev libusb-dev libusb-1.0-0-dev endif .PHONY : deps From 88e2b0e965b404b26668898c82952c7f8ef6030c Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Sat, 5 Apr 2025 23:42:35 -0600 Subject: [PATCH 03/30] Update install.sh: Install ffmpeg lftp imagemagick bc rather than in the src/Makefile (which made no sense since it didn't need the packages. --- install.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/install.sh b/install.sh index b6e092bb7..1b27998c8 100755 --- a/install.sh +++ b/install.sh @@ -1818,6 +1818,11 @@ install_dependencies_etc() ln -s "${F}" "${T}" || echo "Unable to ln -s '${F}' '${T}'" >&2 fi + TMP="${ALLSKY_LOGS}/allsky_dependencies.log" + run_aptGet ffmpeg lftp imagemagick bc > "${TMP}" 2>&1 + check_success $? "Allsky dependency installation failed" "${TMP}" "${DEBUG}" || + exit_with_image 1 "${STATUS_ERROR}" "dependency installation failed" + TMP="${ALLSKY_LOGS}/make_deps.log" sudo make deps > "${TMP}" 2>&1 check_success $? "Dependency installation failed" "${TMP}" "${DEBUG}" || From 807f9dec54e1db3ec8701f9bb71a259e974a536a Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Sun, 6 Apr 2025 00:24:28 -0600 Subject: [PATCH 04/30] Update Makefile: Remove "deps" and "all" install.sh calls "make -C src ..." directly. --- Makefile | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 206a3d918..62255ef8f 100644 --- a/Makefile +++ b/Makefile @@ -3,11 +3,7 @@ prefix = sysconfdir = ${prefix}/etc exec_prefix = /usr -bindir = ${exec_prefix}/bin libexecdir = ${exec_prefix}/libexec/allsky -sharedir = ${exec_prefix}/share/allsky - -.DEFAULT_GOAL := all ROOTCHECK=$(shell id -u) ifneq ($(ROOTCHECK),0) @@ -20,24 +16,25 @@ ifeq ($(PKGBUILD),) PKGBUILD=0 endif -%: - @make -C src $@ - -deps: - @make -C src $@ - -.PHONY : deps +all: + @echo "Nothing to do for 'all'. Run 'sudo make install' instead." -install: ifneq ($(ROOTCHECK), 0) - @echo This must be run with root permissions. - @echo Please run \'sudo make install\' +install: + @echo "This must be run with root permissions." + @echo "Please run 'sudo make install'" else +install: @echo `date +%F\ %R:%S` Starting install... + @echo "" @make -C src $@ + @echo "" @make -C config_repo $@ + @echo "" @make -C notificationImages $@ + @echo "" @make -C scripts $@ + @echo "" @if [ $(PKGBUILD) -eq 1 ]; then \ [ ! -e $(DESTDIR)$(libexecdir) ] && mkdir -p $(DESTDIR)$(libexecdir) \ install allsky.sh $(DESTDIR)$(libexecdir)/allsky.sh; \ From 60e5e1370a7f2404ef65e0b630562a15e478a5ab Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Sun, 6 Apr 2025 00:28:54 -0600 Subject: [PATCH 05/30] Update Makefile: Use double quotes with echo so single quotes appear --- src/Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Makefile b/src/Makefile index 3e4ea5690..04399eb3b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -34,7 +34,6 @@ ifeq ($(PKGBUILD),) endif PKGPATH=$(shell which pkg-config) - ifneq ($(PKGPATH),) USB=$(shell pkg-config --exists libusb-1.0 && pkg-config --cflags --libs libusb-1.0) OPENCV = $(shell pkg-config --exists opencv && pkg-config --cflags --libs opencv || (pkg-config --exists opencv4 && pkg-config --cflags --libs opencv4)) @@ -177,8 +176,8 @@ symlink: all ifneq ($(ROOTCHECK), 0) install uninstall: - @echo This must be run with root permissions. - @echo Please run 'sudo make $@' + @echo "This must be run with root permissions." + @echo "Please run 'sudo make $@'" else install: @echo `date +%F\ %R:%S` Copying binaries... From 97d1754c3f44a1139529b6cf3646d755384fb2d2 Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Sun, 6 Apr 2025 00:36:48 -0600 Subject: [PATCH 06/30] Update Makefile: Add dummy "deps:" .github/workflows/ci_compile.yml calls "make deps". --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 62255ef8f..d6eb070b0 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,9 @@ endif all: @echo "Nothing to do for 'all'. Run 'sudo make install' instead." +deps: # Needed for .github/workflows/ci_compile.yml + @echo "" + ifneq ($(ROOTCHECK), 0) install: @echo "This must be run with root permissions." From fe75de83f51952d906a223910fd75af5093730c1 Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Sun, 6 Apr 2025 00:41:51 -0600 Subject: [PATCH 07/30] Update Makefile --- src/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Makefile b/src/Makefile index 04399eb3b..96c9f7cd6 100644 --- a/src/Makefile +++ b/src/Makefile @@ -2,6 +2,7 @@ arch = $(shell dpkg --print-architecture) platform = $(shell uname -m) prefix = + sysconfdir = ${prefix}/etc exec_prefix = /usr bindir = ${exec_prefix}/bin From c105d0f378841e18f296bbe35a7881a72f3ecca6 Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Sun, 6 Apr 2025 00:52:30 -0600 Subject: [PATCH 08/30] Update Makefile: Temporarily run "make -C src $@" --- Makefile | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index d6eb070b0..b5f67ce86 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,8 @@ sysconfdir = ${prefix}/etc exec_prefix = /usr libexecdir = ${exec_prefix}/libexec/allsky +.DEFAULT_GOAL := all + ROOTCHECK=$(shell id -u) ifneq ($(ROOTCHECK),0) ifeq ($(PKGBUILD),1) @@ -16,11 +18,18 @@ ifeq ($(PKGBUILD),) PKGBUILD=0 endif -all: - @echo "Nothing to do for 'all'. Run 'sudo make install' instead." +# .github/workflows/ci_compile.yml calls +# sudo make deps +# sudo make all +# Which means until ci_compile.yml is changed, we need "deps" and "all". +# Once ci_compile.yml uses "make -C src all" then remove these. +%: + @make -C src $@ +# @echo "Nothing to do for 'all'. Run 'sudo make install' instead." +deps: + @sudo make -C src $@ +.PHONY : deps -deps: # Needed for .github/workflows/ci_compile.yml - @echo "" ifneq ($(ROOTCHECK), 0) install: From a0d5fefab5c5e6c0b8e0782ed60efba6243014cf Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Sun, 6 Apr 2025 00:53:54 -0600 Subject: [PATCH 09/30] Update ci_compile.yml: Run "make -C src ..." --- .github/workflows/ci_compile.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_compile.yml b/.github/workflows/ci_compile.yml index 7df0ed71b..b9e39963b 100644 --- a/.github/workflows/ci_compile.yml +++ b/.github/workflows/ci_compile.yml @@ -23,9 +23,10 @@ jobs: # Runs a set of commands using the runners shell - name: make deps run: | - sudo make deps + sudo make -C src deps + echo "hi there" - # Info: depends an step "make deps" + # Info: depends on step "make deps" - name: make all run: | - sudo make all + make -C src all From 41f88168bafcd6c29a27aa0a481ae112f990424f Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Sun, 6 Apr 2025 00:54:17 -0600 Subject: [PATCH 10/30] Update Makefile --- src/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index 96c9f7cd6..04399eb3b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -2,7 +2,6 @@ arch = $(shell dpkg --print-architecture) platform = $(shell uname -m) prefix = - sysconfdir = ${prefix}/etc exec_prefix = /usr bindir = ${exec_prefix}/bin From ca446f0649a66c669e557956464cd069b9349369 Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Sun, 6 Apr 2025 00:57:20 -0600 Subject: [PATCH 11/30] Update ci_compile.yml: Combine deps and all --- .github/workflows/ci_compile.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/ci_compile.yml b/.github/workflows/ci_compile.yml index b9e39963b..dcd328140 100644 --- a/.github/workflows/ci_compile.yml +++ b/.github/workflows/ci_compile.yml @@ -21,12 +21,7 @@ jobs: - uses: actions/checkout@v2 # Runs a set of commands using the runners shell - - name: make deps + - name: make deps all run: | sudo make -C src deps - echo "hi there" - - # Info: depends on step "make deps" - - name: make all - run: | make -C src all From 3c54b9fd8f365c227f37257bcd0b7ee0a6c98201 Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Sun, 6 Apr 2025 00:59:30 -0600 Subject: [PATCH 12/30] Update Makefile: Remove temporary code Now that ci_compile.yml has been updated, there's no need for "deps" or "all". --- Makefile | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/Makefile b/Makefile index b5f67ce86..b560da49b 100644 --- a/Makefile +++ b/Makefile @@ -18,17 +18,8 @@ ifeq ($(PKGBUILD),) PKGBUILD=0 endif -# .github/workflows/ci_compile.yml calls -# sudo make deps -# sudo make all -# Which means until ci_compile.yml is changed, we need "deps" and "all". -# Once ci_compile.yml uses "make -C src all" then remove these. %: - @make -C src $@ -# @echo "Nothing to do for 'all'. Run 'sudo make install' instead." -deps: - @sudo make -C src $@ -.PHONY : deps + @echo "Nothing to do for 'all'. Run 'sudo make install' instead." ifneq ($(ROOTCHECK), 0) From f5df48d8b1339f6f4815b3f542537830ac98e163 Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Sun, 6 Apr 2025 01:00:46 -0600 Subject: [PATCH 13/30] Update Makefile: Use double quotes with echo so single quotes appear --- src/Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Makefile b/src/Makefile index 04399eb3b..99e36c1b9 100644 --- a/src/Makefile +++ b/src/Makefile @@ -35,9 +35,10 @@ endif PKGPATH=$(shell which pkg-config) ifneq ($(PKGPATH),) - USB=$(shell pkg-config --exists libusb-1.0 && pkg-config --cflags --libs libusb-1.0) + USB = $(shell pkg-config --exists libusb-1.0 && pkg-config --cflags --libs libusb-1.0) OPENCV = $(shell pkg-config --exists opencv && pkg-config --cflags --libs opencv || (pkg-config --exists opencv4 && pkg-config --cflags --libs opencv4)) endif + DEFS = -D_LIN -D_DEBUG -DGLIBC_20 CFLAGS = -Werror -Wall -Wno-psabi -Wno-unused-result -g -O2 -lpthread -pthread @@ -89,8 +90,8 @@ all: check_deps capture_ZWO capture_RPi startrails keogram sunwait uhubctl ifneq ($(shell id -u), 0) deps: - echo This must be run with root permissions. - echo Please run 'sudo make deps' + echo "This must be run with root permissions." + echo "Please run 'sudo make deps'" else deps: @echo `date +%F\ %R:%S` Installing build dependencies... From 3b6e674a1179301a53377f345fb2b609fb8ed39c Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Sun, 6 Apr 2025 01:19:10 -0600 Subject: [PATCH 14/30] Update install.sh: Combine "make deps" and "make all" --- install.sh | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/install.sh b/install.sh index 1b27998c8..e1adc07c9 100755 --- a/install.sh +++ b/install.sh @@ -1823,11 +1823,6 @@ install_dependencies_etc() check_success $? "Allsky dependency installation failed" "${TMP}" "${DEBUG}" || exit_with_image 1 "${STATUS_ERROR}" "dependency installation failed" - TMP="${ALLSKY_LOGS}/make_deps.log" - sudo make deps > "${TMP}" 2>&1 - check_success $? "Dependency installation failed" "${TMP}" "${DEBUG}" || - exit_with_image 1 "${STATUS_ERROR}" "dependency installation failed" - # Set some default locations needed by the capture programs so we # don't need to pass them in on the command line - if they are passed in, # those values overwrite the defaults. @@ -1835,11 +1830,13 @@ install_dependencies_etc() -e "s;XX_ALLSKY_HOME_XX;${ALLSKY_HOME};" \ -e "s;XX_CONNECTED_CAMERAS_FILE_XX;${CONNECTED_CAMERAS_INFO};" \ -e "s;XX_RPI_CAMERA_INFO_FILE_XX;${RPi_SUPPORTED_CAMERAS};" \ - "${ALLSKY_HOME}/src/include/allsky_common.h.repo" > "${ALLSKY_HOME}/src/include/allsky_common.h" + "${ALLSKY_HOME}/src/include/allsky_common.h.repo" \ + > "${ALLSKY_HOME}/src/include/allsky_common.h" - display_msg --log progress "Preparing Allsky commands." + # "make -C src deps" may need to install some packages, so needs "sudo". + display_msg --log progress "Creating Allsky commands." TMP="${ALLSKY_LOGS}/make_all.log" - make all > "${TMP}" 2>&1 + { sudo make -C src deps; make -C src all } > "${TMP}" 2>&1 check_success $? "Compile failed" "${TMP}" "${DEBUG}" || exit_with_image 1 "${STATUS_ERROR}" "compile failed" From 3c2697db8d08e7fcc7381e058dcb3cea5cf0f7f8 Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Sun, 6 Apr 2025 01:25:25 -0600 Subject: [PATCH 15/30] Update install.sh: Fix: Adding missing ";" Also, only execute "make -C src all" if "make -C src deps" worked --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index e1adc07c9..b38c95f8a 100755 --- a/install.sh +++ b/install.sh @@ -1836,7 +1836,7 @@ install_dependencies_etc() # "make -C src deps" may need to install some packages, so needs "sudo". display_msg --log progress "Creating Allsky commands." TMP="${ALLSKY_LOGS}/make_all.log" - { sudo make -C src deps; make -C src all } > "${TMP}" 2>&1 + { sudo make -C src deps && make -C src all ; } > "${TMP}" 2>&1 check_success $? "Compile failed" "${TMP}" "${DEBUG}" || exit_with_image 1 "${STATUS_ERROR}" "compile failed" From 5a4e5524305b1f6b3a3c557058d023070f1b9809 Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Sun, 6 Apr 2025 05:54:25 -0600 Subject: [PATCH 16/30] Update Makefile: Delete PKGBUILD-related code --- Makefile | 34 +++++----------------------------- 1 file changed, 5 insertions(+), 29 deletions(-) diff --git a/Makefile b/Makefile index b560da49b..b5d80b640 100644 --- a/Makefile +++ b/Makefile @@ -1,22 +1,8 @@ platform = $(shell uname -m) -prefix = - -sysconfdir = ${prefix}/etc -exec_prefix = /usr -libexecdir = ${exec_prefix}/libexec/allsky .DEFAULT_GOAL := all ROOTCHECK=$(shell id -u) -ifneq ($(ROOTCHECK),0) - ifeq ($(PKGBUILD),1) - ROOTCHECK=0 - endif -endif - -ifeq ($(PKGBUILD),) - PKGBUILD=0 -endif %: @echo "Nothing to do for 'all'. Run 'sudo make install' instead." @@ -25,7 +11,7 @@ endif ifneq ($(ROOTCHECK), 0) install: @echo "This must be run with root permissions." - @echo "Please run 'sudo make install'" + @echo "Please run 'sudo make install'." else install: @echo `date +%F\ %R:%S` Starting install... @@ -38,19 +24,9 @@ install: @echo "" @make -C scripts $@ @echo "" - @if [ $(PKGBUILD) -eq 1 ]; then \ - [ ! -e $(DESTDIR)$(libexecdir) ] && mkdir -p $(DESTDIR)$(libexecdir) \ - install allsky.sh $(DESTDIR)$(libexecdir)/allsky.sh; \ - fi - @if [ $(PKGBUILD) -ne 1 ]; then \ - echo `date +%F\ %R:%S` Setting directory permissions...; \ - [ ! -e tmp ] && mkdir tmp; \ - chown -R $(SUDO_USER):$(SUDO_USER) ./ ; \ - echo ""; \ - echo ""; \ - echo `date +%F\ %R:%S` Install complete; \ - echo ""; \ - echo ""; \ - fi + @echo "`date +%F\ %R:%S` Setting directory permissions..." + @[ ! -e tmp ] && mkdir tmp + @chown -R $(SUDO_USER):$(SUDO_USER) ./ + @echo "\n\n`date +%F\ %R:%S` Install complete\n\n" endif .PHONY : install From c2c58c6c7777975891f1e36110d27cb5913c2fe0 Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Sun, 6 Apr 2025 06:13:33 -0600 Subject: [PATCH 17/30] Update Makefile: Delete PKGBUILD-related code --- config_repo/Makefile | 128 +++++++++++++++---------------------------- 1 file changed, 43 insertions(+), 85 deletions(-) diff --git a/config_repo/Makefile b/config_repo/Makefile index d9a752545..40cf64796 100644 --- a/config_repo/Makefile +++ b/config_repo/Makefile @@ -1,125 +1,83 @@ platform = $(shell uname -m) -prefix = - -sysconfdir = ${prefix}/etc -exec_prefix = /usr -bindir = ${exec_prefix}/bin -libexecdir = ${exec_prefix}/libexec/allsky -sharedir = ${exec_prefix}/share/allsky HOMEDIR = $(shell dirname "$$PWD") +CONFIGDIR = ${HOMEDIR}/config SCRIPTSDIR = ${HOMEDIR}/scripts +UTILITIESDIR = ${SCRIPTSDIR}/utilities +# TODO: get from variables.sh +NORESTARTCODES = 100 101 +LIBSYSTEMDIR = /lib/systemd/system .DEFAULT_GOAL := all ROOTCHECK=$(shell id -u) -ifneq ($(ROOTCHECK),0) - ifeq ($(PKGBUILD),1) - ROOTCHECK=0 - endif -endif - -ifeq ($(PKGBUILD),) - PKGBUILD=0 -endif - ENVFILE := env.json -UNINSTALLFILES := $(DESTDIR)$(sysconfdir)/logrotate.d/allsky $(DESTDIR)$(sysconfdir)/rsyslog.d/allsky.conf $(DESTDIR)$(sysconfdir)/systemd/system/allsky.service $(DESTDIR)$(sysconfdir)/systemd/system/allskyperiodic.service +UNINSTALLFILES := /etc/logrotate.d/allsky /etc/rsyslog.d/allsky.conf /etc/systemd/system/allsky.service /etc/systemd/system/allskyperiodic.service %: - @echo `date +%F\ %R:%S` nothing to do for $@ + @echo "`date +%F\ %R:%S` nothing to do for $@" ifneq ($(ROOTCHECK), 0) install uninstall: - @echo This must be run with root permissions. - @echo Please run \'sudo make $@\' + @echo "This must be run with root permissions." + @echo "Please run 'sudo make $@'." else # Root check passed uninstall: - @echo `date +%F\ %R:%S` Removing installed files: $(UNINSTALLFILES) + @echo "`date +%F\ %R:%S` Removing installed files: $(UNINSTALLFILES)" @rm -f $(UNINSTALLFILES) - @echo `date +%F\ %R:%S` Complete. - @echo `date +%F\ %R:%S` NOTE: Config files were \-NOT\- removed. - @echo `date +%F\ %R:%S` To remove config files, please run \'sudo make remove_configs\' + @echo "`date +%F\ %R:%S` Complete." + @echo "`date +%F\ %R:%S` NOTE: Config files were -NOT- removed." + @echo "`date +%F\ %R:%S` To remove config files, please run 'sudo make remove_configs'." .PHONY : uninstall -ifeq ($(PKGBUILD),1) - -remove_configs: - @echo `date +%F\ %R:%S` Removing config path and files $(DESTDIR)$(sysconfigdir)/allsky - @rm -rf $(DESTDIR)$(sysconfigdir)/allsky - -createDirs: - @echo `date +%F\ %R:%S` Creating directory structures... - @if [ ! -e $(DESTDIR)$(sysconfdir)/allsky ]; then mkdir -p $(DESTDIR)$(sysconfdir)/allsky; fi - @if [ ! -e $(DESTDIR)$(sysconfdir)/profile.d ]; then mkdir -p $(DESTDIR)$(sysconfdir)/profile.d; fi - @if [ ! -e $(DESTDIR)$(sysconfdir)/systemd/system ]; then mkdir -p $(DESTDIR)$(sysconfdir)/systemd/system; fi - @if [ ! -e $(DESTDIR)$(sysconfdir)/udev/rules.d ]; then mkdir -p $(DESTDIR)$(sysconfdir)/udev/rules.d; fi -.PHONY : createDirs - -$(ENVFILE): - @if [ ! -e $(DESTDIR)$(sysconfdir)/allsky/$@ ]; then \ - echo `date +%F\ %R:%S` Copying default $@; \ - cp $@.repo > env; \ - install -m 0664 env $(HOMEDIR)/$@; \ - rm -f env; \ - fi -# TODO: In PKGBUILD mode, where is the "allsky" directory? $(ENVFILE) needs to go in it. -# Is $(HOMEDIR) the correct location, or should it be $(DESTDIR)$(sysconfdir)/allsky ? -.PHONY : $(ENVFILE) - -install: createDirs $(ENVFILE) - @echo `date +%F\ %R:%S` Setting up udev rules... - @install -D -m 0644 asi.rules $(DESTDIR)$(sysconfdir)/udev/rules.d/ - @echo `date +%F\ %R:%S` Setting up logging... - @install -D -m 0644 allsky.logrotate.repo $(DESTDIR)$(sysconfdir)/logrotate.d/allsky - @install -D -m 0644 allsky.rsyslog.repo $(DESTDIR)$(sysconfdir)/rsyslog.d/allsky.conf - @echo `date +%F\ %R:%S` Setting allsky to auto start... - @sed -e "s|XX_ALLSKY_OWNER_XX|allsky|" -e "s|XX_ALLSKY_HOME_XX|$(bindir)|" allsky.service.repo > allsky.service - @install -m 0644 allsky.service $(DESTDIR)$(sysconfdir)/systemd/system/ - @rm -f allsky.service - @echo `date +%F\ %R:%S` Setting up home environment variable... - @echo "export ALLSKY_TMP=/tmp\nexport ALLSKY_CONFIG=$(DESTDIR)$(sysconfdir)/allsky\nexport ALLSKY_SCRIPTS=$(DESTDIR)$(libexecdir)\nexport ALLSKY_NOTIFICATION_IMAGES=$(DESTDIR)$(sharedir)\nexport ALLSKY_IMAGES=/home/allsky/images/\nPATH=${PATH}:${DESTDIR}$(libexedir)" > $(DESTDIR)$(sysconfdir)/profile.d/allsy.sh - - -else # Not in package build mode ###################################### - remove_configs: - @echo `date +%F\ %R:%S` Removing config path and files ../config - @rm -rf ../config + @echo "`date +%F\ %R:%S` Removing config path and files $(CONFIGDIR)" + @rm -rf $(CONFIGDIR) .PHONY : remove_configs createDirs: - @echo `date +%F\ %R:%S` Creating directory structures... - @if [ ! -e ../config ]; then mkdir -p ../config; chown $(SUDO_USER):$(SUDO_USER) ../config; fi + @echo "`date +%F\ %R:%S` Creating directory structures..." + @if [ ! -e $(CONFIGDIR) ]; then \ + mkdir -p $(CONFIGDIR); \ + chown $(SUDO_USER):$(SUDO_USER) $(CONFIGDIR); \ + fi .PHONY : createDirs install: createDirs - @echo `date +%F\ %R:%S` Setting up udev rules... - @install -D -m 0644 asi.rules $(DESTDIR)$(sysconfdir)/udev/rules.d/ - @echo `date +%F\ %R:%S` Setting up logging... - @install -D -m 0644 allsky.logrotate.repo $(DESTDIR)$(sysconfdir)/logrotate.d/allsky - @install -D -m 0644 allsky.rsyslog.repo $(DESTDIR)$(sysconfdir)/rsyslog.d/allsky.conf + @echo "`date +%F\ %R:%S` Setting up udev rules..." + @install -D -m 0644 asi.rules /etc/udev/rules.d/ + @echo "`date +%F\ %R:%S` Setting up logging..." + @install -D -m 0644 allsky.logrotate.repo /etc/logrotate.d/allsky + @install -D -m 0644 allsky.rsyslog.repo /etc/rsyslog.d/allsky.conf @udevadm control -R @udevadm trigger - @echo `date +%F\ %R:%S` Setting allsky to auto start... + @echo "`date +%F\ %R:%S` Setting allsky to auto start..." @if [ -e /etc/xdg/lxsession/LXDE-pi/autostart ]; then \ sed -i '/allsky.sh/d' /etc/xdg/lxsession/LXDE-pi/autostart; fi - @# Don't use the /lib/systemd/system directory - @sed -e "s|XX_ALLSKY_OWNER_XX|$(SUDO_USER)|" -e "s|XX_ALLSKY_HOME_XX|$(HOMEDIR)|" -e "s|XX_ALLSKY_SCRIPTS_XX|$(SCRIPTSDIR)|" allsky.service.repo > allsky.service - @install -m 0644 allsky.service $(DESTDIR)$(sysconfdir)/systemd/system/ + @# Don't use the $(LIBSYSTEMDIR) directory + sed -e "s|XX_ALLSKY_OWNER_XX|$(SUDO_USER)|" \ + -e "s|XX_ALLSKY_HOME_XX|$(HOMEDIR)|" \ + -e "s|XX_NO_RESTART_CODES_XX|$(NORESTARTCODES)|" \ + -e "s|XX_ALLSKY_UTILITIES_XX|$(UTILITIESDIR)|" \ + allsky.service.repo > allsky.service + @install -m 0644 allsky.service /etc/systemd/system/ @rm -f allsky.service - @if [ -e /lib/systemd/system/allsky.service ]; then rm -f /lib/systemd/system/allsky.service; fi - @sed -e "s|XX_ALLSKY_OWNER_XX|$(SUDO_USER)|" -e "s|XX_ALLSKY_SCRIPTS_XX|$(SCRIPTSDIR)|" allskyperiodic.service.repo > allskyperiodic.service - @install -m 0644 allskyperiodic.service $(DESTDIR)$(sysconfdir)/systemd/system/ + @if [ -e $(LIBSYSTEMDIR)/allsky.service ]; then rm -f $(LIBSYSTEMDIR)/allsky.service; fi + sed -e "s|XX_ALLSKY_OWNER_XX|$(SUDO_USER)|" \ + -e "s|XX_NO_RESTART_CODES_XX|$(NORESTARTCODES)|" \ + -e "s|XX_ALLSKY_SCRIPTS_XX|$(SCRIPTSDIR)|" \ + allskyperiodic.service.repo > allskyperiodic.service + @install -m 0644 allskyperiodic.service /etc/systemd/system/ @rm -f allskyperiodic.service - @if [ -e /lib/systemd/system/allskyperiodic.service ]; then rm -f /lib/systemd/system/allskyperiodic.service; fi + @if [ -e $(LIBSYSTEMDIR)/allskyperiodic.service ]; then rm -f $(LIBSYSTEMDIR)/allskyperiodic.service; fi @systemctl daemon-reload @systemctl enable allsky @systemctl enable allskyperiodic @echo `date +%F\ %R:%S` Setting up ALLSKY_HOME environment variable... - @echo "export ALLSKY_HOME=$(HOMEDIR)\nPATH=${PATH}:$(SCRIPTSDIR)" > $(DESTDIR)$(sysconfdir)/profile.d/allsky.sh + @echo "export ALLSKY_HOME=$(HOMEDIR)\nPATH=${PATH}:$(SCRIPTSDIR)" > /etc/profile.d/allsky.sh + .PHONY : install -endif # Package build check + endif # Root check From 67acc3a9eb98f6a8bc4aca1bd97a57776d4901e3 Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Sun, 6 Apr 2025 06:42:33 -0600 Subject: [PATCH 18/30] Update Makefile: Delete PKGBUILD-related code Also: * delete RIGHTPATH code - we'll never get there. --- src/Makefile | 114 ++++++++++++--------------------------------------- 1 file changed, 26 insertions(+), 88 deletions(-) diff --git a/src/Makefile b/src/Makefile index 99e36c1b9..654536712 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,37 +1,14 @@ arch = $(shell dpkg --print-architecture) platform = $(shell uname -m) -prefix = -sysconfdir = ${prefix}/etc -exec_prefix = /usr -bindir = ${exec_prefix}/bin -libexecdir = ${exec_prefix}/libexec/allsky -sharedir = ${exec_prefix}/share/allsky +bindir = /usr/bin PDIR = $(shell dirname "$$PWD") MYDIR = $(shell basename "$$PWD") -RIGHTPATH = 1 - -ifneq (src,$(MYDIR)) - RIGHTPATH = 0 -endif - -ifneq (1,$(RIGHTPATH)) - $(error Unexpected directory structure. This should be in allsky/src directory.) -else .DEFAULT_GOAL := all ROOTCHECK=$(shell id -u) -ifneq ($(ROOTCHECK),0) - ifeq ($(PKGBUILD),1) - ROOTCHECK=0 - endif -endif - -ifeq ($(PKGBUILD),) - PKGBUILD=0 -endif PKGPATH=$(shell which pkg-config) ifneq ($(PKGPATH),) @@ -88,19 +65,6 @@ CFLAGS += $(DEFS) $(ZWOSDK) all: check_deps capture_ZWO capture_RPi startrails keogram sunwait uhubctl .PHONY : all -ifneq ($(shell id -u), 0) -deps: - echo "This must be run with root permissions." - echo "Please run 'sudo make deps'" -else -deps: - @echo `date +%F\ %R:%S` Installing build dependencies... - @apt update && apt -y install libopencv-dev libusb-dev libusb-1.0-0-dev -endif - -.PHONY : deps - - check_deps: ifeq (,$(USB)) $(error Did not find USB Libraries, try 'sudo make deps') @@ -144,86 +108,60 @@ capture_ZWO: capture_ZWO.o allsky_common.o @$(CC) -o $@ $(CFLAGS) capture_ZWO.o allsky_common.o $(OPENCV) -lASICamera2 $(USB) @echo `date +%F\ %R:%S` Done. -capture_RPi:capture_RPi.o allsky_common.o mode_mean.o +capture_RPi: capture_RPi.o allsky_common.o mode_mean.o @echo `date +%F\ %R:%S` Building $@ program... @$(CC) -o $@ $(CFLAGS) capture_RPi.o allsky_common.o $(OPENCV) mode_mean.o @echo `date +%F\ %R:%S` Done. -keogram:keogram.cpp +keogram: keogram.cpp @echo `date +%F\ %R:%S` Building $@ program... @$(CC) $@.cpp -o $@ $(CFLAGS) $(OPENCV) @echo `date +%F\ %R:%S` Done. -startrails:startrails.cpp +startrails: startrails.cpp @echo `date +%F\ %R:%S` Building $@ program... @$(CC) $@.cpp -o $@ $(CFLAGS) $(OPENCV) @echo `date +%F\ %R:%S` Done. -uhubctl:uhubctl.c +uhubctl: uhubctl.c @echo `date +%F\ %R:%S` Building $@ program... # This comes from the uhubctl Makefile: @cc -g -O0 -Wall -Wextra -std=c99 -pedantic -DPROGRAM_VERSION=\"2.5.0\" -I/usr/include/libusb-1.0 $@.c -o $@ -Wl,-zrelro,-znow -lusb-1.0 @echo `date +%F\ %R:%S` Done. -symlink: all - @echo `date +%F\ %R:%S` Symlinking binaries... - @ln -s $$PWD/capture_ZWO ../bin/ - @ln -s $$PWD/capture_RPi ../bin/ - @ln -s $$PWD/keogram ../bin/ - @ln -s $$PWD/startrails ../bin/ - @ln -s $$PWD/uhubctl ../bin/ - -.PHONY: symlink - ifneq ($(ROOTCHECK), 0) -install uninstall: +deps install uninstall: @echo "This must be run with root permissions." - @echo "Please run 'sudo make $@'" + @echo "Please run 'sudo make $@'." else +deps: + @echo "`date +%F\ %R:%S` Installing build dependencies..." + @apt -y install libopencv-dev libusb-dev libusb-1.0-0-dev + install: - @echo `date +%F\ %R:%S` Copying binaries... - @if [ $(PKGBUILD) -eq 1 ]; then \ - [ ! -e $(DESTDIR)$(bindir) ] && mkdir -p $(DESTDIR)$(bindir); \ - install capture_ZWO $(DESTDIR)$(bindir); \ - install capture_RPi $(DESTDIR)$(bindir); \ - install keogram $(DESTDIR)$(bindir); \ - install startrails $(DESTDIR)$(bindir); \ - install uhubctl $(DESTDIR)$(bindir); \ - else \ - [ ! -e ../bin ] && mkdir -p ../bin; \ - install -o $(SUDO_USER) -g $(SUDO_USER) capture_ZWO ../bin/; \ - install -o $(SUDO_USER) -g $(SUDO_USER) capture_RPi ../bin/; \ - install -o $(SUDO_USER) -g $(SUDO_USER) keogram ../bin/; \ - install -o $(SUDO_USER) -g $(SUDO_USER) startrails ../bin/; \ - install -o $(SUDO_USER) -g $(SUDO_USER) uhubctl ../bin/; \ - fi + @echo "`date +%F\ %R:%S` Copying binaries..." + @[ ! -e ../bin ] && mkdir -p ../bin + @install -o $(SUDO_USER) -g $(SUDO_USER) capture_ZWO ../bin/ + @install -o $(SUDO_USER) -g $(SUDO_USER) capture_RPi ../bin/ + @install -o $(SUDO_USER) -g $(SUDO_USER) keogram ../bin/ + @install -o $(SUDO_USER) -g $(SUDO_USER) startrails ../bin/ + @install -o $(SUDO_USER) -g $(SUDO_USER) uhubctl ../bin/ @install sunwait $(DESTDIR)$(bindir) uninstall: - @echo `date +%F\ %R:%S` Removing binaries... - @if [ $(PKGBUILD) -eq 1 ]; then \ - rm -f $(DESTDIR)$(bindir)/capture_ZWO; \ - rm -f $(DESTDIR)$(bindir)/capture_RPi; \ - rm -f $(DESTDIR)$(bindir)/keogram; \ - rm -f $(DESTDIR)$(bindir)/startrails; \ - rm -f $(DESTDIR)$(bindir)/sunwait; \ - rm -f $(DESTDIR)$(bindir)/uhubctl; \ - else \ - rm -f ../bin/capture_ZWO; \ - rm -f ../bin/capture_RPi; \ - rm -f ../bin/keogram; \ - rm -f ../bin/startrails; \ - rm -f ../bin/uhubctl; \ - fi + @echo "`date +%F\ %R:%S` Removing binaries..." + @rm -f ../bin/capture_ZWO + @rm -f ../bin/capture_RPi + @rm -f ../bin/keogram + @rm -f ../bin/startrails + @rm -f ../bin/uhubctl endif # sudo / root check -.PHONY : install uninstall +.PHONY : deps install uninstall clean: rm -f capture_ZWO capture_RPi startrails keogram sunwait uhubctl *.o *.a .PHONY : clean -endif # Correct directory structure check - %: - @echo `date +%F\ %R:%S` nothing to do for $@ + @echo "`date +%F\ %R:%S` nothing to do for $@" From e9f521cef920028b78b8de8a9420069a6a2f4e0b Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Sun, 6 Apr 2025 06:46:49 -0600 Subject: [PATCH 19/30] Delete notificationImages/Makefile: not needed --- notificationImages/Makefile | 44 ------------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 notificationImages/Makefile diff --git a/notificationImages/Makefile b/notificationImages/Makefile deleted file mode 100644 index f1afbb480..000000000 --- a/notificationImages/Makefile +++ /dev/null @@ -1,44 +0,0 @@ -platform = $(shell uname -m) -prefix = - -sysconfdir = ${prefix}/etc -exec_prefix = /usr -bindir = ${exec_prefix}/bin -libexecdir = ${exec_prefix}/libexec/allsky -sharedir = ${exec_prefix}/share/allsky - -.DEFAULT_GOAL := all - -ROOTCHECK=$(shell id -u) -ifneq ($(ROOTCHECK),0) - ifeq ($(PKGBUILD),1) - ROOTCHECK=0 - endif -endif - -ifeq ($(PKGBUILD),) - PKGBUILD=0 -endif - -%: - @echo `date +%F\ %R:%S` nothing to do for $@... - -ifneq ($(ROOTCHECK), 0) -install uninstall: - @echo This must be run with root permissions. - @echo Please run \'sudo make $@\' - -else - -ifeq ($(PKGBUILD),1) -install: - @echo `date +%F\ %R:%S` Setting up Notification Images... - @if [ ! -e $(DESTDIR)$(sharedir) ] && mkdir -p $(DESTDIR)$(sharedir); fi - @install -m 0644 *.jpg *.png $(DESTDIR)$(sharedir)/ - -uninstall: - @echo `date +%F\ %R:%S` Removing Notification Images... - @rm -rf $(DESTDIR)$(sharedir) - -endif # PKGBUILD -endif # ROOTCHECK From dc337fe7d01da6610ff4df95c7a74582edf43997 Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Sun, 6 Apr 2025 06:47:54 -0600 Subject: [PATCH 20/30] Update Makefile: Delete "make -C notificationImages" It was only needed with PKGBUILD --- Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Makefile b/Makefile index b5d80b640..e43f5f80b 100644 --- a/Makefile +++ b/Makefile @@ -20,8 +20,6 @@ install: @echo "" @make -C config_repo $@ @echo "" - @make -C notificationImages $@ - @echo "" @make -C scripts $@ @echo "" @echo "`date +%F\ %R:%S` Setting directory permissions..." From 349b0986a35d40669f66bfbf549fd3aca881fcd3 Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Sun, 6 Apr 2025 06:50:27 -0600 Subject: [PATCH 21/30] Delete scripts/Makefile: Not needed without PKGBUILD --- scripts/Makefile | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 scripts/Makefile diff --git a/scripts/Makefile b/scripts/Makefile deleted file mode 100644 index 397799b08..000000000 --- a/scripts/Makefile +++ /dev/null @@ -1,46 +0,0 @@ -platform = $(shell uname -m) -prefix = - -sysconfdir = ${prefix}/etc -exec_prefix = /usr -bindir = ${exec_prefix}/bin -libexecdir = ${exec_prefix}/libexec/allsky -sharedir = ${exec_prefix}/share/allsky - -.DEFAULT_GOAL := all - -ROOTCHECK=$(shell id -u) -ifneq ($(ROOTCHECK),0) - ifeq ($(PKGBUILD),1) - ROOTCHECK=0 - endif -endif - -ifeq ($(PKGBUILD),) - PKGBUILD=0 -endif - -%: - @echo `date +%F\ %R:%S` nothing to do for $@ - -ifneq ($(ROOTCHECK), 0) -install uninstall: - @echo This must be run with root permissions. - @echo Please run \'sudo make install\' -else - -install: - @echo `date +%F\ %R:%S` Setting up scripts... - @chmod 755 *.sh - @if [ $(PKGBUILD) -eq 1 ]; then \ - [ ! -e $(DESTDIR)$(libexecdir) ] && mkdir -p $(DESTDIR)$(libexecdir); \ - install *.sh $(DESTDIR)$(libexecdir)/; \ - fi - -ifeq ($(PKGBUILD),1) -uninstall: - @echo `date +%F\ %R:%S` Removing scripts... - @rm -rf $(DESTDIR)$(libexecdir) - -endif # PKGBUILD -endif # ROOTCHECK From d846d21a7a759aa53a5b2cd0098eb36294088b26 Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Sun, 6 Apr 2025 06:51:25 -0600 Subject: [PATCH 22/30] Update Makefile: Delete "make -C scripts" Was only needed with PKGBUILD --- Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Makefile b/Makefile index e43f5f80b..85f1a2904 100644 --- a/Makefile +++ b/Makefile @@ -20,8 +20,6 @@ install: @echo "" @make -C config_repo $@ @echo "" - @make -C scripts $@ - @echo "" @echo "`date +%F\ %R:%S` Setting directory permissions..." @[ ! -e tmp ] && mkdir tmp @chown -R $(SUDO_USER):$(SUDO_USER) ./ From ab2785c04a9a6239e064400a79bed08ed041c8d8 Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Sun, 6 Apr 2025 17:25:04 -0600 Subject: [PATCH 23/30] Update ci_compile.yml: Add "sudo apt update" - GitHub needs it when compiling --- .github/workflows/ci_compile.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci_compile.yml b/.github/workflows/ci_compile.yml index dcd328140..e870500ee 100644 --- a/.github/workflows/ci_compile.yml +++ b/.github/workflows/ci_compile.yml @@ -23,5 +23,6 @@ jobs: # Runs a set of commands using the runners shell - name: make deps all run: | + sudo apt update sudo make -C src deps make -C src all From 727cec4f2767aa2fd786fb4357af0fb308de6923 Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Sun, 6 Apr 2025 17:26:17 -0600 Subject: [PATCH 24/30] Update Makefile: Add space for testing compile --- src/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index 654536712..de18f1051 100644 --- a/src/Makefile +++ b/src/Makefile @@ -7,7 +7,7 @@ PDIR = $(shell dirname "$$PWD") MYDIR = $(shell basename "$$PWD") .DEFAULT_GOAL := all - + ROOTCHECK=$(shell id -u) PKGPATH=$(shell which pkg-config) From ece75b859a88bc8e523ea46a1eabfb191531ce9d Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Sun, 6 Apr 2025 17:29:03 -0600 Subject: [PATCH 25/30] Update Makefile: Remove temporary space With the change to ci_compile.yml, everything now compiles. --- src/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index de18f1051..654536712 100644 --- a/src/Makefile +++ b/src/Makefile @@ -7,7 +7,7 @@ PDIR = $(shell dirname "$$PWD") MYDIR = $(shell basename "$$PWD") .DEFAULT_GOAL := all - + ROOTCHECK=$(shell id -u) PKGPATH=$(shell which pkg-config) From 7b31d3c5407d04523f46766558118922bba6a6ba Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Sun, 6 Apr 2025 17:50:07 -0600 Subject: [PATCH 26/30] Update Makefile: Fix "[ ! -e ../bin ] && mkdir -p ../bin" Not sure why it didn't work - it worked in prior version when part of an "if" statement. Also, replace "../bin" with ALLSKYBIN --- src/Makefile | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/Makefile b/src/Makefile index 654536712..e46d97208 100644 --- a/src/Makefile +++ b/src/Makefile @@ -5,6 +5,7 @@ bindir = /usr/bin PDIR = $(shell dirname "$$PWD") MYDIR = $(shell basename "$$PWD") +ALLSKYBIN = ../bin .DEFAULT_GOAL := all @@ -140,21 +141,21 @@ deps: install: @echo "`date +%F\ %R:%S` Copying binaries..." - @[ ! -e ../bin ] && mkdir -p ../bin - @install -o $(SUDO_USER) -g $(SUDO_USER) capture_ZWO ../bin/ - @install -o $(SUDO_USER) -g $(SUDO_USER) capture_RPi ../bin/ - @install -o $(SUDO_USER) -g $(SUDO_USER) keogram ../bin/ - @install -o $(SUDO_USER) -g $(SUDO_USER) startrails ../bin/ - @install -o $(SUDO_USER) -g $(SUDO_USER) uhubctl ../bin/ - @install sunwait $(DESTDIR)$(bindir) + @if [ ! -e $(ALLSKYBIN) ]; then mkdir -p $(ALLSKYBIN); fi + @install -o $(SUDO_USER) -g $(SUDO_USER) capture_ZWO $(ALLSKYBIN)/ + @install -o $(SUDO_USER) -g $(SUDO_USER) capture_RPi $(ALLSKYBIN)/ + @install -o $(SUDO_USER) -g $(SUDO_USER) keogram $(ALLSKYBIN)/ + @install -o $(SUDO_USER) -g $(SUDO_USER) startrails $(ALLSKYBIN)/ + @install -o $(SUDO_USER) -g $(SUDO_USER) uhubctl $(ALLSKYBIN)/ + @install sunwait $(bindir) uninstall: @echo "`date +%F\ %R:%S` Removing binaries..." - @rm -f ../bin/capture_ZWO - @rm -f ../bin/capture_RPi - @rm -f ../bin/keogram - @rm -f ../bin/startrails - @rm -f ../bin/uhubctl + @rm -f $(ALLSKYBIN)/capture_ZWO + @rm -f $(ALLSKYBIN)/capture_RPi + @rm -f $(ALLSKYBIN)/keogram + @rm -f $(ALLSKYBIN)/startrails + @rm -f $(ALLSKYBIN)/uhubctl endif # sudo / root check .PHONY : deps install uninstall From 3b753701753fd34c13c9ab7e9a1b56e941000fb8 Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Sun, 6 Apr 2025 17:54:12 -0600 Subject: [PATCH 27/30] Update install.sh: Add headers when running "make" twice in same log file. --- install.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index b38c95f8a..5707ff261 100755 --- a/install.sh +++ b/install.sh @@ -1836,7 +1836,10 @@ install_dependencies_etc() # "make -C src deps" may need to install some packages, so needs "sudo". display_msg --log progress "Creating Allsky commands." TMP="${ALLSKY_LOGS}/make_all.log" - { sudo make -C src deps && make -C src all ; } > "${TMP}" 2>&1 + { + echo "===== make deps" + sudo make -C src deps && echo -e "\n\n===== make all" && make -C src all + } > "${TMP}" 2>&1 check_success $? "Compile failed" "${TMP}" "${DEBUG}" || exit_with_image 1 "${STATUS_ERROR}" "compile failed" From afdba33b84dbb9c757bcdda3e32670842956e562 Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Sun, 6 Apr 2025 17:57:14 -0600 Subject: [PATCH 28/30] Update Makefile: Prepend "@" to "sed" statements --- config_repo/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config_repo/Makefile b/config_repo/Makefile index 40cf64796..4b16d8746 100644 --- a/config_repo/Makefile +++ b/config_repo/Makefile @@ -57,7 +57,7 @@ install: createDirs @if [ -e /etc/xdg/lxsession/LXDE-pi/autostart ]; then \ sed -i '/allsky.sh/d' /etc/xdg/lxsession/LXDE-pi/autostart; fi @# Don't use the $(LIBSYSTEMDIR) directory - sed -e "s|XX_ALLSKY_OWNER_XX|$(SUDO_USER)|" \ + @sed -e "s|XX_ALLSKY_OWNER_XX|$(SUDO_USER)|" \ -e "s|XX_ALLSKY_HOME_XX|$(HOMEDIR)|" \ -e "s|XX_NO_RESTART_CODES_XX|$(NORESTARTCODES)|" \ -e "s|XX_ALLSKY_UTILITIES_XX|$(UTILITIESDIR)|" \ @@ -65,7 +65,7 @@ install: createDirs @install -m 0644 allsky.service /etc/systemd/system/ @rm -f allsky.service @if [ -e $(LIBSYSTEMDIR)/allsky.service ]; then rm -f $(LIBSYSTEMDIR)/allsky.service; fi - sed -e "s|XX_ALLSKY_OWNER_XX|$(SUDO_USER)|" \ + @sed -e "s|XX_ALLSKY_OWNER_XX|$(SUDO_USER)|" \ -e "s|XX_NO_RESTART_CODES_XX|$(NORESTARTCODES)|" \ -e "s|XX_ALLSKY_SCRIPTS_XX|$(SCRIPTSDIR)|" \ allskyperiodic.service.repo > allskyperiodic.service @@ -75,7 +75,7 @@ install: createDirs @systemctl daemon-reload @systemctl enable allsky @systemctl enable allskyperiodic - @echo `date +%F\ %R:%S` Setting up ALLSKY_HOME environment variable... + @echo "`date +%F\ %R:%S` Setting up ALLSKY_HOME environment variable..." @echo "export ALLSKY_HOME=$(HOMEDIR)\nPATH=${PATH}:$(SCRIPTSDIR)" > /etc/profile.d/allsky.sh .PHONY : install From 6c1c0bde4dfc1d1c66b498b414cfaebf9925e7da Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Sun, 6 Apr 2025 18:08:50 -0600 Subject: [PATCH 29/30] Update Makefile: Let install.sh create allsky/tmp and set permissions "install.sh" knows which files/directories should NOT be pi:pi. --- Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 85f1a2904..4fd59098d 100644 --- a/Makefile +++ b/Makefile @@ -20,9 +20,7 @@ install: @echo "" @make -C config_repo $@ @echo "" - @echo "`date +%F\ %R:%S` Setting directory permissions..." - @[ ! -e tmp ] && mkdir tmp - @chown -R $(SUDO_USER):$(SUDO_USER) ./ @echo "\n\n`date +%F\ %R:%S` Install complete\n\n" endif + .PHONY : install From 634990fd8b3ecdb35f5d896b2a48ad775f83f7d4 Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Sun, 6 Apr 2025 18:09:25 -0600 Subject: [PATCH 30/30] Update install.sh: fix typo --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 5707ff261..6f13f98c2 100755 --- a/install.sh +++ b/install.sh @@ -1846,7 +1846,7 @@ install_dependencies_etc() TMP="${ALLSKY_LOGS}/make_install.log" sudo make install > "${TMP}" 2>&1 check_success $? "make install failed" "${TMP}" "${DEBUG}" || - exit_with_image 1 "${STATUS_ERROR}" "make insall_failed" + exit_with_image 1 "${STATUS_ERROR}" "make install failed" STATUS_VARIABLES+=("${FUNCNAME[0]}='true'\n") }