##################### GENERAL ##################### 
GARNAME = zfs-module-$(VERSION_MD5)
GARVERSION = 0.8.5
GARELEASE = 1
HOME_URL = https://zfsonlinux.org
CATEGORIES = asic
MASTER_SITES += https://github.com/zfsonlinux/zfs/releases/download/zfs-$(GARVERSION)/
MASTER_SITES += https://cdn.kernel.org/pub/linux/kernel/v4.x/
DISTFILES += zfs-$(GARVERSION).tar.gz
DISTFILES += linux-$(KERNEL_VERSION).tar.xz
PATCHFILES = 
MAINTAINER = Felipe Sanchez <izto@asic-linux.com.mx>
LICENSE = 1ffb70c33c4f79f04e947facc5c7851f289609256aacb47fc115f700427d9520

DESCRIPTION = ZFS $(GARVERSION) kernel module for linux-$(KERNEL_VERSION)$(KERNEL_LOCALVERSION)-$(GARCH)
define BLURB
endef

##################### PACKAGING #####################

# This is to be appended to the package's installation script
# Use it to set file owners, permissions, DB initialization, etc.
# Remember any shell variables (Such as $ROOT) have to be escaped
# like this: \$$ROOT

define DOINST_APPEND
/sbin/depmod -b /\$$ROOT -a $(KERNEL_VERSION)$(KERNEL_LOCALVERSION)
endef

# Required dependencies
define SLACK_REQUIRED
zfs-utils
endef

# Suggested dependencies
define SLACK_SUGGESTS
endef

# Package conflicts (lprng vs cups for example)
define SLACK_CONFLICTS
endef

##################### BUILDING #####################


CONFIGURE_SCRIPTS = $(WORKSRC)/configure
BUILD_SCRIPTS     = $(WORKSRC)/Makefile
INSTALL_SCRIPTS   = $(WORKSRC)/Makefile

CONFIGURE_ARGS = $(DIRPATHS)
NODIRPATHS = 

# Directories to be created as part of the install process.
# Can be inside the final package or just transient dirs we need
# while building it.
INSTALL_DIRS = 

# If some dirs are trying to install into /, list their names
# here, such as: prefix bindir mandir
INSTALL_OVERRIDE_DIRS = 


# Dependencies are of the form categorydir/packagedir
# LIBDEPS are for libraries, and DEPENDS are for everything else
DEPENDS =
LIBDEPS =
DEPENDS =
BUILDDEPS =


##################### GAR #####################

# This should go before any hand-made rules.
include config.mk
include ../level.mk

# Include the izmod GAR library
include /usr/lib/izmod/izmod-gar.lib.mk

##################### CUSTOM RULES #####################


test:
	@echo
	@echo -e "$(WARNCOLOR)No tests are enabled for this package$(NORMALCOLOR)"
	@echo
	$(MAKECOOKIE)

post-install:
	rm -r $(DESTDIR)/usr
	$(MAKE) gzip-man
	$(MAKECOOKIE)
