Add more license tags with SPDX identifiers
[openwrt.git] / package / boot / kexec-tools / Makefile
1 #
2 # Copyright (C) 2006-2012 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:=kexec-tools
11 PKG_VERSION:=2.0.4
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=@KERNEL/linux/utils/kernel/kexec
16 PKG_MD5SUM:=05992bc8c0673fc55be7b6d27e48a8db
17
18 PKG_LICENSE:=GPL-2.0
19 PKG_LICENSE_FILES:=COPYING
20
21 PKG_FIXUP:=autoreconf
22
23 PKG_CONFIG_DEPENDS := CONFIG_KEXEC_ZLIB
24
25 include $(INCLUDE_DIR)/package.mk
26
27 define Package/kexec-tools
28   SECTION:=utils
29   CATEGORY:=Utilities
30   DEPENDS:=@armeb||@arm||@i386||@powerpc64||@mipsel||@mips +KEXEC_ZLIB:zlib
31   TITLE:=Kernel boots kernel
32   URL:=http://kernel.org/pub/linux/kernel/people/horms/kexec-tools/
33   MAINTAINER:=Florian Fainelli <florian@openwrt.org>
34   MENU:=1
35 endef
36
37 define Package/kexec-tools/description
38  kexec is a set of systems call that allows you to load
39  another kernel from the currently executing Linux kernel.
40 endef
41
42 define Package/kexec-tools/config
43         source "$(SOURCE)/Config.in"
44 endef
45
46 KEXEC_TARGET_NAME:=$(call qstrip,$(CONFIG_KEXEC_TOOLS_TARGET_NAME))-linux-$(TARGET_SUFFIX)
47
48 CONFIGURE_ARGS = \
49                 --target=$(KEXEC_TARGET_NAME) \
50                 --host=$(REAL_GNU_TARGET_NAME) \
51                 --build=$(GNU_HOST_NAME) \
52                 --program-prefix="" \
53                 --program-suffix="" \
54                 --prefix=/usr \
55                 --exec-prefix=/usr \
56                 --bindir=/usr/bin \
57                 --sbindir=/usr/sbin \
58                 --libexecdir=/usr/lib \
59                 --sysconfdir=/etc \
60                 $(if $(CONFIG_KEXEC_ZLIB),--with,--without)-zlib \
61                 --without-lzma
62
63 TARGET_CFLAGS += -ffunction-sections -fdata-sections
64 TARGET_LDFLAGS += -Wl,--gc-sections
65
66 CONFIGURE_VARS += \
67         BUILD_CC="$(HOSTCC)" \
68         TARGET_CC="$(TARGET_CC)"
69
70 kexec-extra-sbin-$(CONFIG_KEXEC_TOOLS_kdump) += kdump
71
72 define Build/Compile
73         $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" all install
74 endef
75
76 define Package/kexec-tools/install
77         $(INSTALL_DIR) $(1)/usr/sbin
78         $(INSTALL_BIN) \
79                 $(addprefix $(PKG_INSTALL_DIR)/usr/sbin/, \
80                         $(kexec-extra-sbin-y)) \
81                 $(kexec-extra-bin-y) \
82                 $(PKG_INSTALL_DIR)/usr/sbin/kexec \
83                 $(1)/usr/sbin
84
85 # make a link for compatability with other distros
86         $(INSTALL_DIR) $(1)/sbin
87         ln -s /usr/sbin/kexec $(1)/sbin/kexec
88 endef
89
90 $(eval $(call BuildPackage,kexec-tools))