summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-04-11 13:52:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-04-11 13:52:42 +0000
commitc759c2b9c54ba0262980214cd3d7cb6566ed7c7b (patch)
treee54395585d3605a86e91680ea200779058cc10e5 /Makefile
parentAdding upstream version 20210101. (diff)
downloadopen-infrastructure-compute-tools-c759c2b9c54ba0262980214cd3d7cb6566ed7c7b.tar.xz
open-infrastructure-compute-tools-c759c2b9c54ba0262980214cd3d7cb6566ed7c7b.zip
Adding upstream version 20210411.upstream/20210411
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--Makefile85
1 files changed, 47 insertions, 38 deletions
diff --git a/Makefile b/Makefile
index 2b1fb37..538c2ac 100644
--- a/Makefile
+++ b/Makefile
@@ -13,7 +13,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
SHELL := sh -e
@@ -21,23 +21,20 @@ PROJECT = open-infrastructure
SOFTWARE = compute-tools
PROGRAM = container
-SCRIPTS = bin/* lib/*/*
+SCRIPTS = bin/* libexec/*/*
all: build
test:
- @echo -n "Checking for syntax errors"
-
+ @echo -n "Checking for syntax errors with sh... "
@for SCRIPT in $(SCRIPTS); \
do \
sh -n $${SCRIPT}; \
echo -n "."; \
done
-
@echo " done."
- @echo -n "Checking for bashisms"
-
+ @echo -n "Checking for bashisms... "
@if [ -x /usr/bin/checkbashisms ]; \
then \
for SCRIPT in $(SCRIPTS); \
@@ -48,7 +45,20 @@ test:
else \
echo "Note: devscripts not installed, skipping checkbashisms."; \
fi
+ @echo " done."
+ # FIXME: fail hard on shellcheck once all issues are fixed
+ @echo -n "Checking with shellcheck... "
+ @if [ -x /usr/bin/checkbashisms ]; \
+ then \
+ for SCRIPT in $(SCRIPTS); \
+ do \
+ shellcheck $${SCRIPT} || true; \
+ echo -n "."; \
+ done; \
+ else \
+ echo "Note: shellcheck not installed, skipping shellcheck."; \
+ fi
@echo " done."
build: share/man/*.txt
@@ -57,19 +67,19 @@ build: share/man/*.txt
sed -n '/^NAME/,$$p' share/man/$(SOFTWARE).7.txt > README.txt
install: build
- mkdir -p $(DESTDIR)/etc/$(PROJECT)/$(PROGRAM)/config
- mkdir -p $(DESTDIR)/etc/$(PROJECT)/$(PROGRAM)/debconf
- mkdir -p $(DESTDIR)/etc/$(PROJECT)/$(PROGRAM)/hooks
+ mkdir -p $(DESTDIR)/etc/$(SOFTWARE)/config
+ mkdir -p $(DESTDIR)/etc/$(SOFTWARE)/debconf
+ mkdir -p $(DESTDIR)/etc/$(SOFTWARE)/hooks
mkdir -p $(DESTDIR)/usr/bin
cp -r bin/* $(DESTDIR)/usr/bin
- mkdir -p $(DESTDIR)/usr/lib/$(PROJECT)
- cp -r lib/* $(DESTDIR)/usr/lib/$(PROJECT)
+ mkdir -p $(DESTDIR)/usr/libexec
+ cp -r libexec/* $(DESTDIR)/usr/libexec
- mkdir -p $(DESTDIR)/usr/share/$(PROJECT)/$(PROGRAM)
- cp -r VERSION.txt $(DESTDIR)/usr/share/$(PROJECT)/$(PROGRAM)
- cp -r share/config share/hooks share/scripts $(DESTDIR)/usr/share/$(PROJECT)/$(PROGRAM)
+ mkdir -p $(DESTDIR)/usr/share/$(SOFTWARE)
+ cp -r VERSION.txt $(DESTDIR)/usr/share/$(SOFTWARE)
+ cp -r share/config share/hooks share/scripts $(DESTDIR)/usr/share/$(SOFTWARE)
mkdir -p $(DESTDIR)/usr/share/bash-completion/completions
cp -r share/bash-completion/* $(DESTDIR)/usr/share/bash-completion/completions
@@ -102,31 +112,31 @@ install: build
ln -sf container-shell.1 $(DESTDIR)/usr/share/man/man1/cntsh.1
ln -sf container $(DESTDIR)/usr/share/bash-completion/completions/cnt
- ln -sf debconf $(DESTDIR)/usr/share/$(PROJECT)/$(PROGRAM)/scripts/debian
- ln -sf debconf.d $(DESTDIR)/usr/share/$(PROJECT)/$(PROGRAM)/scripts/debian.d
+ ln -sf debconf $(DESTDIR)/usr/share/$(SOFTWARE)/scripts/debian
+ ln -sf debconf.d $(DESTDIR)/usr/share/$(SOFTWARE)/scripts/debian.d
ln -sf container-create-debconf.1 $(DESTDIR)/usr/share/man/man1/container-create-debian.1
- ln -sf debconf $(DESTDIR)/usr/share/$(PROJECT)/$(PROGRAM)/scripts/progress-linux
- ln -sf debconf.d $(DESTDIR)/usr/share/$(PROJECT)/$(PROGRAM)/scripts/progress-linux.d
+ ln -sf debconf $(DESTDIR)/usr/share/$(SOFTWARE)/scripts/progress-linux
+ ln -sf debconf.d $(DESTDIR)/usr/share/$(SOFTWARE)/scripts/progress-linux.d
ln -sf container-create-debconf.1 $(DESTDIR)/usr/share/man/man1/container-create-progress-linux.1
- ln -sf debootstrap $(DESTDIR)/usr/share/$(PROJECT)/$(PROGRAM)/scripts/mmdebstrap
+ ln -sf debootstrap $(DESTDIR)/usr/share/$(SOFTWARE)/scripts/mmdebstrap
ln -sf container-create-debootstrap.1 $(DESTDIR)/usr/share/man/man1/container-create-mmdebstrap.1
- ln -sf create $(DESTDIR)/usr/lib/$(PROJECT)/$(PROGRAM)/cr
- ln -sf list $(DESTDIR)/usr/lib/$(PROJECT)/$(PROGRAM)/ls
- ln -sf move $(DESTDIR)/usr/lib/$(PROJECT)/$(PROGRAM)/mv
- ln -sf remove $(DESTDIR)/usr/lib/$(PROJECT)/$(PROGRAM)/rm
- ln -sf restart $(DESTDIR)/usr/lib/$(PROJECT)/$(PROGRAM)/rs
- ln -sf start $(DESTDIR)/usr/lib/$(PROJECT)/$(PROGRAM)/s
- ln -sf status $(DESTDIR)/usr/lib/$(PROJECT)/$(PROGRAM)/st
- ln -sf stop $(DESTDIR)/usr/lib/$(PROJECT)/$(PROGRAM)/t
+ ln -sf create $(DESTDIR)/usr/libexec/$(PROGRAM)/cr
+ ln -sf list $(DESTDIR)/usr/libexec/$(PROGRAM)/ls
+ ln -sf move $(DESTDIR)/usr/libexec/$(PROGRAM)/mv
+ ln -sf remove $(DESTDIR)/usr/libexec/$(PROGRAM)/rm
+ ln -sf restart $(DESTDIR)/usr/libexec/$(PROGRAM)/rs
+ ln -sf start $(DESTDIR)/usr/libexec/$(PROGRAM)/s
+ ln -sf status $(DESTDIR)/usr/libexec/$(PROGRAM)/st
+ ln -sf stop $(DESTDIR)/usr/libexec/$(PROGRAM)/t
mkdir -p $(DESTDIR)/lib/systemd/system
cp -r share/systemd/* $(DESTDIR)/lib/systemd/system
- mkdir -p $(DESTDIR)/var/log/$(PROJECT)
+ mkdir -p $(DESTDIR)/var/log/$(SOFTWARE)
uninstall:
- rmdir --ignore-fail-on-non-empty --parents $(DESTDIR)/var/log/$(PROJECT) || true
+ rmdir --ignore-fail-on-non-empty --parents $(DESTDIR)/var/log/$(SOFTWARE) || true
for FILE in share/systemd/*; \
do \
@@ -174,11 +184,11 @@ uninstall:
rm -rf $(DESTDIR)/usr/share/doc/$(SOFTWARE)
rmdir --ignore-fail-on-non-empty --parents $(DESTDIR)/usr/share/doc || true
- rm -rf $(DESTDIR)/usr/share/$(PROJECT)/$(PROGRAM)
+ rm -rf $(DESTDIR)/usr/share/$(SOFTWARE)
rmdir --ignore-fail-on-non-empty --parents $(DESTDIR)/usr/share || true
- rm -rf $(DESTDIR)/usr/lib/$(PROJECT)/$(PROGRAM)
- rmdir --ignore-fail-on-non-empty --parents $(DESTDIR)/usr/lib || true
+ rm -rf $(DESTDIR)/usr/libexec/$(PROGRAM)
+ rmdir --ignore-fail-on-non-empty --parents $(DESTDIR)/usr/libexec || true
for FILE in bin/*; \
do \
@@ -186,11 +196,10 @@ uninstall:
done
rmdir --ignore-fail-on-non-empty --parents $(DESTDIR)/usr/bin || true
- rmdir --ignore-fail-on-non-empty --parents $(DESTDIR)/etc/$(PROJECT)/$(PROGRAM)/config || true
- rmdir --ignore-fail-on-non-empty --parents $(DESTDIR)/etc/$(PROJECT)/$(PROGRAM)/debconf || true
- rmdir --ignore-fail-on-non-empty --parents $(DESTDIR)/etc/$(PROJECT)/$(PROGRAM)/hooks || true
- rmdir --ignore-fail-on-non-empty --parents $(DESTDIR)/etc/$(PROJECT)/$(PROGRAM) || true
- rmdir --ignore-fail-on-non-empty --parents $(DESTDIR)/etc/$(PROJECT) || true
+ rmdir --ignore-fail-on-non-empty --parents $(DESTDIR)/etc/$(SOFTWARE)/config || true
+ rmdir --ignore-fail-on-non-empty --parents $(DESTDIR)/etc/$(SOFTWARE)/debconf || true
+ rmdir --ignore-fail-on-non-empty --parents $(DESTDIR)/etc/$(SOFTWARE)/hooks || true
+ rmdir --ignore-fail-on-non-empty --parents $(DESTDIR)/etc/$(SOFTWARE) || true
rmdir --ignore-fail-on-non-empty --parents $(DESTDIR)/etc || true
rmdir --ignore-fail-on-non-empty --parents $(DESTDIR) || true