[packages] massive change: replace occurences of -I$(STAGING_DIR)/{include,usr/includ...
[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.6
12 PKG_RELEASE:=1
13 PKG_CAT:=bzcat
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=http://www.dt.e-technik.uni-dortmund.de/~ma/leafnode/
17 PKG_MD5SUM:=5a083968dbacc3d6f6d1013241c23e39
18
19 include $(INCLUDE_DIR)/package.mk
20
21 CONFIGURE_ARGS+=--sysconfdir=/etc/leafnode
22 CONFIGURE_VARS+=LIBS=-Wl,-rpath-link=$(STAGING_DIR)/usr/lib
23
24 EXTRA_CFLAGS+= $(TARGET_CPPFLAGS)
25
26 EXTRA_LDFLAGS+=-Wl,-rpath-link=$(STAGING_DIR)/usr/lib
27
28 define Package/leafnode
29 SUBMENU:=NNTP
30 SECTION:=net
31 CATEGORY:=Network
32 DEPENDS:=+libpcre +xinetd
33 TITLE:=Leafnode store-and-forward NNTP proxy
34 URL:=http://leafnode.sourceforge.net
35 endef
36
37 define Package/leafnode/description
38 This package contains the "leafnode", "fetchnews" and
39 "texpire" programs and the necessary configuration files
40 for the leafnode proxy
41 endef
42
43 define Package/leafnode-extra
44 SUBMENU:=NNTP
45 SECTION:=net
46 CATEGORY:=Network
47 DEPENDS:=leafnode
48 TITLE:=Leafnode extra programs
49 URL:=http://leafnode.sourceforge.net
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))