cabal-rpm 0.10.0 → 0.10.1
raw patch · 3 files changed
+20/−18 lines, 3 files
Files
- ChangeLog +9/−3
- cabal-rpm.cabal +1/−1
- src/Commands/Spec.hs +10/−14
ChangeLog view
@@ -1,3 +1,9 @@+* 0.10.1 (2016-11-29)+- no longer need to remove License file by hand+- use new %ghc_fix_rpath+- include Contributors in docs+- warn about duplicate docs in datadir and remove them+ * 0.10.0 (2016-07-27) - rename executable and manpage back to 'cabal-rpm': more predictable - explicit error for unknown command@@ -9,9 +15,9 @@ - on SUSE add explicit requires for pkgconfig - new --compiler option (@peti) - new --distro option (@peti)-- new --strict option which fails when missing cdeps (@peti),- otherwise a warning is not output-- update now shows the generated patch+- new --strict option which fails when unresolved cdeps (@peti),+ otherwise a warning is output+- update now shows diff - use %cabal_test (@mimi1vx) - no longer duplicate docs in datadir - package datadir better
cabal-rpm.cabal view
@@ -1,5 +1,5 @@ Name: cabal-rpm-Version: 0.10.0+Version: 0.10.1 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
@@ -286,10 +286,9 @@ put "%install" put $ "%ghc_" ++ pkgType ++ "_install" - let execs = sort $ map exeName $ filter isBuildable $ executables pkgDesc when selfdep $ do putNewline- put $ "%ghc_fix_dynamic_rpath" +-+ unwords (map (\ p -> if p == name then "%{pkg_name}" else p) execs)+ put $ "%ghc_fix_rpath" +-+ "%{pkg_name}-%{version}" let licensefiles = #if defined(MIN_VERSION_Cabal) && MIN_VERSION_Cabal(1,20,0)@@ -297,20 +296,16 @@ #else if null (licenseFile pkgDesc) then [] else [licenseFile pkgDesc] #endif- unless (null licensefiles || distro /= Fedora) $ do- putNewline- put $ "rm %{buildroot}%{ghc_pkgdocdir}/" ++- case length licensefiles of- 1 -> head licensefiles- _ -> "{" ++ intercalate "," licensefiles ++ "}" -- remove docs from datafiles (#38) docs <- sort <$> findDocs cabalPath licensefiles let datafiles = dataFiles pkgDesc dupdocs = docs `intersect` datafiles- unless (null dupdocs) $- put $ "rm %{buildroot}%{_datadir}/" ++ pkg_name ++ "-%{version}/" ++- case length dupdocs of+ unless (null dupdocs) $ do+ putStrLn $ "Warning: doc files found in datadir:" +-+ unwords dupdocs+ unless (distro == SUSE) $+ put $ "rm %{buildroot}%{_datadir}/" ++ pkg_name ++ "-%{version}/" +++ case length dupdocs of 1 -> head dupdocs _ -> "{" ++ intercalate "," dupdocs ++ "}" @@ -334,6 +329,7 @@ putInstallScript let license_macro = if distro == Fedora then "%license" else "%doc"+ let execs = sort $ map exeName $ filter isBuildable $ executables pkgDesc when hasExecPkg $ do put "%files"@@ -396,8 +392,8 @@ return $ if null licensefiles then docs else filter unlikely $ filter (`notElem` licensefiles) docs- where names = ["author", "changelog", "changes", "copying", "doc", "example", "licence",- "license", "news", "readme", "todo"]+ where names = ["author", "changelog", "changes", "contributors", "copying", "doc",+ "example", "licence", "license", "news", "readme", "todo"] likely name = let lowerName = map toLower name in any (`isPrefixOf` lowerName) names unlikely name = not $ any (`isSuffixOf` name) ["~"]@@ -409,7 +405,7 @@ showLicense _ (GPL (Just ver)) = "GPLv" ++ showVersion ver ++ "+" showLicense SUSE (LGPL Nothing) = "LGPL-2.0+" showLicense _ (LGPL Nothing) = "LGPLv2+"-showLicense SUSE (LGPL (Just ver)) = "LGPL-" ++ [head $ showVersion ver] ++ "+"+showLicense SUSE (LGPL (Just ver)) = "LGPL-" ++ showVersion ver ++ "+" showLicense _ (LGPL (Just ver)) = "LGPLv" ++ [head $ showVersion ver] ++ "+" showLicense SUSE BSD3 = "BSD-3-Clause" showLicense _ BSD3 = "BSD"