mirror of
https://github.com/nsacyber/HIRS.git
synced 2025-01-02 19:26:50 +00:00
added deb and rpm packaging for tcg_rim_tool [no ci]
This commit is contained in:
parent
258ce69a81
commit
8848642ec6
@ -3,8 +3,10 @@ plugins {
|
||||
id 'java'
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
options.release = 11
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion = JavaLanguageVersion.of(11)
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
|
@ -6,6 +6,11 @@ repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion = JavaLanguageVersion.of(11)
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation libs.commons.lang
|
||||
|
@ -5,8 +5,10 @@ plugins {
|
||||
|
||||
ext.configDir = new File(projectDir, 'config')
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
options.release = 11
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion = JavaLanguageVersion.of(11)
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
|
32
build.gradle
32
build.gradle
@ -1,8 +1,11 @@
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
plugins {
|
||||
// Apply the application plugin to add support for building a CLI application in Java.
|
||||
id 'application'
|
||||
}
|
||||
|
||||
|
||||
// Global checkstyle file
|
||||
ext.checkstyleConfigFile = new File(rootDir, "/config/checkstyle/sun_checks.xml")
|
||||
|
||||
@ -11,18 +14,23 @@ dependencies {
|
||||
// Use Maven Central for resolving dependencies.
|
||||
mavenCentral()
|
||||
}
|
||||
// implementation project(':HIRS_Utils')
|
||||
// implementation project(':HIRS_Structs')
|
||||
}
|
||||
|
||||
tasks.register('copyVersion') {
|
||||
doLast {
|
||||
if (project.hasProperty('displayVersion')) {
|
||||
String resourceDir="${buildDir}/resources/main"
|
||||
println "setting app version file contents of: ${displayVersion} to ${resourceDir}"
|
||||
new File(resourceDir, "VERSION").write("$displayVersion")
|
||||
}
|
||||
}
|
||||
}
|
||||
def projectVersion = rootProject.file('VERSION').text.trim()
|
||||
|
||||
version = file("$rootDir/VERSION").text.trim() + "-SNAPSHOT"
|
||||
def buildTime = { ->
|
||||
Date latestdate = new Date();
|
||||
def time = latestdate.getTime();
|
||||
long seconds = TimeUnit.MILLISECONDS.toSeconds(time);
|
||||
return seconds;
|
||||
}
|
||||
|
||||
def gitHash = { ->
|
||||
def gitProcess = 'git rev-parse --short HEAD'.execute();
|
||||
gitProcess.waitFor();
|
||||
def shortHash = gitProcess.text.trim();
|
||||
def gitHash = shortHash.substring(0, shortHash.length() - 2);
|
||||
return gitHash;
|
||||
}
|
||||
|
||||
project.ext["packageVersion"] = "${projectVersion}.${buildTime}.${gitHash}.el8"
|
||||
|
@ -5,6 +5,8 @@ include ':TPM_Utils'
|
||||
include ':HIRS_AttestationCA'
|
||||
include ':HIRS_AttestationCAPortal'
|
||||
include ':tools:tcg_eventlog_tool'
|
||||
include ':tools:tcg_rim_tool'
|
||||
|
||||
|
||||
dependencyResolutionManagement {
|
||||
versionCatalogs {
|
||||
@ -38,6 +40,9 @@ dependencyResolutionManagement {
|
||||
library('jadira_usertype', 'org.jadira.usertype:usertype.core:6.0.1.GA')
|
||||
library('javax_annotation', 'javax.annotation:javax.annotation-api:1.3')
|
||||
library('javax_jaxb', 'javax.xml.bind:jaxb-api:2.3.0')
|
||||
library('javax_json', 'javax.json:javax.json-api:1.1.4')
|
||||
library('glassfish_json', 'org.glassfish:javax.json:1.1.4')
|
||||
library('glassfish_jaxb_runtime', 'org.glassfish.jaxb:jaxb-runtime:2.3.1')
|
||||
library('javax_validation', 'javax.validation:validation-api:2.0.1.Final')
|
||||
library('jboss_logging', 'org.jboss.logging:jboss-logging:3.2.0.Final')
|
||||
library('jcommander', 'com.beust:jcommander:1.82')
|
||||
|
@ -1,8 +1,15 @@
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
plugins {
|
||||
id "java"
|
||||
id "nebula.ospackage" version "9.1.1"
|
||||
}
|
||||
version = '1.0'
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion = JavaLanguageVersion.of(11)
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@ -30,12 +37,16 @@ jar {
|
||||
}
|
||||
}
|
||||
|
||||
// Get version from main project gradle
|
||||
def packVersion = properties.get("packageVersion");
|
||||
//println "packageVersion is ${projVersion}"
|
||||
|
||||
// Produce packages
|
||||
ospackage {
|
||||
packageName = 'tcg_eventlog_tool'
|
||||
os = LINUX
|
||||
arch = NOARCH
|
||||
version = '2.1.0'
|
||||
version = "$packVersion"
|
||||
release = '1'
|
||||
|
||||
into '/opt/hirs/eventlog'
|
||||
|
Binary file not shown.
Binary file not shown.
@ -1,6 +1,5 @@
|
||||
#Thu Sep 13 15:33:27 EDT 2018
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=gradle-4.5.1-all.zip
|
||||
|
@ -4,5 +4,5 @@
|
||||
scriptDir=$(dirname -- "$(readlink -f -- "${BASH_SOURCE[0]}")")
|
||||
baseDir=${scriptDir%/*}
|
||||
libDir=$baseDir"/lib/"
|
||||
jar="tcg_eventlog_tool-1.0.jar";
|
||||
java -jar $libDir$jar "$@"
|
||||
jar="tcg_eventlog_tool.jar";
|
||||
java -cp $libDir$jar:$libsDir* hirs.tcg_eventlog.Main "$@"
|
||||
|
@ -1,28 +1,91 @@
|
||||
apply plugin: 'java'
|
||||
plugins {
|
||||
id "java"
|
||||
id "nebula.ospackage" version "9.1.1"
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion = JavaLanguageVersion.of(11)
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile 'javax.json:javax.json-api:1.1.4', 'org.glassfish:javax.json:1.1.4', 'com.beust:jcommander:1.72', 'org.bouncycastle:bcmail-jdk15on:1.59'
|
||||
testCompile 'org.testng:testng:6.8.8'
|
||||
implementation libs.bouncy.castle
|
||||
implementation libs.glassfish.json
|
||||
implementation libs.glassfish.jaxb.runtime
|
||||
implementation libs.jcommander
|
||||
implementation libs.javax.json
|
||||
implementation libs.javax.jaxb
|
||||
implementation libs.javax.annotation
|
||||
|
||||
testImplementation libs.testng
|
||||
}
|
||||
|
||||
jar {
|
||||
manifest {
|
||||
attributes("Main-Class": "hirs.swid.Main",
|
||||
"Class-Path": configurations.runtime.files.collect { "lib/$it.name" }.join(' ')
|
||||
)
|
||||
}
|
||||
from(configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }) {}
|
||||
exclude 'META-INF/*.RSA', 'META-INF/*.SF', 'META-INF/*.DSA'
|
||||
// Keep jar clean:
|
||||
exclude 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA', 'META-INF/*.MF'
|
||||
|
||||
manifest {
|
||||
attributes(
|
||||
'Main-Class': 'hirs.swid.Main',
|
||||
'Class-Path': configurations.runtimeClasspath.files.collect { it.getName() }.join(' ')
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
uploadArchives {
|
||||
repositories {
|
||||
flatDir {
|
||||
dirs "${buildDir}"
|
||||
}
|
||||
}
|
||||
// Get version from main project gradle
|
||||
def packVersion = properties.get("packageVersion");
|
||||
println "packageVersion is ${packVersion}"
|
||||
|
||||
ospackage {
|
||||
packageName = 'tcg-rim-tool'
|
||||
os = LINUX
|
||||
arch = NOARCH
|
||||
version = "$packVersion"
|
||||
release = '1'
|
||||
|
||||
into '/opt/hirs/rimtool'
|
||||
user 'root'
|
||||
fileMode = 0755
|
||||
|
||||
from(jar.outputs.files) {
|
||||
into 'lib'
|
||||
}
|
||||
|
||||
from('libs') {
|
||||
into 'lib'
|
||||
}
|
||||
|
||||
from(configurations.runtimeClasspath) {
|
||||
into 'lib'
|
||||
}
|
||||
|
||||
from('scripts') {
|
||||
exclude {
|
||||
FileTreeElement details ->
|
||||
details.file.name.endsWith('.bat')
|
||||
}
|
||||
into 'scripts'
|
||||
}
|
||||
|
||||
from('data') {
|
||||
exclude {
|
||||
FileTreeElement details ->
|
||||
details.file.name.endsWith('.md')
|
||||
}
|
||||
into './'
|
||||
link("/usr/local/bin/rim", "/opt/hirs/rimtool/scripts/rimtool.sh", 0x755)
|
||||
}
|
||||
}
|
||||
|
||||
buildRpm {
|
||||
arch = I386
|
||||
}
|
||||
|
||||
buildDeb {
|
||||
arch = I386
|
||||
}
|
||||
|
BIN
tools/tcg_rim_tool/data/binary_bios_measurements
Normal file
BIN
tools/tcg_rim_tool/data/binary_bios_measurements
Normal file
Binary file not shown.
Binary file not shown.
BIN
tools/tcg_rim_tool/gradle/wrapper/gradle-wrapper.jar
vendored
BIN
tools/tcg_rim_tool/gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
@ -1,6 +1,5 @@
|
||||
#Thu Sep 13 15:33:27 EDT 2018
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=gradle-4.5.1-all.zip
|
||||
|
@ -1,20 +0,0 @@
|
||||
#!/bin/bash
|
||||
VERSION=2.1.0
|
||||
GIT_HASH=`git rev-parse HEAD | head -c6`
|
||||
GIT_COMMIT_UNIX_TIMESTAMP=`git show -s --format=%ct | xargs echo -n`
|
||||
RELEASE="$((GIT_COMMIT_UNIX_TIMESTAMP)).$GIT_HASH"
|
||||
name="tcg_rim_tool"
|
||||
|
||||
# Enter package directory
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
pushd $SCRIPT_DIR
|
||||
|
||||
tar -cf "$name-$VERSION.$RELEASE".tar build.gradle gradle* src/ docs/ rim_fields.json keystore.jks scripts/
|
||||
gzip -f "$name-$VERSION.$RELEASE".tar
|
||||
if [ -d rpmbuild ]; then
|
||||
rm -rf rpmbuild
|
||||
fi
|
||||
mkdir -p rpmbuild/BUILD rpmbuild/BUILDROOT rpmbuild/SOURCES rpmbuild/RPMS rpmbuild/SPECS rpmbuild/SRPMS
|
||||
rpmbuild -bb $name.spec --define "_sourcedir $PWD" --define "_topdir $PWD/rpmbuild" --define 'RELEASE '$RELEASE --define 'VERSION '$VERSION
|
||||
|
||||
popd
|
@ -3,6 +3,6 @@
|
||||
# Calls the the_tcg_rim_tool and passes in parameters
|
||||
scriptDir=$(dirname -- "$(readlink -f -- "${BASH_SOURCE[0]}")")
|
||||
baseDir=${scriptDir%/*}
|
||||
jar="tcg_rim_tool-2.1.0.jar";
|
||||
java -jar $baseDir/$jar "$@"
|
||||
jar="tcg_rim_tool.jar";
|
||||
java -cp $baseDir/lib/$jar:$baseDir/lib/* hirs.swid.Main "$@"
|
||||
|
||||
|
@ -1,49 +0,0 @@
|
||||
Name: tcg_rim_tool
|
||||
Version: %{?VERSION}
|
||||
Release: %{?RELEASE}
|
||||
Summary: A java command-line tool to create PC client root RIM
|
||||
|
||||
License: ASL 2.0
|
||||
URL: https://github.com/nsacyber/HIRS
|
||||
Source0: %{name}-%{version}.%{release}.tar.gz
|
||||
|
||||
BuildRequires: java-headless >= 1:1.8.0
|
||||
|
||||
%description
|
||||
This tool will generate a base RIM file for PC clients in accordance with the schema located at http://standards.iso.org/iso/19770/-2/2015/schema.xsd. The generated RIM can either be empty if no arguments are given, or contain a payload if an input file is provided. The tool can also verify a given RIMfile against the schema. Use -h or --help to see a list of commands and uses.
|
||||
|
||||
%global __os_install_post %{nil}
|
||||
|
||||
%prep
|
||||
%setup -q -c -n %{name}
|
||||
|
||||
%pre
|
||||
rm -f /opt/hirs/rimtool/%{name}*.jar
|
||||
|
||||
%build
|
||||
./gradlew -Pversion=%{version} build
|
||||
|
||||
%install
|
||||
mkdir -p %{buildroot}/opt/hirs/rimtool/ %{buildroot}/usr/local/bin
|
||||
cp build/libs/%{name}-%{version}.jar %{buildroot}/opt/hirs/rimtool/
|
||||
cp ./rim_fields.json %{buildroot}/opt/hirs/rimtool/
|
||||
cp ./keystore.jks %{buildroot}/opt/hirs/rimtool/
|
||||
cp -r ./scripts/ %{buildroot}/opt/hirs/rimtool/
|
||||
ln -sf /opt/hirs/rimtool/scripts/rimtool.sh %{buildroot}/usr/local/bin/rim
|
||||
|
||||
%files
|
||||
/opt/hirs/rimtool/%{name}-%{version}.jar
|
||||
/opt/hirs/rimtool/rim_fields.json
|
||||
/opt/hirs/rimtool/keystore.jks
|
||||
/opt/hirs/rimtool/scripts
|
||||
/usr/local/bin/rim
|
||||
|
||||
%attr(755, root, root) /opt/hirs/rimtool/scripts/rimtool.sh
|
||||
|
||||
%changelog
|
||||
* Tue Nov 10 2020 chubtub
|
||||
- Second release
|
||||
* Mon Jun 15 2020 chubtub
|
||||
- First release
|
||||
* Mon Jan 6 2020 chubtub
|
||||
- First change
|
Loading…
Reference in New Issue
Block a user