pgreco / rpms / kernel

Forked from rpms/kernel 4 years ago
Clone
6c3baf
RPMBUILD := $(shell if [ -x "/usr/bin/rpmbuild" ]; then echo rpmbuild; \
6c3baf
                   else echo rpm; fi)
6c3baf
REDHAT:=$(shell pwd)
6c3baf
TOPDIR:=$(shell dirname $(REDHAT))
6c3baf
MACH :=  $(shell uname -m)
6c3baf
KVERSION:=3.10.0
6c3baf
GITID:= $(shell git log --max-count=1 --pretty=format:%H)
6c3baf
RPMVERSION:=3.10.0
6c3baf
# marker is git tag which we base off of for exporting patches
6c3baf
MARKER:=v3.10
6c3baf
PREBUILD:=
6c3baf
BUILD:=1101
6c3baf
DIST:=.el7
6c3baf
SPECFILE:=kernel.spec
6c3baf
RPM:=$(REDHAT)/rpm
6c3baf
SRPMS:=$(RPM)/SRPMS
6c3baf
SOURCES:=$(RPM)/SOURCES
6c3baf
TESTPATCH:=$(REDHAT)/linux-kernel-test.patch
6c3baf
FILTERDIFF:=/usr/bin/filterdiff -x '*redhat/*' -x '*/.gitignore' -x '*/makefile' -x '*/Makefile'
6c3baf
6c3baf
# RELEASED_KERNEL: swaps between the pre-release secureboot keys and
6c3baf
# 		   the release one, for vmlinux signing.
6c3baf
#
6c3baf
#	0 : pre-release (devel) secureboot keys are used for signing
6c3baf
#	1 : release (RC/GA) secureboot keys are used for signing
6c3baf
#
6c3baf
RELEASED_KERNEL:=0
6c3baf
6c3baf
STAMP_VERSION:=$(KVERSION)
6c3baf
6c3baf
LOCVERFILE:=../localversion
6c3baf
# create an empty localversion file if you don't want a local buildid
6c3baf
ifneq ($(wildcard $(LOCVERFILE)),)
6c3baf
  BUILDID:=$(shell cat $(LOCVERFILE))
6c3baf
else
6c3baf
  BUILDID:=.test
6c3baf
endif
6c3baf
$(info BUILDID is "$(BUILDID)". Update '$(shell dirname $(REDHAT))/localversion' to change.)
6c3baf
6c3baf
PKGRELEASE:=$(PREBUILD)$(BUILD)$(DIST)$(BUILDID)
6c3baf
SPECRELEASE:=$(PREBUILD)$(BUILD)%{?dist}$(BUILDID)
6c3baf
6c3baf
TARFILE:=linux-$(KVERSION)-$(PKGRELEASE).tar.xz
6c3baf
TARBALL:=$(REDHAT)/$(TARFILE)
6c3baf
DISTRO_BUILD:=$(shell echo $(BUILD) | sed -e 's|\(^[0-9]\{1,4\}\)\..*|\1|')
6c3baf
KABI_TARFILE:=kernel-abi-whitelists-$(DISTRO_BUILD).tar.bz2
6c3baf
KABI_TARBALL:=$(REDHAT)/rpm/SOURCES/$(KABI_TARFILE)
6c3baf
KABIDW_TARFILE:=kernel-kabi-dw-$(DISTRO_BUILD).tar.bz2
6c3baf
KABIDW_TARBALL:=$(REDHAT)/rpm/SOURCES/$(KABIDW_TARFILE)
6c3baf
6c3baf
RHELMAJOR:=$(shell git show HEAD:Makefile | grep ^RHEL_MAJOR | sed -e s/RHEL_MAJOR\ =\ //)
6c3baf
RHELMINOR:=$(shell git show HEAD:Makefile | grep ^RHEL_MINOR | sed -e s/RHEL_MINOR\ =\ //)