summaryrefslogtreecommitdiffstats
path: root/rules/mgetty.make
blob: e35b8577967d13cd05bfc67774c5011656b6edaa (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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# $Id$
#
# Copyright (C) 2003 by BSP
#          
# See CREDITS for details about who has contributed to this project.
#
# For further information about the PTXdist project and license conditions
# see the README file.
#

#
# We provide this package
#
ifdef PTXCONF_MGETTY
PACKAGES += mgetty
endif

#
# Paths and names
#
MGETTY_VERSION	= 1.1.30
MGETTY_DATE	= Dec16
MGETTY		= mgetty$(MGETTY_VERSION)
MGETTY_SUFFIX	= tar.gz
MGETTY_URL	= ftp://ftp.leo.org/pub/comp/os/unix/networking/mgetty/$(MGETTY)-$(MGETTY_DATE).$(MGETTY_SUFFIX)
MGETTY_SOURCE	= $(SRCDIR)/$(MGETTY)-$(MGETTY_DATE).$(MGETTY_SUFFIX)
MGETTY_DIR	= $(BUILDDIR)/mgetty-$(MGETTY_VERSION)

# ----------------------------------------------------------------------------
# Get
# ----------------------------------------------------------------------------

mgetty_get: $(STATEDIR)/mgetty.get

mgetty_get_deps = $(MGETTY_SOURCE)

$(STATEDIR)/mgetty.get: $(mgetty_get_deps)
	@$(call targetinfo, $@)
	touch $@

$(MGETTY_SOURCE):
	@$(call targetinfo, $@)
	@$(call get, $(MGETTY_URL))

# ----------------------------------------------------------------------------
# Extract
# ----------------------------------------------------------------------------

mgetty_extract: $(STATEDIR)/mgetty.extract

mgetty_extract_deps = $(STATEDIR)/mgetty.get

$(STATEDIR)/mgetty.extract: $(mgetty_extract_deps)
	@$(call targetinfo, $@)
	@$(call clean, $(MGETTY_DIR))
	@$(call extract, $(MGETTY_SOURCE))
	touch $@

# ----------------------------------------------------------------------------
# Prepare
# ----------------------------------------------------------------------------

mgetty_prepare: $(STATEDIR)/mgetty.prepare

#
# dependencies
#
mgetty_prepare_deps = \
	$(STATEDIR)/mgetty.extract \
	$(STATEDIR)/virtual-xchain.install

MGETTY_PATH	=  PATH=$(CROSS_PATH)
MGETTY_ENV 	=  $(CROSS_ENV)
#MGETTY_ENV	+=

$(STATEDIR)/mgetty.prepare: $(mgetty_prepare_deps)
	@$(call targetinfo, $@)
	@$(call clean, $(MGETTY_DIR)/config.cache)
	cp $(PTXCONF_MGETTY_CONFIG) $(MGETTY_DIR)/policy.h
	find $(MGETTY_DIR) -name Makefile \
		-exec perl -i -p -e 's/^CFLAGS.*=.*/CFLAGS+=-DAUTO_PPP/ ;\
			s/^CC.*=.*// ;\
			s/^LDFLAGS.*=.*// ;\
			s/^LIBS.*=.*// ;\
			s/^prefix.*=.*/prefix=/' {} \;
	touch $@

# ----------------------------------------------------------------------------
# Compile
# ----------------------------------------------------------------------------

mgetty_compile: $(STATEDIR)/mgetty.compile

mgetty_compile_deps = $(STATEDIR)/mgetty.prepare

$(STATEDIR)/mgetty.compile: $(mgetty_compile_deps)
	@$(call targetinfo, $@)
	cd $(MGETTY_DIR) && make mksed
	cd $(MGETTY_DIR) && $(MGETTY_PATH) $(MGETTY_ENV) make \
		bin-all mgetty.config login.config sendfax.config
	touch $@

# ----------------------------------------------------------------------------
# Install
# ----------------------------------------------------------------------------

mgetty_install: $(STATEDIR)/mgetty.install

$(STATEDIR)/mgetty.install: $(STATEDIR)/mgetty.compile
	@$(call targetinfo, $@)
	$(MGETTY_PATH) make -C $(MGETTY_DIR) install
	touch $@

# ----------------------------------------------------------------------------
# Target-Install
# ----------------------------------------------------------------------------

mgetty_targetinstall: $(STATEDIR)/mgetty.targetinstall

mgetty_targetinstall_deps = $(STATEDIR)/mgetty.compile

$(STATEDIR)/mgetty.targetinstall: $(mgetty_targetinstall_deps)
	@$(call targetinfo, $@)
	mkdir -p $(ROOTDIR)/usr/bin
	mkdir -p $(ROOTDIR)/usr/sbin
ifdef PTXCONF_MGETTY_INSTALL_CONFIG
	mkdir -p $(ROOTDIR)/etc/mgetty+sendfax
	$(call copy_root, 0, 0, 0600, $(MGETTY_DIR)/login.config, /etc/mgetty+sendfax/login.config)
	$(call copy_root, 0, 0, 0600, $(MGETTY_DIR)/mgetty.config, /etc/mgetty+sendfax/mgetty.config)
	$(call copy_root, 0, 0, 0600, $(MGETTY_DIR)/dialin.config, /etc/mgetty+sendfax/dialin.config)
endif
	$(call copy_root, 0, 0, 0700, $(MGETTY_DIR)/mgetty, /usr/sbin/mgetty)
	$(CROSSSTRIP) -R .note -R .comment $(ROOTDIR)/usr/sbin/mgetty
ifdef PTXCONF_SENDFAX
	$(call copy_root, 0, 0, 0755, $(MGETTY_DIR)/sendfax, /usr/sbin/sendfax)
	$(CROSSSTRIP) -R .note -R .comment $(ROOTDIR)/usr/sbin/sendfax
	$(call copy_root, 0, 0, 0755, $(MGETTY_DIR)/g3/pbm2g3, /usr/bin/pbm2g3)
	$(CROSSSTRIP) -R .note -R .comment $(ROOTDIR)/usr/bin/pbm2g3
	$(call copy_root, 0, 0, 0755, $(MGETTY_DIR)/g3/g3cat, /usr/bin/g3cat)
	$(CROSSSTRIP) -R .note -R .comment $(ROOTDIR)/usr/bin/g3cat
	$(call copy_root, 0, 0, 0755, $(MGETTY_DIR)/g3/g32pbm, /usr/bin/g32pbm)
	$(CROSSSTRIP) -R .note -R .comment $(ROOTDIR)/usr/bin/g32pbm
ifdef PTXCONF_MGETTY_INSTALL_CONFIG
	$(call copy_root, 0, 0, 0644, $(MGETTY_DIR)/sendfax.config, /etc/mgetty+sendfax/sendfax.config)
endif	
ifdef PTXCONF_SENDFAX_SPOOL
	$(call copy_root, 0, 0, 0755, $(MGETTY_DIR)/fax/faxspool, /usr/bin/faxspool)
	$(call copy_root, 0, 0, 0755, $(MGETTY_DIR)/fax/faxrunq, /usr/bin/faxrunq)
	$(call copy_root, 0, 0, 0755, $(MGETTY_DIR)/fax/faxq, /usr/bin/faxq)
	$(call copy_root, 0, 0, 0755, $(MGETTY_DIR)/fax/faxrm, /usr/bin/faxrm)
	$(call copy_root, 0, 0, 0755, $(MGETTY_DIR)/fax/faxrunqd, /usr/bin/faxrunqd)
	mkdir -p $(ROOTDIR)/usr/lib/mgetty+sendfax
	$(call copy_root, 0, 0, 0755, $(MGETTY_DIR)/fax/faxq-helper, /usr/lib/mgetty+sendfax/faxq-helper)
	$(CROSSSTRIP) -R .note -R .comment $(ROOTDIR)/usr/lib/mgetty+sendfax/faxq-helper
endif
ifdef PTXCONF_MGETTY_INSTALL_CONFIG
	$(call copy_root, 0, 0, 0644, $(MGETTY_DIR)/faxrunq.config, /etc/mgetty+sendfax/faxrunq.config)
endif
endif
	touch $@

# ----------------------------------------------------------------------------
# Clean
# ----------------------------------------------------------------------------

mgetty_clean:
	rm -rf $(STATEDIR)/mgetty.*
	rm -rf $(MGETTY_DIR)

# vim: syntax=make