forked from TheHive-Project/TheHive
-
Notifications
You must be signed in to change notification settings - Fork 1
/
rpm.sbt
32 lines (27 loc) · 1.19 KB
/
rpm.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import Common._
version in Rpm := getVersion(version.value)
rpmRelease := getRelease(version.value)
rpmVendor := organizationName.value
rpmUrl := organizationHomepage.value.map(_.toString)
rpmLicense := Some("AGPL")
rpmRequirements += "java-1.8.0-openjdk-headless"
maintainerScripts in Rpm := maintainerScriptsFromDirectory(
baseDirectory.value / "package" / "rpm",
Seq(RpmConstants.Pre, RpmConstants.Preun, RpmConstants.Postun)
)
linuxPackageSymlinks in Rpm := Nil
rpmPrefix := Some(defaultLinuxInstallLocation.value)
linuxEtcDefaultTemplate in Rpm := (baseDirectory.value / "package" / "etc_default_thehive").asURL
linuxPackageMappings in Rpm := configWithNoReplace((linuxPackageMappings in Rpm).value)
packageBin in Rpm := {
import scala.sys.process._
val rpmFile = (packageBin in Rpm).value
Process("rpm" ::
"--define" :: "_gpg_name TheHive Project" ::
"--define" :: "_signature gpg" ::
"--define" :: "__gpg_check_password_cmd /bin/true" ::
"--define" :: "__gpg_sign_cmd %{__gpg} gpg --batch --no-verbose --no-armor --use-agent --no-secmem-warning -u \"%{_gpg_name}\" -sbo %{__signature_filename} %{__plaintext_filename}" ::
"--addsign" :: rpmFile.toString ::
Nil).!!
rpmFile
}