Makefile cleanups, round 1
[packages.git] / ipv6 / radvd / 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 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=radvd
12 PKG_VERSION:=1.1
13 PKG_RELEASE:=1
14
15 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=http://v6web.litech.org/radvd/dist \
18                 http://download.sourcemage.org/mirror
19 PKG_MD5SUM:=9ee449e4b89171432cb9e9100e0b5648
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/radvd
24   SECTION:=ipv6
25   CATEGORY:=IPv6
26   TITLE:=IPv6 Routing Advertisement Daemon
27   URL:=http://v6web.litech.org/radvd/
28 endef
29
30 define Package/radvd/description
31 IPv6 Routing Advertisement Daemon.
32 endef
33
34 define Build/Configure
35         (cd $(PKG_BUILD_DIR); rm -f config.cache; \
36                 $(TARGET_CONFIGURE_OPTS) \
37                 CFLAGS="$(TARGET_CFLAGS)" \
38                 ./configure \
39                         --target=$(GNU_TARGET_NAME) \
40                         --host=$(GNU_TARGET_NAME) \
41                         --build=$(GNU_HOST_NAME) \
42                         --program-prefix="" \
43                         --program-suffix="" \
44                         --prefix=/usr \
45                         --exec-prefix=/usr \
46                         --bindir=/usr/bin \
47                         --datadir=/usr/share \
48                         --includedir=/usr/include \
49                         --infodir=/usr/share/info \
50                         --libdir=/usr/lib \
51                         --libexecdir=/usr/lib \
52                         --localstatedir=/var \
53                         --mandir=/usr/share/man \
54                         --sbindir=/usr/sbin \
55                         --sysconfdir=/etc \
56                         $(DISABLE_LARGEFILE) \
57                         $(DISABLE_NLS) \
58                         --with-configfile=/etc/radvd.conf \
59                         --with-logfile=/var/log/radvd.log \
60                         --with-pidfile=/var/run/radvd.pid \
61         );
62 endef
63
64 define Build/Compile
65         rm -rf $(PKG_INSTALL_DIR)
66         mkdir -p $(PKG_INSTALL_DIR)
67         $(MAKE) -C $(PKG_BUILD_DIR) \
68                 radvd_LDADD=""
69         $(MAKE) -C $(PKG_BUILD_DIR) \
70                 DESTDIR="$(PKG_INSTALL_DIR)" \
71                 install
72 endef
73
74 define Package/radvd/install
75         $(INSTALL_DIR) $(1)/etc/config
76         $(INSTALL_DATA) ./files/radvd.config $(1)/etc/config/radvd
77         $(INSTALL_DIR) $(1)/etc/init.d
78         $(INSTALL_BIN) ./files/radvd.init $(1)/etc/init.d/radvd
79         $(INSTALL_DIR) $(1)/usr/sbin
80         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/radvd $(1)/usr/sbin/
81         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/radvdump $(1)/usr/sbin/
82 endef
83
84 $(eval $(call BuildPackage,radvd))