final download = makeDownloadTask( url: "https://download.jetbrains.com/idea/ideaIU-${project.version}.tar.gz", sha256: sha256sum) task untar(type: Copy) { from tarTree(download.dest) into file("${buildDir}/unpacked/dist") eachFile { FileCopyDetails fcd -> fcd.path = fcd.path.substring(path.indexOf('/')+1) } } untar.dependsOn(download) ospackage { into "/opt/${project.name}" from untar.outputs.files } activator.bin['idea'] = "/opt/${project.name}/bin/idea.sh"