forked from ProcursusTeam/Procursus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
less.mk
50 lines (41 loc) · 1.33 KB
/
less.mk
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
ifneq ($(PROCURSUS),1)
$(error Use the main Makefile)
endif
SUBPROJECTS += less
LESS_VERSION := 530
DEB_LESS_V ?= $(LESS_VERSION)
less-setup: setup
wget -q -nc -P $(BUILD_SOURCE) https://ftpmirror.gnu.org/less/less-$(LESS_VERSION).tar.gz{,.sig}
$(call PGP_VERIFY,less-$(LESS_VERSION).tar.gz)
$(call EXTRACT_TAR,less-$(LESS_VERSION).tar.gz,less-$(LESS_VERSION),less)
ifneq ($(wildcard $(BUILD_WORK)/less/.build_complete),)
less:
@echo "Using previously built less."
else
less: less-setup ncurses pcre
cd $(BUILD_WORK)/less && ./configure -C \
--host=$(GNU_HOST_TRIPLE) \
--prefix=/usr \
--with-regex=pcre \
CFLAGS="$(CFLAGS) -Wno-implicit-function-declaration" \
LDFLAGS="$(CFLAGS) $(LDFLAGS)"
+$(MAKE) -C $(BUILD_WORK)/less
+$(MAKE) -C $(BUILD_WORK)/less install \
DESTDIR="$(BUILD_STAGE)/less"
touch $(BUILD_WORK)/less/.build_complete
endif
less-package: less-stage
# less.mk Package Structure
rm -rf $(BUILD_DIST)/less
mkdir -p $(BUILD_DIST)/less/{bin,etc/profile.d}
# less.mk Prep less
cp -a $(BUILD_STAGE)/less/usr $(BUILD_DIST)/less
ln -s /usr/bin/less $(BUILD_DIST)/less/bin/more
ln -s /usr/bin/less $(BUILD_DIST)/less/usr/bin/more
# less.mk Sign
$(call SIGN,less,general.xml)
# less.mk Make .debs
$(call PACK,less,DEB_LESS_V)
# less.mk Build cleanup
rm -rf $(BUILD_DIST)/less
.PHONY: less less-package