plugins { id "java" id "nebula.ospackage" version "9.1.1" } version = '1.0' repositories { mavenCentral() } dependencies { implementation project(':HIRS_Utils') implementation libs.jcommander implementation libs.commons.io } ext.configDir = new File(projectDir, 'config') ext.checkstyleConfigDir = "$configDir/checkstyle" ext.findbugsConfigDir = "$configDir/findbugs" jar { // Keep jar clean: exclude 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA', 'META-INF/*.MF' manifest { attributes( 'Main-Class': 'hirs.tcg_eventlog.Main', 'Class-Path': configurations.runtimeClasspath.files.collect { it.getName() }.join(' ') ) } } // Produce packages ospackage { def gitCommitHash = 'git rev-parse --verify --short HEAD'.execute().text.trim() packageName = 'tcg_eventlog_tool' os = LINUX arch = X86_64 version = '2.1.0' release = gitCommitHash into '/opt/hirs/eventlog' user 'root' fileMode = 0755 from(jar.outputs.files) { into 'lib' } from('lib') { into 'lib' } from(configurations.runtimeClasspath) { into 'lib' } from('scripts') { exclude { FileTreeElement details -> details.file.name.endsWith('.bat') } into 'scripts' } from('docs') { exclude { FileTreeElement details -> details.file.name.endsWith('.odt') } into 'docs' } from('./') { include { FileTreeElement details -> details.file.name.endsWith('.md') } into './' link("/usr/bin/elt", "/opt/hirs/eventlog/scripts/eventlog.sh", 0x755) } into('/tmp/') { fileMode 0664 from ('../../HIRS_Utils/src/main/resources/vendor-table.json') { addParentDirs true createDirectoryEntry true } } postInstall file('scripts/vendor-table.sh') buildRpm { arch = X86_64 } buildDeb { arch = X86_64 } }