summaryrefslogtreecommitdiff
path: root/openwrt/package/mgetty/Makefile
blob: 00a692db479c999e6e1b6af00eb9b67dcde522b9 (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
# $Id$

include $(TOPDIR)/rules.mk

PKG_NAME:=mgetty
PKG_VERSION:=1.1.35
PKG_XVERSION:=Feb22
PKG_RELEASE:=1
PKG_MD5SUM:=6805f8e31423bb777be80e3a856001cb

PKG_SOURCE_URL:=ftp://alpha.greenie.net/pub/mgetty/source/1.1
PKG_SOURCE:=$(PKG_NAME)$(PKG_VERSION)-$(PKG_XVERSION).tar.gz
PKG_CAT:=zcat
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install

include $(TOPDIR)/package/rules.mk

$(eval $(call PKG_template,MGETTY,mgetty,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))

$(PKG_BUILD_DIR)/policy.h: $(PKG_BUILD_DIR)/.prepared
	cp $(PKG_BUILD_DIR)/policy.h-dist $(PKG_BUILD_DIR)/policy.h
	echo "#define	AUTO_PPP" >> $(PKG_BUILD_DIR)/policy.h
	echo "#undef	FAX_NOTIFY_PROGRAM" >> $(PKG_BUILD_DIR)/policy.h
	echo "#define	FAX_NOTIFY_PROGRAM \"/usr/lib/mgetty+sendfax/new_fax\"" >> $(PKG_BUILD_DIR)/policy.h
	echo "#undef	DATA_FLOW" >> $(PKG_BUILD_DIR)/policy.h
	echo "#define	DATA_FLOW FLOW_HARD" >> $(PKG_BUILD_DIR)/policy.h
	echo "#undef	DEVICE_GROUP" >> $(PKG_BUILD_DIR)/policy.h
	echo "#undef	DEVICE_OWNER" >> $(PKG_BUILD_DIR)/policy.h
	echo "#define	DEVICE_OWNER \"root\"" >> $(PKG_BUILD_DIR)/policy.h
	echo "#undef	FAXREC_FLOW" >> $(PKG_BUILD_DIR)/policy.h
	echo "#define	FAXREC_FLOW FLOW_SOFT" >> $(PKG_BUILD_DIR)/policy.h
	echo "#undef	FAXSEND_FLOW" >> $(PKG_BUILD_DIR)/policy.h
	echo "#define	FAXSEND_FLOW FLOW_SOFT" >> $(PKG_BUILD_DIR)/policy.h

$(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/policy.h
	touch $@

$(PKG_BUILD_DIR)/.built:
	mkdir -p $(PKG_INSTALL_DIR)/usr/bin
	mkdir -p $(PKG_INSTALL_DIR)/usr/sbin
	mkdir -p $(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax
	mkdir -p $(PKG_INSTALL_DIR)/etc/mgetty+sendfax
	$(MAKE) -C $(PKG_BUILD_DIR) \
		$(TARGET_CONFIGURE_OPTS) \
		prefix="$(PKG_INSTALL_DIR)/usr" \
		CONFDIR=/etc/mgetty+sendfax
	$(CP) $(PKG_BUILD_DIR)/mgetty $(PKG_INSTALL_DIR)/usr/sbin
	$(CP) $(PKG_BUILD_DIR)/sendfax $(PKG_INSTALL_DIR)/usr/sbin
	$(CP) $(PKG_BUILD_DIR)/fax/faxrunqd $(PKG_INSTALL_DIR)/usr/sbin
	chmod 755 $(PKG_INSTALL_DIR)/usr/sbin/*
	$(CP) $(PKG_BUILD_DIR)/fax/faxq-helper $(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax
	chmod u+s $(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax/faxq-helper
	$(CP) $(PKG_BUILD_DIR)/fax/cour25n.pbm $(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax
	$(CP) $(PKG_BUILD_DIR)/fax/cour25.pbm $(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax
	$(CP) $(PKG_BUILD_DIR)/fax/faxq $(PKG_INSTALL_DIR)/usr/bin
	$(CP) $(PKG_BUILD_DIR)/fax/faxrm $(PKG_INSTALL_DIR)/usr/bin
	$(CP) $(PKG_BUILD_DIR)/fax/faxrunq $(PKG_INSTALL_DIR)/usr/bin
	$(CP) $(PKG_BUILD_DIR)/fax/faxspool $(PKG_INSTALL_DIR)/usr/bin
	$(CP) $(PKG_BUILD_DIR)/g3/g32pbm $(PKG_INSTALL_DIR)/usr/bin
	(cd $(PKG_INSTALL_DIR)/usr/bin;\
		ln -snf g32pbm g3topbm;\
	);
	$(CP) $(PKG_BUILD_DIR)/g3/g3cat $(PKG_INSTALL_DIR)/usr/bin
	$(CP) $(PKG_BUILD_DIR)/g3/pbm2g3 $(PKG_INSTALL_DIR)/usr/bin
	$(CP) $(PKG_BUILD_DIR)/g3/sff2g3 $(PKG_INSTALL_DIR)/usr/bin
	chmod 755 $(PKG_INSTALL_DIR)/usr/bin/*
# Installation into /etc
	$(CP) $(PKG_BUILD_DIR)/dialin.config $(PKG_INSTALL_DIR)/etc/mgetty+sendfax
	$(CP) $(PKG_BUILD_DIR)/fax/faxheader $(PKG_INSTALL_DIR)/etc/mgetty+sendfax
	$(CP) $(PKG_BUILD_DIR)/faxrunq.config $(PKG_INSTALL_DIR)/etc/mgetty+sendfax
	$(CP) $(PKG_BUILD_DIR)/fax/faxspool.rules $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/faxspool.rules.sample
	$(PKG_BUILD_DIR)/sedscript < $(PKG_BUILD_DIR)/login.cfg.in > $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/login.config   
	$(PKG_BUILD_DIR)/sedscript < $(PKG_BUILD_DIR)/mgetty.cfg.in > $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/mgetty.config   
	$(PKG_BUILD_DIR)/sedscript < $(PKG_BUILD_DIR)/sendfax.cfg.in > $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/sendfax.config   
	touch $@

ISBIN:=$(IDIR_MGETTY)/usr/sbin
IBIN:=$(IDIR_MGETTY)/usr/bin
ILIB:=$(IDIR_MGETTY)/usr/lib/mgetty+sendfax
IETC:=$(IDIR_MGETTY)/etc/mgetty+sendfax

$(IPKG_MGETTY):
	install -d -m0755  $(ISBIN) $(IBIN) $(ILIB) $(IETC)
	install -m0755 \
		$(PKG_INSTALL_DIR)/usr/bin/faxq \
		$(PKG_INSTALL_DIR)/usr/bin/faxrm \
		$(PKG_INSTALL_DIR)/usr/bin/faxrunq \
		$(PKG_INSTALL_DIR)/usr/bin/faxspool \
		$(PKG_INSTALL_DIR)/usr/bin/g32pbm \
		$(PKG_INSTALL_DIR)/usr/bin/g3cat \
		$(PKG_INSTALL_DIR)/usr/bin/pbm2g3 \
		$(PKG_INSTALL_DIR)/usr/bin/sff2g3 \
		$(IBIN)
	install -m0755 \
		$(PKG_INSTALL_DIR)/usr/sbin/mgetty \
		$(PKG_INSTALL_DIR)/usr/sbin/sendfax \
		$(PKG_INSTALL_DIR)/usr/sbin/faxrunqd \
		$(ISBIN)
	install -m4755 \
		$(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax/faxq-helper \
		$(ILIB)
	install -m644 \
		$(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax/cour25n.pbm \
		$(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax/cour25.pbm \
		$(ILIB)
	install -m600 \
		$(PKG_INSTALL_DIR)/etc/mgetty+sendfax/dialin.config \
		$(PKG_INSTALL_DIR)/etc/mgetty+sendfax/faxheader \
		$(PKG_INSTALL_DIR)/etc/mgetty+sendfax/faxrunq.config \
		$(PKG_INSTALL_DIR)/etc/mgetty+sendfax/faxspool.rules.sample \
		$(PKG_INSTALL_DIR)/etc/mgetty+sendfax/login.config \
		$(PKG_INSTALL_DIR)/etc/mgetty+sendfax/mgetty.config \
		$(PKG_INSTALL_DIR)/etc/mgetty+sendfax/sendfax.config \
		$(IETC)
	$(RSTRIP) $(IDIR_MGETTY)
	$(IPKG_BUILD) $(IDIR_MGETTY) $(PACKAGE_DIR)