poco: moved to github
[openwrt/svn-archive/packages.git] / utils / mgetty / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=mgetty
11 PKG_VERSION:=1.1.36
12 PKG_XVERSION:=Jun15
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)$(PKG_VERSION)-$(PKG_XVERSION).tar.gz
16 PKG_SOURCE_URL:=ftp://alpha.greenie.net/pub/mgetty/source/1.1
17 PKG_MD5SUM:=0320e98c6b86bcca48fc5f355b94ead4
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define Package/mgetty
22 SECTION:=utils
23 CATEGORY:=Utilities
24 TITLE:=A data/fax solution for your analog modem
25 URL:=http://mgetty.greenie.net/
26 endef
27
28 define Package/mgetty/description
29 A data/fax solution for your analog modem.
30 endef
31
32 define Build/Configure
33 cp $(PKG_BUILD_DIR)/policy.h-dist $(PKG_BUILD_DIR)/policy.h
34 echo "#define AUTO_PPP" >> $(PKG_BUILD_DIR)/policy.h
35 echo "#undef FAX_NOTIFY_PROGRAM" >> $(PKG_BUILD_DIR)/policy.h
36 echo "#define FAX_NOTIFY_PROGRAM \"/usr/lib/mgetty+sendfax/new_fax\"" >> $(PKG_BUILD_DIR)/policy.h
37 echo "#undef DATA_FLOW" >> $(PKG_BUILD_DIR)/policy.h
38 echo "#define DATA_FLOW FLOW_HARD" >> $(PKG_BUILD_DIR)/policy.h
39 echo "#undef DEVICE_GROUP" >> $(PKG_BUILD_DIR)/policy.h
40 echo "#undef DEVICE_OWNER" >> $(PKG_BUILD_DIR)/policy.h
41 echo "#define DEVICE_OWNER \"root\"" >> $(PKG_BUILD_DIR)/policy.h
42 echo "#undef FAXREC_FLOW" >> $(PKG_BUILD_DIR)/policy.h
43 echo "#define FAXREC_FLOW FLOW_SOFT" >> $(PKG_BUILD_DIR)/policy.h
44 echo "#undef FAXSEND_FLOW" >> $(PKG_BUILD_DIR)/policy.h
45 echo "#define FAXSEND_FLOW FLOW_SOFT" >> $(PKG_BUILD_DIR)/policy.h
46 endef
47
48 #FIXME: don't manually install, use upstream Makefile instead
49 define Build/Compile
50 rm -rf $(PKG_INSTALL_DIR)
51 mkdir -p $(PKG_INSTALL_DIR)/usr/bin
52 mkdir -p $(PKG_INSTALL_DIR)/usr/sbin
53 mkdir -p $(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax
54 mkdir -p $(PKG_INSTALL_DIR)/etc/mgetty+sendfax
55 $(MAKE) -C $(PKG_BUILD_DIR) \
56 mksed
57 $(MAKE) -C $(PKG_BUILD_DIR) \
58 $(TARGET_CONFIGURE_OPTS) \
59 CFLAGS="$(TARGET_CFLAGS)" \
60 prefix="$(PKG_INSTALL_DIR)/usr" \
61 CONFDIR=/etc/mgetty+sendfax \
62 bin-all
63 $(CP) $(PKG_BUILD_DIR)/mgetty $(PKG_INSTALL_DIR)/usr/sbin
64 $(CP) $(PKG_BUILD_DIR)/sendfax $(PKG_INSTALL_DIR)/usr/sbin
65 $(CP) $(PKG_BUILD_DIR)/fax/faxrunqd $(PKG_INSTALL_DIR)/usr/sbin
66 chmod 755 $(PKG_INSTALL_DIR)/usr/sbin/*
67 $(CP) $(PKG_BUILD_DIR)/fax/faxq-helper $(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax
68 chmod u+s $(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax/faxq-helper
69 $(CP) $(PKG_BUILD_DIR)/fax/cour25n.pbm $(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax
70 $(CP) $(PKG_BUILD_DIR)/fax/cour25.pbm $(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax
71 $(CP) $(PKG_BUILD_DIR)/fax/faxq $(PKG_INSTALL_DIR)/usr/bin
72 $(CP) $(PKG_BUILD_DIR)/fax/faxrm $(PKG_INSTALL_DIR)/usr/bin
73 $(CP) $(PKG_BUILD_DIR)/fax/faxrunq $(PKG_INSTALL_DIR)/usr/bin
74 $(CP) $(PKG_BUILD_DIR)/fax/faxspool $(PKG_INSTALL_DIR)/usr/bin
75 $(CP) $(PKG_BUILD_DIR)/g3/g32pbm $(PKG_INSTALL_DIR)/usr/bin
76 (cd $(PKG_INSTALL_DIR)/usr/bin;\
77 ln -snf g32pbm g3topbm;\
78 );
79 $(CP) $(PKG_BUILD_DIR)/g3/g3cat $(PKG_INSTALL_DIR)/usr/bin
80 $(CP) $(PKG_BUILD_DIR)/g3/pbm2g3 $(PKG_INSTALL_DIR)/usr/bin
81 $(CP) $(PKG_BUILD_DIR)/g3/sff2g3 $(PKG_INSTALL_DIR)/usr/bin
82 chmod 755 $(PKG_INSTALL_DIR)/usr/bin/*
83 # Installation into /etc
84 $(CP) $(PKG_BUILD_DIR)/dialin.config $(PKG_INSTALL_DIR)/etc/mgetty+sendfax
85 $(CP) $(PKG_BUILD_DIR)/fax/faxheader $(PKG_INSTALL_DIR)/etc/mgetty+sendfax
86 $(CP) $(PKG_BUILD_DIR)/faxrunq.config $(PKG_INSTALL_DIR)/etc/mgetty+sendfax
87 $(CP) $(PKG_BUILD_DIR)/fax/faxspool.rules $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/faxspool.rules.sample
88 $(PKG_BUILD_DIR)/sedscript < $(PKG_BUILD_DIR)/login.cfg.in > $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/login.config
89 $(PKG_BUILD_DIR)/sedscript < $(PKG_BUILD_DIR)/mgetty.cfg.in > $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/mgetty.config
90 $(PKG_BUILD_DIR)/sedscript < $(PKG_BUILD_DIR)/sendfax.cfg.in > $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/sendfax.config
91 endef
92
93 define Package/mgetty/install
94 $(INSTALL_DIR) $(1)/usr/bin
95 $(INSTALL_BIN) \
96 $(PKG_INSTALL_DIR)/usr/bin/faxq \
97 $(PKG_INSTALL_DIR)/usr/bin/faxrm \
98 $(PKG_INSTALL_DIR)/usr/bin/faxrunq \
99 $(PKG_INSTALL_DIR)/usr/bin/faxspool \
100 $(PKG_INSTALL_DIR)/usr/bin/g32pbm \
101 $(PKG_INSTALL_DIR)/usr/bin/g3cat \
102 $(PKG_INSTALL_DIR)/usr/bin/pbm2g3 \
103 $(PKG_INSTALL_DIR)/usr/bin/sff2g3 \
104 $(1)/usr/bin/
105 $(INSTALL_DIR) $(1)/usr/sbin
106 $(INSTALL_BIN) \
107 $(PKG_INSTALL_DIR)/usr/sbin/mgetty \
108 $(PKG_INSTALL_DIR)/usr/sbin/sendfax \
109 $(PKG_INSTALL_DIR)/usr/sbin/faxrunqd \
110 $(1)/usr/sbin/
111 $(INSTALL_DIR) $(1)/usr/lib/mgetty+sendfax
112 install -m4755 \
113 $(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax/faxq-helper \
114 $(1)/usr/lib/mgetty+sendfax/
115 install -m644 \
116 $(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax/cour25n.pbm \
117 $(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax/cour25.pbm \
118 $(1)/usr/lib/mgetty+sendfax/
119 $(INSTALL_DIR) $(1)/etc/mgetty+sendfax
120 install -m600 \
121 $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/dialin.config \
122 $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/faxheader \
123 $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/faxrunq.config \
124 $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/faxspool.rules.sample \
125 $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/login.config \
126 $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/mgetty.config \
127 $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/sendfax.config \
128 $(1)/etc/mgetty+sendfax/
129 endef
130
131 $(eval $(call BuildPackage,mgetty))