mirror of https://github.com/sbt/sbt.git
First cut at using metapackages to allow multiple versions of SBT in the same debian repository.
This commit is contained in:
parent
c91159b363
commit
440ad4bb0b
|
|
@ -0,0 +1,25 @@
|
||||||
|
import sbt._
|
||||||
|
import com.typesafe.packager.Keys._
|
||||||
|
import sbt.Keys._
|
||||||
|
import com.typesafe.packager.PackagerPlugin._
|
||||||
|
|
||||||
|
|
||||||
|
object MetaPackaging {
|
||||||
|
|
||||||
|
def settings(pkg: Project): Seq[Setting[_]] = packagerSettings ++ Seq(
|
||||||
|
name := "sbt",
|
||||||
|
version <<= sbtVersion apply {
|
||||||
|
case "0.11.3" => "0.11.3-build0300"
|
||||||
|
case v => v
|
||||||
|
},
|
||||||
|
// GENERAL LINUX PACKAGING STUFFS
|
||||||
|
maintainer := "Josh Suereth <joshua.suereth@typesafe.com>",
|
||||||
|
packageSummary := "Simple Build Tool for Scala-driven builds",
|
||||||
|
packageDescription := """This meta-package provides the most up-to-date version of the SBT package.""",
|
||||||
|
debianPackageDependencies in Debian <+= (name in Debian in pkg),
|
||||||
|
// STUBBED values
|
||||||
|
wixConfig := <dummy/>,
|
||||||
|
rpmRelease := "1",
|
||||||
|
rpmVendor := "typesafe"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
@ -4,4 +4,6 @@ import Keys._
|
||||||
object SbtExtras extends Build {
|
object SbtExtras extends Build {
|
||||||
// This build creates a SBT plugin with handy features *and* bundles the SBT script for distribution.
|
// This build creates a SBT plugin with handy features *and* bundles the SBT script for distribution.
|
||||||
val root = Project("sbt-extras", file(".")) settings(Packaging.settings:_*)
|
val root = Project("sbt-extras", file(".")) settings(Packaging.settings:_*)
|
||||||
|
|
||||||
|
val meta = Project("metapackage", file("metapackage")) settings(MetaPackaging.settings(root):_*)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,14 @@ object Packaging {
|
||||||
|
|
||||||
def localWindowsPattern = "[organisation]/[module]/[revision]/[module].[ext]"
|
def localWindowsPattern = "[organisation]/[module]/[revision]/[module].[ext]"
|
||||||
|
|
||||||
|
def downloadUrlForVersion(v: String) = (v split "[^\\d]" map (_.toInt)) match {
|
||||||
|
case Array(0, 11, x, _*) if x >= 3 => "http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/"+v+"/sbt-launch.jar"
|
||||||
|
case Array(0, y, _*) if y >= 12 => "http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/"+v+"/sbt-launch.jar"
|
||||||
|
case _ => "http://repo.typesafe.com/typesafe/ivy-releases/org.scala-tools.sbt/sbt-launch/"+v+"/sbt-launch.jar"
|
||||||
|
}
|
||||||
|
|
||||||
val settings: Seq[Setting[_]] = packagerSettings ++ Seq(
|
val settings: Seq[Setting[_]] = packagerSettings ++ Seq(
|
||||||
sbtLaunchJarUrl <<= sbtVersion apply ("http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/"+_+"/sbt-launch.jar"),
|
sbtLaunchJarUrl <<= sbtVersion apply downloadUrlForVersion,
|
||||||
sbtLaunchJarLocation <<= target apply (_ / "sbt-launch.jar"),
|
sbtLaunchJarLocation <<= target apply (_ / "sbt-launch.jar"),
|
||||||
sbtLaunchJar <<= (sbtLaunchJarUrl, sbtLaunchJarLocation) map { (uri, file) =>
|
sbtLaunchJar <<= (sbtLaunchJarUrl, sbtLaunchJarLocation) map { (uri, file) =>
|
||||||
import dispatch._
|
import dispatch._
|
||||||
|
|
@ -88,9 +94,10 @@ object Packaging {
|
||||||
jar -> ("/usr/lib/sbt/"+v+"/sbt-launch.jar")) withPerms "0755"
|
jar -> ("/usr/lib/sbt/"+v+"/sbt-launch.jar")) withPerms "0755"
|
||||||
},
|
},
|
||||||
// DEBIAN SPECIFIC
|
// DEBIAN SPECIFIC
|
||||||
name in Debian := "sbt",
|
name in Debian <<= (sbtVersion) apply { (sv) => "sbt-" + (sv split "[^\\d]" take 3 mkString ".") },
|
||||||
version in Debian <<= (version, sbtVersion) apply { (v, sv) =>
|
version in Debian <<= (version, sbtVersion) apply { (v, sv) =>
|
||||||
sv + "-build-" + (v split "\\." map (_.toInt) dropWhile (_ == 0) map ("%02d" format _) mkString "")
|
val nums = (v split "[^\\d]")
|
||||||
|
"%s-build-%03d" format ((nums.init mkString "."), nums.last.toInt + 1)
|
||||||
},
|
},
|
||||||
debianPackageDependencies in Debian ++= Seq("curl", "java2-runtime", "bash (>= 2.05a-11)"),
|
debianPackageDependencies in Debian ++= Seq("curl", "java2-runtime", "bash (>= 2.05a-11)"),
|
||||||
debianPackageRecommends in Debian += "git",
|
debianPackageRecommends in Debian += "git",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue