bcd1f22d0e6963154132351c09f0d8546ec46846
[packages.git] / net / djbdns / Makefile
1 # Copyright (C) 2007 OpenWrt.org
2 # Original port by FreeWRT project.
3 #
4 # 2007     Alexander Tsvyashchenko  Adapted FreeWRT port for OpenWRT (Trac ticket 2497)
5 # 2008     Some Danish guy          Created a port for OpenWRT 7.09
6 # 20090403 jhalfmoon                Modified and augmented existing packages to work on OpenWRT buildroot (v8.09)
7 #
8 # This is free software, licensed under the GNU General Public License v2.
9 # See /LICENSE for more information.
10 #
11
12 include $(TOPDIR)/rules.mk
13
14 PKG_NAME:=djbdns
15 PKG_VERSION:=1.05
16 PKG_RELEASE:=4
17
18 PKG_SOURCE:=${PKG_NAME}-${PKG_VERSION}.tar.gz
19 PKG_SOURCE_URL:=http://cr.yp.to/djbdns/
20 PKG_MD5SUM:=3147c5cd56832aa3b41955c7a51cbeb2
21 PKG_BUILD_DEPENDS:=daemontools ucspi-tcp
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/djbdns/Default
26   SECTION:=net
27   CATEGORY:=Network
28   URL:=http://cr.yp.to/djbdns.html
29   SUBMENU:=DNS
30 #  SUBMENU:=djbdns
31 endef
32
33 define Package/djbdns-base
34   $(call Package/djbdns/Default)
35   TITLE:=djbdns base configuration file
36 endef
37
38 define Package/djbdns-dnscache
39   $(call Package/djbdns/Default)
40   TITLE:=Recursive and forwarding caching name server
41   DEPENDS:= +djbdns-base
42 endef
43
44 define Package/djbdns-tinydns
45   $(call Package/djbdns/Default)
46   TITLE:=Authoritative name server
47   DEPENDS:= +djbdns-base
48 endef
49
50 define Package/djbdns-axfrdns
51   $(call Package/djbdns/Default)
52   TITLE:=Zone transfer server
53   DEPENDS:= +djbdns-base +djbdns-tinydns +ucspi-tcp
54 endef
55
56 define Package/djbdns-rbldns
57   $(call Package/djbdns/Default)
58   TITLE:=Real-time Block List name server
59   DEPENDS:= +djbdns-base
60 endef
61
62 define Package/djbdns-walldns
63   $(call Package/djbdns/Default)
64   TITLE:=Reverse DNS wall
65   DEPENDS:= +djbdns-base
66 endef
67
68 define Package/djbdns-tools
69   $(call Package/djbdns/Default)
70   TITLE:=Tools for testing and debugging DNS issues
71 endef
72
73 define Package/djdbns/description
74         djbdns is a collection of Domain Name System tools.
75         It includes software for all the fundamental DNS operations: 
76         * DNS server: publishing addresses of Internet hosts.
77         * DNS cache: finding addresses of Internet hosts.
78         * DNS client: talking to a DNS cache.
79                 
80         Also included is a DNS client C library, several command-line
81         DNS client utilities, several DNS debugging tools.
82 endef
83
84 define Package/djbdns-base/description
85         The shared config file for the djbdns daemons.
86 endef
87
88 define Package/djbdns-dnscache/description
89         dnscache is a DNS cache.
90         It accepts recursive DNS queries from local clients such as web
91         browsers and mail transfer agents. It collects responses from
92         remote DNS servers. It caches the responses to save time later. 
93 endef
94
95 define Package/djbdns-tinydns/description
96         tinydns is a DNS server.
97         It accepts iterative DNS queries from hosts around the Internet
98         and responds with locally configured information. 
99 endef
100
101 define Package/djbdns-axfrdns/description
102         axfrdns is a DNS zone-transfer server.
103         It reads a zone-transfer request in DNS-over-TINSTALL_DATA format
104         from its standard input and responds with locally configured
105         information. 
106 endef
107
108 define Package/djbdns-rbldns/description
109         rbldns is an IP-address-listing DNS server.
110         It accepts iterative DNS queries from hosts around the Internet asking
111         about various IP addresses. It provides responses showing whether the
112         addresses are on a locally configured list, such as RBL or DUL. 
113 endef
114
115 define Package/djbdns-walldns/description
116         walldns is a reverse DNS wall.
117         It accepts iterative DNS queries for in-addr.arpa domains from hosts
118         around the Internet and supplies generic responses that avoid
119         revealing local host information. 
120 endef
121
122 define Package/djbdns-tools/description
123         Several command-line DNS client utilities and DNS debugging tools.
124 endef
125
126 define Build/Compile
127         TARGET_CC="$(TARGET_CC)" \
128         TARGET_CFLAGS="$(TARGET_CFLAGS)" \
129         TARGET_LDFLAGS="$(TARGET_LDFLAGS)" \
130         $(MAKE) -C $(PKG_BUILD_DIR)
131 endef
132
133 define Package/djbdns-base/install
134         $(INSTALL_DIR) $(1)/etc/config
135         $(INSTALL_DATA) ./files/djbdns.conf $(1)/etc/config/djbdns
136 endef
137
138 define Package/djbdns-dnscache/install
139         $(INSTALL_DIR) $(1)/usr/bin
140         (cd $(PKG_BUILD_DIR); \
141         $(INSTALL_BIN) dnscache pickdns pickdns-data \
142         $(1)/usr/bin)
143         $(INSTALL_DIR) $(1)/etc
144         $(CP) -r ./files/dnscache $(1)/etc/
145         $(INSTALL_DIR) $(1)/etc/init.d
146         $(INSTALL_BIN) ./files/dnscache.init $(1)/etc/init.d/dnscache
147 endef
148
149 define Package/djbdns-tinydns/install
150         $(INSTALL_DIR) $(1)/usr/bin
151         (cd $(PKG_BUILD_DIR); \
152         $(INSTALL_BIN) tinydns tinydns-data tinydns-edit tinydns-get \
153         $(1)/usr/bin)
154         $(INSTALL_DIR) $(1)/etc/init.d
155         $(INSTALL_BIN) ./files/tinydns.init $(1)/etc/init.d/tinydns
156         $(CP) -r ./files/tinydns $(1)/etc/
157 endef
158
159 define Package/djbdns-axfrdns/install
160         $(INSTALL_DIR) $(1)/usr/bin
161         (cd $(PKG_BUILD_DIR); \
162         $(INSTALL_BIN) axfrdns axfr-get \
163         $(1)/usr/bin)
164         $(INSTALL_DIR) $(1)/etc/init.d
165         $(INSTALL_BIN) ./files/axfrdns.init $(1)/etc/init.d/axfrdns
166         $(CP) -r ./files/axfrdns $(1)/etc/
167 endef
168
169 define Package/djbdns-rbldns/install
170         $(INSTALL_DIR) $(1)/usr/bin
171         (cd $(PKG_BUILD_DIR); \
172         $(INSTALL_BIN) rbldns rbldns-data \
173         $(1)/usr/bin)
174         $(INSTALL_DIR) $(1)/etc/init.d
175         $(INSTALL_BIN) ./files/rbldns.init $(1)/etc/init.d/rbldns
176         $(CP) -r ./files/rbldns $(1)/etc/
177 endef
178
179 define Package/djbdns-walldns/install
180         $(INSTALL_DIR) $(1)/usr/bin
181         (cd $(PKG_BUILD_DIR); \
182         $(INSTALL_BIN) walldns \
183         $(1)/usr/bin)
184         $(INSTALL_DIR) $(1)/etc/init.d
185         $(INSTALL_BIN) ./files/walldns.init $(1)/etc/init.d/walldns
186 endef
187
188 define Package/djbdns-tools/install
189         $(INSTALL_DIR) $(1)/usr/bin
190         (cd $(PKG_BUILD_DIR); \
191         $(INSTALL_BIN) dnsfilter dnsip dnsipq dnsmx dnsname dnsnamex dnsq \
192                        dnsqr dnstrace dnstracesort dnstxt random-ip \
193         $(1)/usr/bin)
194         $(INSTALL_BIN) ./files/dnsroots-update $(1)/usr/bin/
195         $(INSTALL_BIN) ./files/dnsqrx $(1)/usr/bin/
196 endef
197
198 $(eval $(call BuildPackage,djbdns-base))
199 $(eval $(call BuildPackage,djbdns-tinydns))
200 $(eval $(call BuildPackage,djbdns-dnscache))
201 $(eval $(call BuildPackage,djbdns-axfrdns))
202 $(eval $(call BuildPackage,djbdns-rbldns))
203 $(eval $(call BuildPackage,djbdns-walldns))
204 $(eval $(call BuildPackage,djbdns-tools))
205