cabal-rpm 0.12.1 → 0.12.2
raw patch · 8 files changed
+64/−26 lines, 8 files
Files
- ChangeLog +5/−0
- cabal-rpm.cabal +3/−2
- man/cabal-rpm.1 +11/−12
- src/Commands/Diff.hs +3/−1
- src/Commands/RpmBuild.hs +1/−1
- src/Commands/Spec.hs +18/−7
- src/PackageUtils.hs +19/−3
- src/Stackage.hs +4/−0
ChangeLog view
@@ -1,3 +1,8 @@+* 0.12.2 (2018-03-29)+- diff now supports CBLRPM_DIFF envvar to override "diff -u"+- try to build even when missing rpms deps not available+- package now builds with Cabal-2.2+ * 0.12.1 (2018-02-20) - new option --missing: comments out missing dependencies - put license files in lib subpackage
cabal-rpm.cabal view
@@ -1,5 +1,5 @@ Name: cabal-rpm-Version: 0.12.1+Version: 0.12.2 Synopsis: RPM packaging tool for Haskell Cabal-based packages Description: This package provides a RPM packaging tool for Haskell Cabal-based packages.@@ -24,7 +24,8 @@ Extra-source-files: README.md ChangeLog man/cabal-rpm.1.md man/cabal-rpm.1 Cabal-version: >=1.6 Tested-with: GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.4,- GHC == 7.10.3, GHC == 8.0.2+ GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2,+ GHC == 8.4.1 source-repository head type: git
man/cabal-rpm.1 view
@@ -1,4 +1,4 @@-.\" Automatically generated by Pandoc 1.19.2.4+.\" Automatically generated by Pandoc 2.1.1 .\" .TH "CABAL\-RPM" "1" "2013\-01\-21" "" "" .hy@@ -30,9 +30,8 @@ If the argument is a directory then it will look there for a .spec or \&.cabal file. If the argument is a path to a .cabal file then it will use it.-Otherwise if there is no \[aq]/\[aq] in the argument and it does not-exist then cabal\-rpm will try to unpack the package and use its .cabal-file.+Otherwise if there is no `/' in the argument and it does not exist then+cabal\-rpm will try to unpack the package and use its .cabal file. cabal\-rpm uses a temporary directory for unpackaging tarballs or packages. cabal\-rpm then parses the .cabal file and uses it to generate a .spec@@ -41,32 +40,32 @@ If a .spec already exists, cabal\-rpm outputs to .spec.cblrpm instead. .SH OPTIONS .TP-.B \-h, \-\-help+.B \-h, \[en]help Show the help text. .RS .RE .TP-.B \-b, \-\-binary+.B \-b, \[en]binary Force the base package name to be the Hackage package name. .RS .RE .TP-.B \-f \f[I]FLAGS\f[], \-\-flags=\f[I]FLAGS\f[]+.B \-f \f[I]FLAGS\f[], \[en]flags=\f[I]FLAGS\f[] Override one or more Cabal build configuration flags. .RS .RE .TP-.B \-\-release=\f[I]RELEASE\f[]+.B \[en]release=\f[I]RELEASE\f[] Override the release number in the .spec file. .RS .RE .TP-.B \-v \f[I]N\f[], \-\-verbose=\f[I]N\f[]+.B \-v \f[I]N\f[], \[en]verbose=\f[I]N\f[] Set verbosity to \f[I]N\f[]. .RS .RE .TP-.B \-\-version=\f[I]VERSION\f[]+.B \[en]version=\f[I]VERSION\f[] Override the version number in the .spec file. .RS .RE@@ -108,8 +107,8 @@ .fi .SH HISTORY .PP-Cabal\-rpm was originally written by Bryan O\[aq]Sullivan in 2007\-2008-and resurrected by Jens Petersen in 2012 to replace cabal2spec.+Cabal\-rpm was originally written by Bryan O'Sullivan in 2007\-2008 and+resurrected by Jens Petersen in 2012 to replace cabal2spec. .SH SEE ALSO .PP <http://github.com/juhp/cabal-rpm/>
src/Commands/Diff.hs view
@@ -27,6 +27,7 @@ import Distribution.Simple.Utils (die) import System.Directory (removeDirectoryRecursive)+import System.Posix.Env (getEnvDefault) diff :: PackageData -> RpmFlags -> Maybe String -> IO () diff pkgdata flags mpkg =@@ -37,5 +38,6 @@ pd <- if isNothing mpkg then return pkgdata else withCurrentDirectory tmpdir $ prepare flags mpkg speccblrpm <- createSpecFile pd flags (Just tmpdir)- shell $ "diff" +-+ "-u" +-+ spec +-+ speccblrpm +-+ "| sed -e s%" ++ speccblrpm ++ "%" ++ spec ++ ".cblrpm" ++ "%"+ diffcmd <- getEnvDefault "CBLRPM_DIFF" "diff -u"+ shell $ diffcmd +-+ spec +-+ speccblrpm +-+ "| sed -e s%" ++ speccblrpm ++ "%" ++ spec ++ ".cblrpm" ++ "%" removeDirectoryRecursive tmpdir
src/Commands/RpmBuild.hs view
@@ -58,7 +58,7 @@ let pkg = package pkgDesc name = packageName pkg when (stage `elem` [Binary,BuildDep]) $- pkgInstallMissing pkgdata (stage == Binary)+ pkgInstallMissing pkgdata False unless (stage == BuildDep) $ do srcdir <- cmd "rpm" ["--eval", "%{_sourcedir}"]
src/Commands/Spec.hs view
@@ -42,11 +42,18 @@ import Data.Time.Format (formatTime) import qualified Data.Version (showVersion) -import Distribution.License (License (..))+import Distribution.License (License (..)+#if defined(MIN_VERSION_Cabal) && MIN_VERSION_Cabal(2,2,0)+ , licenseFromSPDX+#endif+ ) import Distribution.PackageDescription (BuildInfo (..), PackageDescription (..), Executable (..), Library (..), exeName, hasExes, hasLibs,+#if defined(MIN_VERSION_Cabal) && MIN_VERSION_Cabal(2,2,0)+ license,+#endif #if defined(MIN_VERSION_Cabal) && MIN_VERSION_Cabal(2,0,0) unFlagName #else@@ -229,7 +236,11 @@ else "System Environment/Libraries") _ -> return () putNewline- putHdr "License" $ (showLicense distro . license) pkgDesc+#if defined(MIN_VERSION_Cabal) && MIN_VERSION_Cabal(2,2,0)+#else+ let licenseFromSPDX = id+#endif+ putHdr "License" $ (showLicense distro . licenseFromSPDX . license) pkgDesc putHdr "Url" $ "https://hackage.haskell.org/package" </> pkg_name putHdr "Source0" $ sourceUrl pkgver mapM_ (\ (n,p) -> putHdr ("Source" ++ n) (sourceUrl p)) $ number subpkgs@@ -347,9 +358,9 @@ when selfdep $ put $ "%ghc_fix_rpath" +-+ pkgver - let datafiles = dataFiles pkgDesc- dupdocs = docs `intersect` datafiles- datafiles' = datafiles \\ dupdocs+ let ds = dataFiles pkgDesc+ dupdocs = docs `intersect` ds+ datafiles = ds \\ dupdocs unless (null dupdocs) $ do putNewline putStrLn $ "Warning: doc files found in datadir:" +-+ unwords dupdocs@@ -394,7 +405,7 @@ unless (null docs) $ put $ "%doc" +-+ unwords docs mapM_ ((\ p -> put $ "%{_bindir}" </> (if p == name then "%{name}" else p)) . unUnqualComponentName) execs- when (notNull datafiles' && not selfdep) $+ when (notNull datafiles && not selfdep) $ put $ "%{_datadir}" </> pkgver sectionNewline@@ -408,7 +419,7 @@ mapM_ (\ l -> put $ license_macro +-+ l) licensefiles when (distro == SUSE && not binlib) $ mapM_ ((\ p -> put $ "%{_bindir}" </> (if p == name then "%{pkg_name}" else p)) . unUnqualComponentName) execs- when (notNull datafiles' && (selfdep || not binlib)) $+ when (notNull datafiles && (selfdep || not binlib)) $ put $ "%{_datadir}" </> pkgver sectionNewline put $ "%files" +-+ ghcPkgDevel +-+ develFiles
src/PackageUtils.hs view
@@ -63,9 +63,17 @@ #endif ) import Distribution.PackageDescription (PackageDescription (..),- hasExes, hasLibs)+ hasExes, hasLibs+#if defined(MIN_VERSION_Cabal) && MIN_VERSION_Cabal(2,2,0)+ , mkFlagAssignment+#endif+ ) import Distribution.PackageDescription.Configuration (finalizePackageDescription)+#if defined(MIN_VERSION_Cabal) && MIN_VERSION_Cabal(2,2,0)+import Distribution.PackageDescription.Parsec (readGenericPackageDescription)+#else import Distribution.PackageDescription.Parse (readPackageDescription)+#endif import Distribution.Simple.Compiler ( #if defined(MIN_VERSION_Cabal) && MIN_VERSION_Cabal(1,22,0)@@ -121,7 +129,11 @@ -> IO (PackageDescription, [FilePath], [FilePath]) simplePackageDescription cabalfile opts = do let verbose = rpmVerbosity opts- genPkgDesc <- readPackageDescription verbose cabalfile+#if defined(MIN_VERSION_Cabal) && MIN_VERSION_Cabal(2,2,0)+#else+ let readGenericPackageDescription = readPackageDescription+#endif+ genPkgDesc <- readGenericPackageDescription verbose cabalfile compiler <- case rpmCompilerId opts of Just cid -> return #if defined(MIN_VERSION_Cabal) && MIN_VERSION_Cabal(1,22,0)@@ -141,7 +153,11 @@ #else return (compilerId compiler) #endif- case finalizePackageDescription (rpmConfigurationsFlags opts)+#if defined(MIN_VERSION_Cabal) && MIN_VERSION_Cabal(2,2,0)+#else+ let mkFlagAssignment = id+#endif+ case finalizePackageDescription (mkFlagAssignment $ rpmConfigurationsFlags opts) (const True) (Platform buildArch buildOS) compiler [] genPkgDesc of
src/Stackage.hs view
@@ -32,6 +32,10 @@ import System.FilePath import SysCmd ((+-+)) #else+#if (defined(MIN_VERSION_base) && MIN_VERSION_base(4,8,2))+#else+import Control.Applicative ((<$>))+#endif import SysCmd ((+-+), cmdMaybe, optionalProgram) #endif