# This file is an EasyBuild reciPY as per https://github.com/hpcugent/easybuild
# Author: Pablo Escobar Lopez
# Swiss Institute of Bioinformatics
# Biozentrum - University of Basel

easyblock = 'MakeCp'

name = 'pigz'
version = '2.3.3'

homepage = 'http://zlib.net/pigz/'
description = """ pigz, which stands for parallel implementation of gzip, is a fully 
 functional replacement for gzip that exploits multiple processors and multiple cores 
 to the hilt when compressing data. pigz was written by Mark Adler, and uses the zlib 
 and pthread libraries. """

toolchain = {'name': 'foss', 'version': '2016b'}

source_urls = ['https://github.com/madler/pigz/archive/']
sources = ['v%(version)s.tar.gz']
checksums = ['fb80e8d31498226c99fe8c8b3d19364d']

# Patch Makefile so zlib provided by EasyBuild is picked up
patches = ['pigz-2.3.3_Makefile.patch']

# README recommends zlib 1.2.6 or higher
dependencies = [('zlib', '1.2.8')]

buildopts = ' CC=$CC'

parallel = 1

files_to_copy = [(["pigz", "unpigz"], "bin")]

sanity_check_paths = {
    'files': ["bin/pigz", "bin/unpigz"],
    'dirs': [""],
}

moduleclass = 'tools'
