packages feed

cabal-rpm 0.9.6 → 0.9.7

raw patch · 6 files changed

+35/−16 lines, 6 files

Files

ChangeLog view
@@ -1,3 +1,9 @@+* 0.9.7 (2015-08-28)+- only list buildable executables in spec file+- bring back 'build' as an alias for 'local'+- use %license macro+- do not warn about missing optional system programs+ * 0.9.6 (2015-05-21) - make "cabal list" quiet - filter missing packages from repoquery
cabal-rpm.cabal view
@@ -1,5 +1,5 @@ Name:                cabal-rpm-Version:             0.9.6+Version:             0.9.7 Synopsis:            RPM packaging tool for Haskell Cabal-based packages Description:     This package provides a RPM packaging tool for Haskell Cabal-based packages.
src/Commands/Spec.hs view
@@ -40,7 +40,8 @@  import Distribution.Simple.Utils (notice, warn) -import Distribution.PackageDescription (PackageDescription (..), Executable (..),+import Distribution.PackageDescription (BuildInfo (..), PackageDescription (..),+                                        Executable (..),                                         exeName, hasExes, hasLibs)  --import Distribution.Version (VersionRange, foldVersionRange')@@ -253,6 +254,10 @@     put $ wrapGenDesc $ "This package provides the Haskell" +-+ pkg_name +-+ "library development files."     putNewline +  when (distro == RHEL5) $ do+    put "%global %license %%doc"+    putNewline+   put "%prep"   put $ "%setup -q" ++ (if pkgname /= name then " -n %{pkg_name}-%{version}" else "")   putNewline@@ -267,7 +272,20 @@   put "%install"   put $ "%ghc_" ++ pkgType ++ "_install" -  let execs = sort $ map exeName $ executables pkgDesc+  let licensefiles =+#if defined(MIN_VERSION_Cabal) && MIN_VERSION_Cabal(1,20,0)+        licenseFiles pkgDesc+#else+        if null (licenseFile pkgDesc) then [] else [licenseFile pkgDesc]+#endif+  unless (null licensefiles) $ do+    putNewline+    put $ "rm %{buildroot}%{ghc_pkgdocdir}/" +++      case length licensefiles of+           1 -> head licensefiles+           _ -> "{" ++ intercalate "," licensefiles ++ "}"++  let execs = sort $ map exeName $ filter isBuildable $ executables pkgDesc   when selfdep $ do     putNewline     put $ "%ghc_fix_dynamic_rpath" +-+ intercalate " " (map (\ p -> if p == name then "%{pkg_name}" else p) execs)@@ -292,12 +310,6 @@     put $ "%postun" +-+ ghcPkgDevel     putInstallScript -  let licensefiles =-#if defined(MIN_VERSION_Cabal) && MIN_VERSION_Cabal(1,20,0)-        licenseFiles pkgDesc-#else-        if null (licenseFile pkgDesc) then [] else [licenseFile pkgDesc]-#endif   docs <- findDocs cabalPath licensefiles    when hasExecPkg $ do@@ -305,7 +317,7 @@     when (distro /= Fedora) $ put "%defattr(-,root,root,-)"     -- Add the license file to the main package only if it wouldn't     -- otherwise be empty.-    mapM_ (\ l -> put $ "%doc" +-+ l) licensefiles+    mapM_ (\ l -> put $ "%license" +-+ l) licensefiles     unless (null docs) $       put $ "%doc" +-+ unwords docs @@ -321,7 +333,7 @@         develFiles = if binlib then "-f ghc-%{name}-devel.files" else "-f %{name}-devel.files"     put $ "%files" +-+ ghcPkg +-+ baseFiles     when (distro /= Fedora) $ put "%defattr(-,root,root,-)"-    mapM_ (\ l -> put $ "%doc" +-+ l) licensefiles+    mapM_ (\ l -> put $ "%license" +-+ l) licensefiles     -- be strict for now --      unless (null (dataFiles pkgDesc) || binlib) $ --        put "%{_datadir}/%{pkg_name}-%{version}"@@ -348,6 +360,9 @@                    Maybe FilePath -> IO () createSpecFile_ pkgFiles flags mdest =   void (createSpecFile pkgFiles flags mdest)++isBuildable :: Executable -> Bool+isBuildable exe = buildable $ buildInfo exe  findDocs :: FilePath -> [FilePath] -> IO [FilePath] findDocs cabalPath licensefiles = do
src/Main.hs view
@@ -41,6 +41,7 @@         "srpm"        -> rpmBuild_ pkgdata opts Source         "prep"        -> rpmBuild_ pkgdata opts Prep         "local"       -> rpmBuild_ pkgdata opts Binary+        "build"       -> rpmBuild_ pkgdata opts Binary         "builddep"    -> rpmBuild_ pkgdata opts BuildDep         "diff"        -> diff pkgdata opts         "install"     -> install pkgdata opts
src/Setup.hs view
@@ -128,7 +128,7 @@     error $ unlines errs   unless (null unknown) $     error $ "Unrecognised options:" +-+ unwords unknown-  when (null args' || notElem (head args') ["builddep", "depends", "diff", "install", "missingdeps", "prep", "requires", "spec", "srpm", "local", "rpm", "update"]) $ do+  when (null args' || notElem (head args') ["builddep", "depends", "diff", "install", "missingdeps", "prep", "requires", "spec", "srpm", "build", "local", "rpm", "update"]) $ do     printHelp stderr     exitWith (ExitFailure 1)   when (length args' > 2) $
src/SysCmd.hs view
@@ -15,8 +15,6 @@ -- (at your option) any later version.  module SysCmd (-  optionalProgram,-  requireProgram,   cmd,   cmd_,   cmdBool,@@ -35,7 +33,7 @@ import Data.List        ((\\)) import Data.Maybe       (fromMaybe, isJust, isNothing) -import Distribution.Simple.Utils (die, warn, findProgramLocation)+import Distribution.Simple.Utils (die, findProgramLocation) import Distribution.Verbosity (normal)  import System.Posix.User (getEffectiveUserID)@@ -50,7 +48,6 @@ optionalProgram :: String -> IO Bool optionalProgram c = do   mavail <- findProgramLocation normal c-  when (isNothing mavail) $ warn normal (c ++ ": command not found")   return $ isJust mavail  cmd_ :: String -> [String] -> IO ()