grub: add download mirrors
[openwrt.git] / package / boot / grub2 / Makefile
1 #
2 # Copyright (C) 2006-2015 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 include $(INCLUDE_DIR)/kernel.mk
10
11 PKG_NAME:=grub
12 PKG_VERSION:=2.02~beta2
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
16 PKG_SOURCE_URL:=http://alpha.gnu.org/gnu/grub \
17         http://gnualpha.uib.no/grub/ \
18         http://mirrors.fe.up.pt/pub/gnu-alpha/grub/ \
19         http://www.nic.funet.fi/pub/gnu/alpha/gnu/grub/
20 PKG_MD5SUM:=be62932eade308a364ea4bbc91295930
21
22 HOST_BUILD_PARALLEL:=1
23 PKG_BUILD_DEPENDS:=grub2/host
24
25 include $(INCLUDE_DIR)/host-build.mk
26 include $(INCLUDE_DIR)/package.mk
27
28 define Package/grub2
29   SUBMENU:=Boot Loaders
30   CATEGORY:=Utilities
31   SECTION:=utils
32   TITLE:=GRand Unified Bootloader
33   URL:=http://www.gnu.org/software/grub/
34   DEPENDS:=@TARGET_x86||TARGET_x86_64
35 endef
36
37 define Package/grub2-editenv
38   CATEGORY:=Utilities
39   SECTION:=utils
40   TITLE:=Grub2 Environment editor
41   URL:=http://www.gnu.org/software/grub/
42   DEPENDS:=@TARGET_x86||TARGET_x86_64
43 endef
44
45 define Package/grub2-editenv/description
46         Edit grub2 environment files.
47 endef
48
49 CONFIGURE_ARGS += \
50         --target=$(REAL_GNU_TARGET_NAME) \
51         --disable-werror \
52         --disable-nls \
53         --disable-device-mapper \
54         --disable-libzfs \
55         --disable-grub-mkfont
56
57 HOST_CONFIGURE_ARGS += \
58         --target=$(REAL_GNU_TARGET_NAME) \
59         --sbindir="$(STAGING_DIR_HOST)/bin" \
60         --disable-werror \
61         --disable-libzfs \
62         --disable-nls
63
64 HOST_MAKE_FLAGS += \
65         TARGET_RANLIB=$(TARGET_RANLIB) \
66         LIBLZMA=$(STAGING_DIR_HOST)/lib/liblzma.a
67
68 define Host/Configure
69         $(SED) 's,(RANLIB),(TARGET_RANLIB),' $(HOST_BUILD_DIR)/grub-core/Makefile.in
70         $(Host/Configure/Default)
71 endef
72
73 define Package/grub2-editenv/install
74         $(INSTALL_DIR) $(1)/usr/sbin
75         $(INSTALL_BIN) $(PKG_BUILD_DIR)/grub-editenv $(1)/usr/sbin/
76 endef
77
78 $(eval $(call HostBuild))
79 $(eval $(call BuildPackage,grub2))
80 $(eval $(call BuildPackage,grub2-editenv))