From 221667426c9d06a1d3ed7a8296d3848ed23fff5f Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Tue, 20 Dec 2011 22:25:02 -0500 Subject: [PATCH] Update build for rpm building. --- project/debian.scala | 62 +++++++++++++++++++++++++++++--------------- 1 file changed, 41 insertions(+), 21 deletions(-) diff --git a/project/debian.scala b/project/debian.scala index bf4ee32ac..1613dd66a 100644 --- a/project/debian.scala +++ b/project/debian.scala @@ -1,36 +1,56 @@ import sbt._ import com.typesafe.packager.debian.DebianPlugin._ -import com.typesafe.packager.linux.{LinuxPackageMapping, LinuxFileMetaData} import com.typesafe.packager.debian.Keys._ -import sbt.Keys.{baseDirectory,sbtVersion,sourceDirectory} +import com.typesafe.packager.linux.{LinuxPackageMapping, LinuxFileMetaData} +import com.typesafe.packager.rpm.RpmPlugin._ +import com.typesafe.packager.rpm.Keys._ +import sbt.Keys.{baseDirectory,sbtVersion,sourceDirectory, name,version} +import com.typesafe.packager.linux.Keys.{linuxPackageMappings,maintainer,packageDescription} object DebianPkg { - val settings: Seq[Setting[_]] = debianSettings ++ Seq( - maintainer in Debian := "Josh Suereth ", + val settings: Seq[Setting[_]] = debianSettings ++ rpmSettings ++ Seq( + + // GENERAL LINUX PACKAGING STUFFS + maintainer := "Josh Suereth ", + packageDescription := """Simple Build Tool + This script provides a native way to run the Simple Build Tool, + a build tool for Scala software, also called SBT.""", + linuxPackageMappings <+= (baseDirectory) map { bd => + (packageForDebian((bd / "sbt") -> "/usr/bin/sbt") + withUser "root" withGroup "root" withPerms "0755") + }, + linuxPackageMappings <+= (sourceDirectory) map { bd => + (packageForDebian( + (bd / "linux" / "usr/share/man/man1/sbt.1") -> "/usr/share/man/man1/sbt.1.gz" + ) withUser "root" withGroup "root" withPerms "0644" gzipped) asDocs() + }, + linuxPackageMappings <+= (sourceDirectory in Debian) map { bd => + packageForDebian( + (bd / "usr/share/doc/sbt") -> "/usr/share/doc/sbt", + (bd / "usr/share/doc/sbt/copyright") -> "/usr/share/doc/sbt/copyright" + ) withUser "root" withGroup "root" withPerms "0644" asDocs() + }, + + // DEBIAN SPECIFIC name in Debian := "sbt", version in Debian <<= (version, sbtVersion) apply { (v, sv) => sv + "-build-" + (v split "\\." map (_.toInt) dropWhile (_ == 0) map ("%02d" format _) mkString "") }, debianPackageDependencies in Debian ++= Seq("curl", "java2-runtime", "bash (>= 2.05a-11)"), debianPackageRecommends in Debian += "git", - packageDescription in Debian := """Simple Build Tool - This script provides a native way to run the Simple Build Tool, - a build tool for Scala software, also called SBT.""", - linuxPackageMappings in Debian <+= (baseDirectory) map { bd => - (packageForDebian((bd / "sbt") -> "usr/bin/sbt") - withUser "root" withGroup "root" withPerms "0755") - }, - linuxPackageMappings in Debian <+= (sourceDirectory in Debian) map { bd => - packageForDebian( - (bd / "usr/share/doc/sbt/copyright") -> "usr/share/doc/sbt/copyright" - ) withUser "root" withGroup "root" withPerms "0644" - }, linuxPackageMappings in Debian <+= (sourceDirectory) map { bd => - packageForDebian( - (bd / "debian/changelog") -> "usr/share/doc/sbt/changelog.gz", - (bd / "linux" / "usr/share/man/man1/sbt.1") -> "usr/share/man/man1/sbt.1.gz" - ) withUser "root" withGroup "root" withPerms "0644" gzipped - } + (packageForDebian( + (bd / "debian/changelog") -> "/usr/share/doc/sbt/changelog.gz" + ) withUser "root" withGroup "root" withPerms "0644" gzipped) asDocs() + }, + + // RPM SPECIFIC + name in Rpm := "sbt", + version in Rpm <<= sbtVersion.identity, + rpmRelease := "1", + rpmVendor := "Typesafe, Inc.", + rpmOs := "i386", + rpmUrl := Some("http://github.com/paulp/sbt-extras") ) }