-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
96 lines (77 loc) · 2.71 KB
/
Copy pathMakefile
File metadata and controls
96 lines (77 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# Borg
# A container to create backups using Borg.
#
# Copyright (c) 2022 SGS Serious Gaming & Simulations GmbH
#
# This work is licensed under the terms of the MIT license.
# For a copy, see LICENSE file or <https://opensource.org/licenses/MIT>.
#
# SPDX-License-Identifier: MIT
# License-Filename: LICENSE
SHELL = /bin/sh
PACKAGE ?= backup
INSTALL ?= install
INSTALL_PROGRAM ?= $(INSTALL)
INSTALL_DATA ?= $(INSTALL) -m644
INSTALL_STATE ?= $(INSTALL) -m600
INSTALL_STATE_DIR ?= $(INSTALL) -m700
srcdir ?= .
prefix ?= /usr/local
exec_prefix ?= $(prefix)
bindir ?= $(exec_prefix)/bin
datarootdir ?= $(prefix)/share
licensedir ?= $(datarootdir)/licenses/$(PACKAGE)
ifeq ($(prefix),/usr)
sysconfdir ?= /etc
localstatedir ?= /var/lib
else ifeq ($(prefix),/usr/local)
sysconfdir ?= $(prefix)/etc
localstatedir ?= /var/local
else ifeq ($(prefix),/opt)
sysconfdir ?= /etc/opt
localstatedir ?= /var/opt
else ifeq ($(abspath $(prefix)),$(abspath $(HOME)/.local))
sysconfdir ?= $(HOME)/.config
localstatedir ?= $(prefix)/state
else
sysconfdir ?= $(prefix)/etc
localstatedir ?= $(prefix)/var
endif
.PHONY: all build tags check-for-updates install uninstall install-tools uninstall-tools clean
all: build
build:
buildah unshare ./build.sh
tags:
./tags.sh
check-for-updates:
./check-for-updates.sh
install:
@echo "Nothing to install. Did you mean 'install-tools'?"
uninstall:
@echo "Nothing to uninstall. Did you mean 'uninstall-tools'?"
install-tools:
$(INSTALL) -d "$(DESTDIR)$(bindir)"
$(INSTALL_PROGRAM) -D "$(srcdir)/tools/bin/backup" "$(DESTDIR)$(bindir)/$(PACKAGE)"
ifneq ($(strip $(sysconfdir)),)
$(INSTALL) -d "$(DESTDIR)$(sysconfdir)/$(PACKAGE)"
(cd "$(srcdir)/tools/etc"; find -type d -print0) | xargs -t -0 -I{} \
$(INSTALL) -d "$(DESTDIR)$(sysconfdir)/$(PACKAGE)/{}"
(cd "$(srcdir)/tools/etc"; find -type f -not -name '.gitignore' -print0) | xargs -t -0 -I{} \
$(INSTALL_DATA) "$(srcdir)/tools/etc/{}" "$(DESTDIR)$(sysconfdir)/$(PACKAGE)/{}"
endif
ifneq ($(strip $(localstatedir)),)
$(INSTALL_STATE_DIR) -d "$(DESTDIR)$(localstatedir)/$(PACKAGE)"
(cd "$(srcdir)/tools/var"; find -type d -print0) | xargs -t -0 -I{} \
$(INSTALL_STATE_DIR) -d "$(DESTDIR)$(localstatedir)/$(PACKAGE)/{}"
(cd "$(srcdir)/tools/var"; find -type f -not -name '.gitignore' -print0) | xargs -t -0 -I{} \
$(INSTALL_STATE) "$(srcdir)/tools/var/{}" "$(DESTDIR)$(localstatedir)/$(PACKAGE)/{}"
endif
$(INSTALL) -d "$(DESTDIR)$(licensedir)"
$(INSTALL_DATA) -D "$(srcdir)/LICENSE" "$(DESTDIR)$(licensedir)/LICENSE"
uninstall-tools:
rm -f "$(DESTDIR)$(bindir)/$(PACKAGE)"
rm -rf "$(DESTDIR)$(sysconfdir)/$(PACKAGE)"
rm -rf "$(DESTDIR)$(localstatedir)/$(PACKAGE)"
rm -rf "$(DESTDIR)$(licensedir)"
clean:
@echo "Nothing to clean. Are you looking for 'podman rmi'?"