Customize Gradle distribution plugin to generate tar.gz

i have to create tar.gz , below is my distribution setting in build.gradle

distributions {
main {
contents {
into ("/")
from libsDir
include ‘.jar’
rename '.
.jar’, “${project.name}.jar”
from “env”
include ‘*.conf’
}
}
}

Please suggest what changes i need to make to build.gradle in order to generate tar.gz file