Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes issue #789 where brpJavaRepack was negated #932

Merged
merged 7 commits into from
Jan 25, 2017
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
%define __os_install_post \
%{_rpmconfigdir}/brp-compress \
%{!?__debug_package:%{_rpmconfigdir}/brp-strip %{__strip}} \
%{_rpmconfigdir}/brp-strip-static-archive %{__strip} \
%{_rpmconfigdir}/brp-strip-comment-note %{__strip} %{__objdump} \
%{nil}
%define __jar_repack %nil
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ object RpmPlugin extends AutoPlugin {
(rpmProvides, rpmRequirements, rpmPrerequisites, rpmObsoletes, rpmConflicts) apply RpmDependencies,
maintainerScripts in Rpm := {
val scripts = (maintainerScripts in Rpm).value
if (rpmBrpJavaRepackJars.value) {
if (!rpmBrpJavaRepackJars.value) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. This is the actual bug fix. Thanks :)

val pre = scripts.getOrElse(Names.Pre, Nil)
val scriptBits = IO.readStream(RpmPlugin.osPostInstallMacro.openStream, Charset forName "UTF-8")
scripts + (Names.Pre -> (pre :+ scriptBits))
Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/rpm/changelog-test/test
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ $ exists target/rpm/SPECS/rpm-test.spec

# Check files for defaults
> check-spec-file
> set NativePackagerKeys.rpmBrpJavaRepackJars := true
> set NativePackagerKeys.rpmBrpJavaRepackJars := false
> check-spec-file
35 changes: 35 additions & 0 deletions src/sbt-test/rpm/scriplets-no-javarepack-rpm/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

enablePlugins(JavaServerAppPackaging)

name := "rpm-test"

version := "0.1.0"

maintainer := "Josh Suereth <[email protected]>"

packageSummary := "Test rpm package"

packageDescription :=
"""A fun package description of our software,
with multiple lines."""

rpmRelease := "1"

rpmVendor := "typesafe"

rpmUrl := Some("http://github.com/sbt/sbt-native-packager")

rpmLicense := Some("BSD")

rpmBrpJavaRepackJars := false

TaskKey[Unit]("check-spec-file") <<= (target, streams) map { (target, out) =>
val spec = IO.read(target / "rpm" / "SPECS" / "rpm-test.spec")
out.log.info(spec)
assert(
spec contains
"""%define __jar_repack %nil""",
"Missing java repack disabling in %pre")
out.log.success("Successfully tested rpm test file")
()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % sys.props("project.version"))
6 changes: 6 additions & 0 deletions src/sbt-test/rpm/scriplets-no-javarepack-rpm/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Run the debian packaging.
> rpm:package-bin
$ exists target/rpm/RPMS/noarch/rpm-test-0.1.0-1.noarch.rpm
$ exists target/rpm/SPECS/rpm-test.spec

> check-spec-file
2 changes: 1 addition & 1 deletion src/sbt-test/rpm/scriptlets-override-build-rpm/test
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ $ exists target/rpm/SPECS/rpm-test.spec

# Check files for defaults
> check-spec-file
> set NativePackagerKeys.rpmBrpJavaRepackJars := true
> set NativePackagerKeys.rpmBrpJavaRepackJars := false
> check-spec-file
2 changes: 1 addition & 1 deletion src/sbt-test/rpm/scriptlets-override-rpm/test
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ $ exists var/run/rpm-test
# TODO symlinks aren't checked

> check-spec-file
> set NativePackagerKeys.rpmBrpJavaRepackJars := true
> set NativePackagerKeys.rpmBrpJavaRepackJars := false
> check-spec-file

> unique-scripts-in-spec-file
2 changes: 1 addition & 1 deletion src/sbt-test/rpm/scriptlets-rpm/test
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ $ exists target/rpm/SPECS/rpm-test.spec
# Check files for defaults
> check-spec-file
> check-rpm-version
> set NativePackagerKeys.rpmBrpJavaRepackJars := true
> set NativePackagerKeys.rpmBrpJavaRepackJars := false
> check-spec-file
2 changes: 1 addition & 1 deletion src/sbt-test/rpm/sysvinit-rpm/test
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ $ exists var/run/rpm-test

# TODO symlinks aren't checked

> set NativePackagerKeys.rpmBrpJavaRepackJars := true
> set NativePackagerKeys.rpmBrpJavaRepackJars := false
> check-spec-file
> check-spec-autostart

Expand Down