-
Notifications
You must be signed in to change notification settings - Fork 0
/
Mkpmfile
84 lines (73 loc) · 2.28 KB
/
Mkpmfile
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
# File: /Mkpmfile
# Project: mkpm
# File Created: 28-11-2023 13:42:39
# Author: Clay Risser
# BitSpur (c) Copyright 2021 - 2023
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
include $(MKPM)/mkpm
include $(MKPM)/gnu
include $(MKPM)/chain
MKPM_VERSION=1.0.0
PREFIX ?= /usr/local
DESTDIR ?=
DPKG_BUILDPACKAGE ?= dpkg-buildpackage
.PHONY: inspect
inspect: ##
@echo ARCH: $(ARCH)
@echo DOWNLOAD: $(DOWNLOAD)
@echo FLAVOR: $(FLAVOR)
@echo GREP: $(GREP)
@echo MKPM: $(MKPM)
@echo NIX_ENV: $(NIX_ENV)
@echo NPROC: $(NPROC)
@echo NULL: $(NULL)
@echo NUMPROC: $(NUMPROC)
@echo PKG_MANAGER: $(PKG_MANAGER)
@echo PLATFORM: $(PLATFORM)
@echo ROOT: $(ROOT)
@echo SED: $(SED)
@echo SHELL: $(SHELL)
@echo WHICH: $(WHICH)
ACTIONS += build
$(ACTION)/build: $(call git_deps,.) ##
@$(MKDIR) -p build
@$(CAT) install.sh | $(SED) "s|<% MKPM_VERSION %>|$(MKPM_VERSION)|g" | $(TEE) build/install.sh >$(NULL)
@$(CAT) mkpm-proxy.sh | $(SED) "s|<% MKPM_VERSION %>|$(MKPM_VERSION)|g" | $(TEE) build/mkpm-proxy.sh >$(NULL)
@$(CAT) mkpm.mk | $(SED) "s|<% MKPM_VERSION %>|$(MKPM_VERSION)|g" | $(TEE) build/mkpm.mk >$(NULL)
@$(CAT) mkpm.sh | $(SED) "s|<% MKPM_VERSION %>|$(MKPM_VERSION)|g" | $(TEE) build/mkpm >$(NULL)
@$(CHMOD) +x build/mkpm
@$(call done,$@)
.PHONY: install
install: | sudo \ ##
$(DESTDIR)$(PREFIX)/bin/mkpm
$(DESTDIR)$(PREFIX)/bin/mkpm: mkpm.sh
@$(CAT) $< | $(SED) "s|<% MKPM_VERSION %>|$(MKPM_VERSION)|g" | $(SUDO) $(TEE) $@ >$(NULL)
@$(SUDO) $(CHMOD) +x $@
.PHONY: uninstall
uninstall: | sudo ##
@$(SUDO) $(RM) -f \
$(DESTDIR)$(PREFIX)/bin/mkpm
.PHONY: reinstall
reinstall: | uninstall install
.PHONY: build-deb
build-deb:
@$(DPKG_BUILDPACKAGE) -b -us -uc
.PHONY: clean
clean: ##
@$(GIT) clean -fXd \
$(MKPM_GIT_CLEAN_FLAGS)
.PHONY: purge
purge: clean ##
@$(GIT) clean -fXd
-include $(call chain)