[packages] polipo: solve a bunch of "sh: bad number" errors in init script, always...
[openwrt/svn-archive/archive.git] / net / leafnode / Makefile
1 #
2 # Copyright (C) 2009 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:=leafnode
11 PKG_VERSION:=1.11.7
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=@SF/leafnode
16 PKG_MD5SUM:=e5e8ac28386c59df0b14ddbfcbe78509
17
18 include $(INCLUDE_DIR)/package.mk
19
20 CONFIGURE_ARGS+=--sysconfdir=/etc/leafnode
21 CONFIGURE_VARS+=LIBS=-Wl,-rpath-link=$(STAGING_DIR)/usr/lib
22
23 EXTRA_CFLAGS+= $(TARGET_CPPFLAGS)
24
25 EXTRA_LDFLAGS+=-Wl,-rpath-link=$(STAGING_DIR)/usr/lib
26
27 define Package/leafnode/Default
28 SUBMENU:=NNTP
29 SECTION:=net
30 CATEGORY:=Network
31 URL:=http://leafnode.sourceforge.net
32 endef
33
34 define Package/leafnode
35 $(call Package/leafnode/Default)
36 DEPENDS:=+libpcre +xinetd
37 TITLE:=Leafnode store-and-forward NNTP proxy
38 endef
39
40 define Package/leafnode/description
41 This package contains the "leafnode", "fetchnews" and
42 "texpire" programs and the necessary configuration files
43 for the leafnode proxy
44 endef
45
46 define Package/leafnode-extra
47 $(call Package/leafnode/Default)
48 DEPENDS:=leafnode
49 TITLE:=Leafnode extra programs
50 endef
51
52 define Package/leafnode-extra/description
53 This package contains the more rarely used "checkgroups",
54 "applyfilter" and "leafnode-version" programs from the
55 leafnode suite
56 endef
57
58 define Package/leafnode/conffiles
59 /etc/leafnode/config.example
60 /etc/xinetd.d/nntp
61 /etc/crontabs/news
62 endef
63
64 define Package/leafnode/postinst
65 #!/bin/sh
66 grep -q '^nntp[[:space:]]*119/tcp' $${IPKG_INSTROOT}/etc/services 2>/dev/null
67 [ $$? -ne 0 ] && echo "nntp 119/tcp # USENET News Transfer Protocol" >>$${IPKG_INSTROOT}/etc/services || exit 0
68 grep -q '^news:' $${IPKG_INSTROOT}/etc/services 2>/dev/null
69 [ $$? -ne 0 ] && echo "news:*:31:31:news:/var/spool/news:/bin/true" >>$${IPKG_INSTROOT}/etc/passwd || echo "news:x:31:" >>$${IPKG_INSTROOT}/etc/group || exit 0
70 endef
71
72 define Package/leafnode/install
73 $(INSTALL_DIR) $(1)/usr/sbin
74 $(INSTALL_BIN) $(PKG_BUILD_DIR)/leafnode $(1)/usr/sbin/
75 $(INSTALL_BIN) $(PKG_BUILD_DIR)/fetchnews $(1)/usr/sbin/
76 $(INSTALL_BIN) $(PKG_BUILD_DIR)/texpire $(1)/usr/sbin/
77 $(INSTALL_DIR) $(1)/etc/leafnode
78 $(INSTALL_DATA) $(PKG_BUILD_DIR)/config.example $(1)/etc/leafnode
79 $(INSTALL_DIR) $(1)/etc/xinetd.d
80 $(INSTALL_DATA) ./files/nntp $(1)/etc/xinetd.d
81 $(INSTALL_DIR) $(1)/etc/crontabs
82 $(INSTALL_DATA) ./files/news $(1)/etc/crontabs
83 endef
84
85 define Package/leafnode-extra/install
86 $(INSTALL_DIR) $(1)/usr/sbin
87 $(INSTALL_BIN) $(PKG_BUILD_DIR)/checkgroups $(1)/usr/sbin/
88 $(INSTALL_BIN) $(PKG_BUILD_DIR)/applyfilter $(1)/usr/sbin/
89 $(INSTALL_BIN) $(PKG_BUILD_DIR)/leafnode-version $(1)/usr/sbin/
90 endef
91
92 $(eval $(call BuildPackage,leafnode))
93 $(eval $(call BuildPackage,leafnode-extra))