aboutsummaryrefslogtreecommitdiffstats
path: root/package/mutt/mutt.mk
blob: 3ad0f2f43e12b85f23f5fec88f772211ca06c27c (plain)
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
#############################################################
#
# mutt
#
#############################################################
MUTT_VERSION:=1.5.17+20080114
MUTT_SOURCE:=mutt_$(MUTT_VERSION).orig.tar.gz
MUTT_PATCH:=mutt_$(MUTT_VERSION)-1.diff.gz
MUTT_SITE:=$(BR2_DEBIAN_MIRROR)/debian/pool/main/m/mutt/
MUTT_DIR:=$(BUILD_DIR)/mutt-$(MUTT_VERSION)
MUTT_CAT:=$(ZCAT)
MUTT_BINARY:=mutt
MUTT_TARGET_BINARY:=usr/bin/mutt

$(DL_DIR)/$(MUTT_SOURCE):
	$(call DOWNLOAD,$(MUTT_SITE),$(MUTT_SOURCE))

$(DL_DIR)/$(MUTT_PATCH):
	$(call DOWNLOAD,$(MUTT_SITE),$(MUTT_PATCH))

$(MUTT_DIR)/.unpacked: $(DL_DIR)/$(MUTT_SOURCE) $(DL_DIR)/$(MUTT_PATCH)
	$(MUTT_CAT) $(DL_DIR)/$(MUTT_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
	toolchain/patch-kernel.sh $(MUTT_DIR) package/mutt/ mutt-$(MUTT_VERSION)\*.patch
ifneq ($(MUTT_PATCH),)
	(cd $(MUTT_DIR) && $(MUTT_CAT) $(DL_DIR)/$(MUTT_PATCH) | patch -p1)
	if [ -d $(MUTT_DIR)/debian/patches ]; then \
		toolchain/patch-kernel.sh $(MUTT_DIR) $(MUTT_DIR)/debian/patches \*.patch; \
	fi
endif
	touch $@

$(MUTT_DIR)/.configured: $(MUTT_DIR)/.unpacked
	(cd $(MUTT_DIR); rm -rf config.cache; \
		$(TARGET_CONFIGURE_OPTS) \
		$(TARGET_CONFIGURE_ARGS) \
		./configure $(QUIET) \
		--target=$(GNU_TARGET_NAME) \
		--host=$(GNU_TARGET_NAME) \
		--build=$(GNU_HOST_NAME) \
		--prefix=/usr \
		$(DISABLE_LARGEFILE) \
		$(DISABLE_IPV6) \
		$(DISABLE_NLS) \
		--disable-smtp \
		--disable-iconv \
		--without-wc-funcs \
	)
	touch $@

$(MUTT_DIR)/$(MUTT_BINARY): $(MUTT_DIR)/.configured
	$(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(MUTT_DIR)

$(TARGET_DIR)/$(MUTT_TARGET_BINARY): $(MUTT_DIR)/$(MUTT_BINARY)
	cp -dpf $(MUTT_DIR)/$(MUTT_BINARY) $@
	$(STRIPCMD) $(STRIP_STRIP_ALL) $@

mutt-source: $(DL_DIR)/$(MUTT_SOURCE) $(DL_DIR)/$(MUTT_PATCH)

mutt-unpacked: $(MUTT_DIR)/.unpacked

mutt: ncurses $(TARGET_DIR)/$(MUTT_TARGET_BINARY)

mutt-clean:
	-$(MAKE) -C $(MUTT_DIR) clean
	rm -f $(TARGET_DIR)/$(MUTT_TARGET_BINARY)

mutt-dirclean:
	rm -rf $(MUTT_DIR)
#############################################################
#
# Toplevel Makefile options
#
#############################################################
ifeq ($(BR2_PACKAGE_MUTT),y)
TARGETS+=mutt
endif