Hello community, here is the log from the commit of package cabal-rpm for openSUSE:Factory checked in at 2015-09-02 00:36:01 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/cabal-rpm (Old) and /work/SRC/openSUSE:Factory/.cabal-rpm.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "cabal-rpm" Changes: -------- --- /work/SRC/openSUSE:Factory/cabal-rpm/cabal-rpm.changes 2015-08-25 08:46:23.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.cabal-rpm.new/cabal-rpm.changes 2015-09-02 00:36:02.000000000 +0200 @@ -1,0 +2,15 @@ +Mon Aug 31 06:58:52 UTC 2015 - mimi.vx@gmail.com + +- change fix-macro-license.patch to upstream solution + +------------------------------------------------------------------- +Sun Aug 30 14:38:54 UTC 2015 - mimi.vx@gmail.com + +- update to 0.9.7 +* 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 ++ add fix-macro-license.patch to correct use of %license macro + +------------------------------------------------------------------- Old: ---- cabal-rpm-0.9.6.tar.gz New: ---- cabal-rpm-0.9.7.tar.gz fix-macro-license.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ cabal-rpm.spec ++++++ --- /var/tmp/diff_new_pack.WWB65t/_old 2015-09-02 00:36:03.000000000 +0200 +++ /var/tmp/diff_new_pack.WWB65t/_new 2015-09-02 00:36:03.000000000 +0200 @@ -17,7 +17,7 @@ Name: cabal-rpm -Version: 0.9.6 +Version: 0.9.7 Release: 0 Summary: RPM packaging tool for Haskell Cabal-based packages License: GPL-3.0+ @@ -25,6 +25,9 @@ Url: https://hackage.haskell.org/package/%{name} Source0: https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz Source2: cabal-rpm.1 +# PATCH-FIX-UPSTREAM fix-macro-license.patch mimi.vx@gmail.com SUSE doesn't support +# %%licence macro from Fedora 21 +Patch0: fix-macro-license.patch BuildRequires: ghc-Cabal-devel # Begin cabal-rpm deps: BuildRequires: ghc-directory-devel @@ -51,6 +54,7 @@ %prep %setup -q +%patch0 -p1 %build %define cabal_configure_options --flags="-old-locale" ++++++ cabal-rpm-0.9.6.tar.gz -> cabal-rpm-0.9.7.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cabal-rpm-0.9.6/ChangeLog new/cabal-rpm-0.9.7/ChangeLog --- old/cabal-rpm-0.9.6/ChangeLog 2015-05-21 11:52:28.000000000 +0200 +++ new/cabal-rpm-0.9.7/ChangeLog 2015-08-28 10:47:23.000000000 +0200 @@ -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 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cabal-rpm-0.9.6/cabal-rpm.cabal new/cabal-rpm-0.9.7/cabal-rpm.cabal --- old/cabal-rpm-0.9.6/cabal-rpm.cabal 2015-05-21 11:52:28.000000000 +0200 +++ new/cabal-rpm-0.9.7/cabal-rpm.cabal 2015-08-28 10:47:23.000000000 +0200 @@ -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. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cabal-rpm-0.9.6/src/Commands/Spec.hs new/cabal-rpm-0.9.7/src/Commands/Spec.hs --- old/cabal-rpm-0.9.6/src/Commands/Spec.hs 2015-05-21 11:52:28.000000000 +0200 +++ new/cabal-rpm-0.9.7/src/Commands/Spec.hs 2015-08-28 10:47:23.000000000 +0200 @@ -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}" @@ -349,6 +361,9 @@ 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 contents <- getDirectoryContents $ dropFileName cabalPath diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cabal-rpm-0.9.6/src/Main.hs new/cabal-rpm-0.9.7/src/Main.hs --- old/cabal-rpm-0.9.6/src/Main.hs 2015-05-21 11:52:28.000000000 +0200 +++ new/cabal-rpm-0.9.7/src/Main.hs 2015-08-28 10:47:23.000000000 +0200 @@ -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 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cabal-rpm-0.9.6/src/Setup.hs new/cabal-rpm-0.9.7/src/Setup.hs --- old/cabal-rpm-0.9.6/src/Setup.hs 2015-05-21 11:52:28.000000000 +0200 +++ new/cabal-rpm-0.9.7/src/Setup.hs 2015-08-28 10:47:23.000000000 +0200 @@ -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) $ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cabal-rpm-0.9.6/src/SysCmd.hs new/cabal-rpm-0.9.7/src/SysCmd.hs --- old/cabal-rpm-0.9.6/src/SysCmd.hs 2015-05-21 11:52:28.000000000 +0200 +++ new/cabal-rpm-0.9.7/src/SysCmd.hs 2015-08-28 10:47:23.000000000 +0200 @@ -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 () ++++++ fix-macro-license.patch ++++++
From cfd0536c2352d8ce95552039a087b43e94d67ee1 Mon Sep 17 00:00:00 2001 From: Jens Petersen <petersen@redhat.com> Date: Mon, 31 Aug 2015 12:01:27 +0900 Subject: [PATCH] %license is only in RHEL7+/Fedora (#22)
thanks to @mimi1vx for reporting via PR --- src/Commands/Spec.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Commands/Spec.hs b/src/Commands/Spec.hs index 9856196..fbc20e4 100644 --- a/src/Commands/Spec.hs +++ b/src/Commands/Spec.hs @@ -226,9 +226,9 @@ createSpecFile pkgdata flags mdest = do put $ "%package" +-+ ghcPkg putHdr "Summary" $ "Haskell" +-+ pkg_name +-+ "library" case distro of - Fedora -> return () SUSE -> putHdr "Group" "System/Libraries" RHEL5 -> putHdr "Group" "System Environment/Libraries" + _ -> return () putNewline put $ "%description" +-+ ghcPkg put $ wrapGenDesc $ "This package provides the Haskell" +-+ pkg_name +-+ "shared library." @@ -236,9 +236,9 @@ createSpecFile pkgdata flags mdest = do put $ "%package" +-+ ghcPkgDevel putHdr "Summary" $ "Haskell" +-+ pkg_name +-+ "library development files" case distro of - Fedora -> return () RHEL5 -> putHdr "Group" "Development/Libraries" SUSE -> putHdr "Group" "Development/Libraries/Other" + _ -> return () unless (distro == SUSE) $ putHdr "Provides" $ (if binlib then "ghc-%{name}" else "%{name}") ++ "-static = %{version}-%{release}" putHdr "Requires" "ghc-compiler = %{ghc_version}" @@ -254,8 +254,8 @@ createSpecFile pkgdata flags mdest = do put $ wrapGenDesc $ "This package provides the Haskell" +-+ pkg_name +-+ "library development files." putNewline - when (distro == RHEL5) $ do - put "%global %license %%doc" + when (distro /= Fedora) $ do + putDef "license" "%%doc" putNewline put "%prep"