added mgetty from Mad Martin, thx
[openwrt/svn-archive/archive.git] / openwrt / package / mgetty / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=mgetty
6 PKG_VERSION:=1.1.35
7 PKG_XVERSION:=Feb22
8 PKG_RELEASE:=1
9 PKG_MD5SUM:=6805f8e31423bb777be80e3a856001cb
10
11 PKG_SOURCE_URL:=ftp://alpha.greenie.net/pub/mgetty/source/1.1
12 PKG_SOURCE:=$(PKG_NAME)$(PKG_VERSION)-$(PKG_XVERSION).tar.gz
13 PKG_CAT:=zcat
14 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
15 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
16
17 include $(TOPDIR)/package/rules.mk
18
19 $(eval $(call PKG_template,MGETTY,mgetty,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
20
21 $(PKG_BUILD_DIR)/policy.h: $(PKG_BUILD_DIR)/.prepared
22 cp $(PKG_BUILD_DIR)/policy.h-dist $(PKG_BUILD_DIR)/policy.h
23 echo "#define AUTO_PPP" >> $(PKG_BUILD_DIR)/policy.h
24 echo "#undef FAX_NOTIFY_PROGRAM" >> $(PKG_BUILD_DIR)/policy.h
25 echo "#define FAX_NOTIFY_PROGRAM \"/usr/lib/mgetty+sendfax/new_fax\"" >> $(PKG_BUILD_DIR)/policy.h
26 echo "#undef DATA_FLOW" >> $(PKG_BUILD_DIR)/policy.h
27 echo "#define DATA_FLOW FLOW_HARD" >> $(PKG_BUILD_DIR)/policy.h
28 echo "#undef DEVICE_GROUP" >> $(PKG_BUILD_DIR)/policy.h
29 echo "#undef DEVICE_OWNER" >> $(PKG_BUILD_DIR)/policy.h
30 echo "#define DEVICE_OWNER \"root\"" >> $(PKG_BUILD_DIR)/policy.h
31 echo "#undef FAXREC_FLOW" >> $(PKG_BUILD_DIR)/policy.h
32 echo "#define FAXREC_FLOW FLOW_SOFT" >> $(PKG_BUILD_DIR)/policy.h
33 echo "#undef FAXSEND_FLOW" >> $(PKG_BUILD_DIR)/policy.h
34 echo "#define FAXSEND_FLOW FLOW_SOFT" >> $(PKG_BUILD_DIR)/policy.h
35
36 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/policy.h
37 touch $@
38
39 $(PKG_BUILD_DIR)/.built:
40 mkdir -p $(PKG_INSTALL_DIR)/usr/bin
41 mkdir -p $(PKG_INSTALL_DIR)/usr/sbin
42 mkdir -p $(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax
43 mkdir -p $(PKG_INSTALL_DIR)/etc/mgetty+sendfax
44 $(MAKE) -C $(PKG_BUILD_DIR) \
45 $(TARGET_CONFIGURE_OPTS) \
46 prefix="$(PKG_INSTALL_DIR)/usr" \
47 CONFDIR=/etc/mgetty+sendfax
48 $(CP) $(PKG_BUILD_DIR)/mgetty $(PKG_INSTALL_DIR)/usr/sbin
49 $(CP) $(PKG_BUILD_DIR)/sendfax $(PKG_INSTALL_DIR)/usr/sbin
50 $(CP) $(PKG_BUILD_DIR)/fax/faxrunqd $(PKG_INSTALL_DIR)/usr/sbin
51 chmod 755 $(PKG_INSTALL_DIR)/usr/sbin/*
52 $(CP) $(PKG_BUILD_DIR)/fax/faxq-helper $(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax
53 chmod u+s $(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax/faxq-helper
54 $(CP) $(PKG_BUILD_DIR)/fax/cour25n.pbm $(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax
55 $(CP) $(PKG_BUILD_DIR)/fax/cour25.pbm $(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax
56 $(CP) $(PKG_BUILD_DIR)/fax/faxq $(PKG_INSTALL_DIR)/usr/bin
57 $(CP) $(PKG_BUILD_DIR)/fax/faxrm $(PKG_INSTALL_DIR)/usr/bin
58 $(CP) $(PKG_BUILD_DIR)/fax/faxrunq $(PKG_INSTALL_DIR)/usr/bin
59 $(CP) $(PKG_BUILD_DIR)/fax/faxspool $(PKG_INSTALL_DIR)/usr/bin
60 $(CP) $(PKG_BUILD_DIR)/g3/g32pbm $(PKG_INSTALL_DIR)/usr/bin
61 (cd $(PKG_INSTALL_DIR)/usr/bin;\
62 ln -snf g32pbm g3topbm;\
63 );
64 $(CP) $(PKG_BUILD_DIR)/g3/g3cat $(PKG_INSTALL_DIR)/usr/bin
65 $(CP) $(PKG_BUILD_DIR)/g3/pbm2g3 $(PKG_INSTALL_DIR)/usr/bin
66 $(CP) $(PKG_BUILD_DIR)/g3/sff2g3 $(PKG_INSTALL_DIR)/usr/bin
67 chmod 755 $(PKG_INSTALL_DIR)/usr/bin/*
68 # Installation into /etc
69 $(CP) $(PKG_BUILD_DIR)/dialin.config $(PKG_INSTALL_DIR)/etc/mgetty+sendfax
70 $(CP) $(PKG_BUILD_DIR)/fax/faxheader $(PKG_INSTALL_DIR)/etc/mgetty+sendfax
71 $(CP) $(PKG_BUILD_DIR)/faxrunq.config $(PKG_INSTALL_DIR)/etc/mgetty+sendfax
72 $(CP) $(PKG_BUILD_DIR)/fax/faxspool.rules $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/faxspool.rules.sample
73 $(PKG_BUILD_DIR)/sedscript < $(PKG_BUILD_DIR)/login.cfg.in > $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/login.config
74 $(PKG_BUILD_DIR)/sedscript < $(PKG_BUILD_DIR)/mgetty.cfg.in > $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/mgetty.config
75 $(PKG_BUILD_DIR)/sedscript < $(PKG_BUILD_DIR)/sendfax.cfg.in > $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/sendfax.config
76 touch $@
77
78 ISBIN:=$(IDIR_MGETTY)/usr/sbin
79 IBIN:=$(IDIR_MGETTY)/usr/bin
80 ILIB:=$(IDIR_MGETTY)/usr/lib/mgetty+sendfax
81 IETC:=$(IDIR_MGETTY)/etc/mgetty+sendfax
82
83 $(IPKG_MGETTY):
84 install -d -m0755 $(ISBIN) $(IBIN) $(ILIB) $(IETC)
85 install -m0755 \
86 $(PKG_INSTALL_DIR)/usr/bin/faxq \
87 $(PKG_INSTALL_DIR)/usr/bin/faxrm \
88 $(PKG_INSTALL_DIR)/usr/bin/faxrunq \
89 $(PKG_INSTALL_DIR)/usr/bin/faxspool \
90 $(PKG_INSTALL_DIR)/usr/bin/g32pbm \
91 $(PKG_INSTALL_DIR)/usr/bin/g3cat \
92 $(PKG_INSTALL_DIR)/usr/bin/pbm2g3 \
93 $(PKG_INSTALL_DIR)/usr/bin/sff2g3 \
94 $(IBIN)
95 install -m0755 \
96 $(PKG_INSTALL_DIR)/usr/sbin/mgetty \
97 $(PKG_INSTALL_DIR)/usr/sbin/sendfax \
98 $(PKG_INSTALL_DIR)/usr/sbin/faxrunqd \
99 $(ISBIN)
100 install -m4755 \
101 $(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax/faxq-helper \
102 $(ILIB)
103 install -m644 \
104 $(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax/cour25n.pbm \
105 $(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax/cour25.pbm \
106 $(ILIB)
107 install -m600 \
108 $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/dialin.config \
109 $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/faxheader \
110 $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/faxrunq.config \
111 $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/faxspool.rules.sample \
112 $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/login.config \
113 $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/mgetty.config \
114 $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/sendfax.config \
115 $(IETC)
116 $(RSTRIP) $(IDIR_MGETTY)
117 $(IPKG_BUILD) $(IDIR_MGETTY) $(PACKAGE_DIR)