[sbt/f20] candidate fix for 1072096

William Benton willb at fedoraproject.org
Tue Mar 4 23:11:23 UTC 2014


commit 8122d46b0f669543df09d9d70f7d1e5a3b38d1e7
Author: William Benton <willb at redhat.com>
Date:   Tue Mar 4 17:11:04 2014 -0600

    candidate fix for 1072096

 rpmbuild-sbt.boot.properties |   25 +++++++++++++++++++++++++
 sbt                          |    8 +++++++-
 sbt.boot.properties          |   17 +++++++++--------
 sbt.spec                     |   28 ++++++++++++++++++++--------
 4 files changed, 61 insertions(+), 17 deletions(-)
---
diff --git a/rpmbuild-sbt.boot.properties b/rpmbuild-sbt.boot.properties
new file mode 100644
index 0000000..67501fb
--- /dev/null
+++ b/rpmbuild-sbt.boot.properties
@@ -0,0 +1,25 @@
+[scala]
+  version: FEDORA_SCALA_VERSION
+
+[app]
+  org: ${sbt.organization-org.scala-sbt}
+  name: sbt
+  version: ${sbt.version-read(sbt.version)[FEDORA_SBT_VERSION]}
+  class: ${sbt.main.class-sbt.xMain}
+  components: xsbti,extra
+  cross-versioned: ${sbt.cross.versioned-false}
+
+[repositories]
+  local: file:${fedora.sbt.ivy.dir-/usr/share/sbt/ivy-local}, [organization]/[module]/[revision]/ivy.xml, [organization]/[module]/[revision]/[artifact]-[revision].[ext]
+
+[boot]
+ directory: ${fedora.sbt.boot.dir-/usr/share/sbt/boot}
+
+[log]
+  level: debug
+
+[ivy]
+  ivy-home: ${fedora.sbt.ivy.dir-/usr/share/sbt/ivy-local}
+  checksums: ${sbt.checksums-sha1,md5}
+  override-build-repos: true
+
diff --git a/sbt b/sbt
index a5b761e..7c8a085 100755
--- a/sbt
+++ b/sbt
@@ -8,7 +8,13 @@ fi
 
 export SBT_BOOT_DIR=${SBT_BOOT_DIR:-/usr/share/sbt/boot}
 export SBT_IVY_DIR=${SBT_IVY_DIR:-/usr/share/sbt/ivy-local}
-export SBT_BOOT_PROPERTIES=${SBT_BOOT_PROPERTIES:-/etc/sbt/sbt.boot.properties}
+
+if \[ "x$RPM_PACKAGE_NAME" != x \] && \[ -f /etc/sbt/rpmbuild-sbt.boot.properties \] ; then
+    export SBT_BOOT_PROPERTIES=${SBT_BOOT_PROPERTIES:-/etc/sbt/rpmbuild-sbt.boot.properties}
+else
+    export SBT_BOOT_PROPERTIES=${SBT_BOOT_PROPERTIES:-/etc/sbt/sbt.boot.properties}
+fi
+
 export BASE_CLASSPATH=$(build-classpath scala ivy sbt ${JLINE} jansi test-interface sbinary)
 export JAVA_OPTS="-Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled"
 
diff --git a/sbt.boot.properties b/sbt.boot.properties
index a7041b6..8a8d83d 100644
--- a/sbt.boot.properties
+++ b/sbt.boot.properties
@@ -10,16 +10,17 @@
   cross-versioned: ${sbt.cross.versioned-false}
 
 [repositories]
-  local: file:${fedora.sbt.ivy.dir-ivy-local}, [organization]/[module]/[revision]/ivy.xml, [organization]/[module]/[revision]/[artifact]-[revision].[ext]
+  local
+  fedora: file:${fedora.sbt.ivy.dir-ivy-local}, [organization]/[module]/[revision]/ivy.xml, [organization]/[module]/[revision]/[artifact]-[revision].[ext]
+  typesafe-ivy-releases: http://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly
+  maven-central
+  sonatype-snapshots: https://oss.sonatype.org/content/repositories/snapshots
 
 [boot]
- directory: ${fedora.sbt.boot.dir-/usr/share/sbt/boot}
-
-[log]
-  level: debug
+  directory: ${sbt.boot.directory-${sbt.global.base-${user.home}/.sbt}/boot/}
 
 [ivy]
-  ivy-home: ${fedora.sbt.ivy.dir-/usr/share/sbt/ivy-local}
+  ivy-home: ${sbt.ivy.home-${user.home}/.ivy2/}
   checksums: ${sbt.checksums-sha1,md5}
-  override-build-repos: true
-
+  override-build-repos: ${sbt.override.build.repos-false}
+  repository-config: ${sbt.repository.config-${sbt.global.base-${user.home}/.sbt}/repositories}
\ No newline at end of file
diff --git a/sbt.spec b/sbt.spec
index f096de1..9e126e5 100644
--- a/sbt.spec
+++ b/sbt.spec
@@ -6,7 +6,7 @@
 
 # build non-bootstrap packages with tests, cross-referenced sources, etc
 %global do_proper 0
-%global pkg_rel 4
+%global pkg_rel 5
 %global scala_version 2.10.3
 %global scala_short_version 2.10
 %global sbt_bootstrap_version 0.13.1
@@ -91,7 +91,8 @@ Source6:	https://github.com/rickynils/scalacheck/archive/%{scalacheck_version}.t
 Source7:	https://github.com/etorreborre/specs2/archive/SPECS2-%{specs2_version}.tar.gz	
 
 Source16:	https://raw.github.com/willb/climbing-nemesis/master/climbing-nemesis.py
-Source17:	https://raw.github.com/willb/sbt-packaging/master/sbt.boot.properties
+Source17:	https://raw.github.com/willb/rpm-packaging/master/sbt-packaging/sbt.boot.properties
+Source15:	https://raw.github.com/willb/rpm-packaging/master/sbt-packaging/rpmbuild-sbt.boot.properties
 
 # Ivy POM
 # necessary for bootstrapping with sbt 0.13.1
@@ -104,7 +105,7 @@ Source19:	http://repo1.maven.org/maven2/org/apache/ivy/ivy/2.3.0-rc1/ivy-2.3.0-r
 
 
 # sbt script (to be obsoleted in future releases)
-Source21:	https://raw.github.com/willb/sbt-packaging/master/sbt
+Source21:	https://raw.github.com/willb/rpm-packaging/master/sbt-packaging/sbt
 
 %if %{do_bootstrap}
 # include bootstrap libraries
@@ -390,6 +391,7 @@ sbt is the simple build tool for Scala and Java projects.
 sed -i -e '/% "test"/d' project/Util.scala
 
 cp %{SOURCE16} .
+cp %{SOURCE15} .
 chmod 755 climbing-nemesis.py
 
 cp %{SOURCE17} .
@@ -404,8 +406,12 @@ sed -i -e '/sbt-ghpages/d' project/p.sbt
 
 
 sed -i -e 's/0.7.1/0.6.2/g' project/p.sbt
-sed -i -e 's/FEDORA_SCALA_VERSION/%{scala_version}/g' sbt.boot.properties
-sed -i -e 's/FEDORA_SBT_VERSION/%{sbt_version}/g' sbt.boot.properties
+
+for props in rpmbuild-sbt.boot.properties sbt.boot.properties ; do
+    sed -i -e 's/FEDORA_SCALA_VERSION/%{scala_version}/g' $props
+    sed -i -e 's/FEDORA_SBT_VERSION/%{sbt_version}/g' $props
+done
+
 sed -i -e 's/["]2[.]10[.]2["]/\"2.10.3\"/g' $(find . -name \*.sbt) $(find . -name \*.xml)
 sed -i -e 's/["]2[.]10[.]2-RC2["]/\"2.10.3\"/g' $(find . -name \*.sbt)
 
@@ -601,11 +607,11 @@ done
 %build
 
 %if %{do_bootstrap}
-java -Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled -jar -Dfedora.sbt.ivy.dir=ivy-local -Dfedora.sbt.boot.dir=sbt-boot-dir -Divy.checksums='""' -Dsbt.boot.properties=sbt.boot.properties sbt-launch.jar package "set publishTo in Global := Some(Resolver.file(\"published\", file(\"published\"))(Resolver.ivyStylePatterns) ivys \"$(pwd)/published/[organization]/[module]/[revision]/ivy.xml\" artifacts \"$(pwd)/published/[organization]/[module]/[revision]/[artifact]-[revision].[ext]\")" publish makePom
+java -Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled -jar -Dfedora.sbt.ivy.dir=ivy-local -Dfedora.sbt.boot.dir=sbt-boot-dir -Divy.checksums='""' -Dsbt.boot.properties=rpmbuild-sbt.boot.properties sbt-launch.jar package "set publishTo in Global := Some(Resolver.file(\"published\", file(\"published\"))(Resolver.ivyStylePatterns) ivys \"$(pwd)/published/[organization]/[module]/[revision]/ivy.xml\" artifacts \"$(pwd)/published/[organization]/[module]/[revision]/[artifact]-[revision].[ext]\")" publish makePom
 %else
 export SBT_IVY_DIR=ivy-local
 export SBT_BOOT_DIR=sbt-boot-dir
-export SBT_BOOT_PROPERTIES=sbt.boot.properties
+export SBT_BOOT_PROPERTIES=rpmbuild-sbt.boot.properties
 sbt package "set publishTo in Global := Some(Resolver.file(\"published\", file(\"published\"))(Resolver.ivyStylePatterns) ivys \"$(pwd)/published/[organization]/[module]/[revision]/ivy.xml\" artifacts \"$(pwd)/published/[organization]/[module]/[revision]/[artifact]-[revision].[ext]\")" publish makePom
 %endif
 
@@ -636,7 +642,10 @@ rm -f %{buildroot}/%{_javadir}/%{name}/sbt-launch.jar
 
 mkdir -p %{buildroot}/%{_sysconfdir}/%{name}
 
-sed 's/debug/info/' < sbt.boot.properties > %{buildroot}/%{_sysconfdir}/%{name}/sbt.boot.properties
+# XXXXXXX
+for props in rpmbuild-sbt.boot.properties sbt.boot.properties ; do
+    sed 's/debug/info/' < $props > %{buildroot}/%{_sysconfdir}/%{name}/$props
+done
 
 mkdir -p %{buildroot}/%{installed_ivy_local}
 
@@ -711,6 +720,9 @@ done
 %doc README.md LICENSE NOTICE
 
 %changelog
+* Tue Mar 4 2014 William Benton <willb at redhat.com> - 0.13.1-5
+- fixes BZ 1072096
+
 * Thu Jan 30 2014 William Benton <willb at redhat.com> - 0.13.1-4
 - use native test-interface and sbinary packages in both bootstrap and non-bootstrap modes
 - fix a bug that was crashing on rawhide


More information about the scm-commits mailing list