cabal-rpm 0.7.0 → 0.7.1
raw patch · 5 files changed
+26/−11 lines, 5 files
Files
- NEWS +9/−0
- cabal-rpm.cabal +3/−1
- cblrpm-diff +1/−1
- src/Distribution/Package/Rpm.hs +10/−6
- src/Distribution/Package/Rpm/Main.hs +3/−3
NEWS view
@@ -1,3 +1,12 @@+* 0.7.1+- add final full-stop to description if missing+- add ver-rel to initial changelog entry+- fix use of cblrpm-diff force lib option+- output warning when .spec already exists+- fix handling of package names that end in a digit+- output when trying a path+- map curl C dep to libcurl+ * 0.7.0 - cabal-rpm command renamed to cblrpm, and cabal-rpm-diff to cblrpm-diff - cblrpm now has commands for spec, srpm, and build
cabal-rpm.cabal view
@@ -1,10 +1,12 @@ Name: cabal-rpm-Version: 0.7.0+Version: 0.7.1 Synopsis: RPM package creator for Haskell Cabal-based packages Description: This package generates RPM spec files from Haskell Cabal packages. . Recent changes:+ .+ * 0.7.1: various bugfixes and minor improvments . * 0.7.0: command arg for spec, srpm, or build; installs existing packaged depends with sudo yum .
cblrpm-diff view
@@ -39,7 +39,7 @@ cd $WORKDIR -if ! cblrpm spec $FORCE_LIB ../$FILE; then+if ! cblrpm $FORCE_LIB spec ../$FILE; then cd .. rm -r $WORKDIR exit 1
src/Distribution/Package/Rpm.hs view
@@ -89,8 +89,9 @@ -- autoreconf verbose pkgDesc specFile <- specFileName pkgDesc flags specFileExists <- doesFileExist specFile- unless specFileExists $- createSpecFile cabalPath pkgDesc flags+ if specFileExists+ then putStrLn $ "Using existing" +-+ specFile+ else createSpecFile cabalPath pkgDesc flags let pkg = package pkgDesc name = packageName pkg when binary $ do@@ -183,7 +184,9 @@ isExec = if (rpmLibrary flags) then False else hasExes pkgDesc isLib = hasLibs pkgDesc specAlreadyExists <- doesFileExist specFile- h <- openFile (specFile ++ if specAlreadyExists then ".cblrpm" else "") WriteMode+ let specFilename = specFile ++ if specAlreadyExists then ".cblrpm" else ""+ when specAlreadyExists $ putStrLn $ specFile +-+ "exists:" +-+ "creating" +-+ specFilename+ h <- openFile specFilename WriteMode let putHdr hdr val = hPutStrLn h (hdr ++ ":" ++ padding hdr ++ val) padding hdr = replicate (15 - length hdr) ' ' putHdr_ hdr val = unless (null val) $ putHdr hdr val@@ -209,13 +212,13 @@ when synTooLong $ warn verbose "The synopsis for this package spans multiple lines." - let common_description = lines $+ let common_description = (lines . finalPeriod) $ if (null . description) pkgDesc then if synTooLong then syn else "This package does not have a description." else description pkgDesc-+ finalPeriod cs = if (last cs == '.') then cs else cs ++ "." when isLib $ do putDef "pkg_name" name putNewline@@ -247,6 +250,7 @@ mapTools tool = tool tools = filter excludedTools $ nub $ map (mapTools . depName) $ concat (map buildTools buildinfo) excludedCLibs n = notElem n []+ mapCLibs "curl" = "libcurl" mapCLibs "glut" = "freeglut" mapCLibs "iw" = "wireless-tools" mapCLibs "z" = "zlib"@@ -339,7 +343,7 @@ putNewline put "%changelog"- put $ "*" +-+ date +-+ "Fedora Haskell SIG <haskell@lists.fedoraproject.org>"+ put $ "*" +-+ date +-+ "Fedora Haskell SIG <haskell@lists.fedoraproject.org> - " ++ version ++ "-" ++ release put $ "- spec file generated by cabal-rpm-" ++ showVersion Paths_cabal_rpm.version hClose h
src/Distribution/Package/Rpm/Main.hs view
@@ -26,7 +26,6 @@ import Distribution.Simple.Program (defaultProgramConfiguration) import Distribution.Simple.Utils (defaultPackageDesc, die, findPackageDesc) import Distribution.System (Platform (..), buildArch, buildOS)-import Data.Char (isDigit) import Data.List (isSuffixOf) import System.Directory (doesDirectoryExist, doesFileExist, getCurrentDirectory, removeDirectoryRecursive, setCurrentDirectory)@@ -47,7 +46,7 @@ genPkgDesc <- readPackageDescription verbose cabalPath pkgDesc <- simplePackageDescription genPkgDesc opts case cmd of- "spec" -> createSpecFile cabalPath pkgDesc opts+ "spec" -> createSpecFile cabalPath pkgDesc opts "srpm" -> rpmBuild cabalPath pkgDesc opts False "build" -> rpmBuild cabalPath pkgDesc opts True -- "install" ->@@ -74,6 +73,7 @@ isdir <- doesDirectoryExist path if isdir then do+ putStrLn $ "Trying: " ++ path ++ "/" file <- findPackageDesc path return (file, Nothing) else do@@ -96,7 +96,7 @@ tryUnpack :: String -> IO (FilePath, Maybe FilePath) tryUnpack pkg = do- pkgver <- if isDigit $ last pkg then return pkg+ pkgver <- if elem '.' pkg then return pkg else do contains_pkg <- readProcess "cabal" ["list", "--simple-output", pkg] [] let pkgs = filter ((== pkg) . fst . break (== ' ')) $ lines contains_pkg