cabal2spec 2.0.0 → 2.0.1
raw patch · 9 files changed
+40/−40 lines, 9 filesdep ~Cabaldep ~basePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: Cabal, base
API changes (from Hackage documentation)
Files
- cabal2spec.cabal +2/−3
- cabal2spec/Main.hs +1/−1
- src/Cabal2Spec.hs +14/−13
- test/Main.hs +1/−1
- test/golden-test-cases/blank-canvas.spec.golden +1/−1
- test/golden-test-cases/hakyll.spec.golden +11/−11
- test/golden-test-cases/hmpfr.spec.golden +1/−1
- test/golden-test-cases/hoogle.spec.golden +4/−4
- test/golden-test-cases/wai-cors.spec.golden +5/−5
cabal2spec.cabal view
@@ -1,5 +1,5 @@ name: cabal2spec-version: 2.0.0+version: 2.0.1 synopsis: Convert Cabal files into rpm spec files homepage: https://github.com/peti/cabal2spec license: GPL-3@@ -9,8 +9,7 @@ category: Distribution build-type: Simple cabal-version: >=1.10-tested-with: GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.3- , GHC == 8.0.2, GHC == 8.2.2+tested-with: GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.1 extra-source-files: README.md
cabal2spec/Main.hs view
@@ -56,4 +56,4 @@ print opts let specFile = fromMaybe (optCabalFile `replaceExtension` "spec") optOutputFile putStrLn $ "Writing spec file to " ++ show specFile ++ " ..."- cabal2spec buildPlatform buildCompilerId [] True optCabalFile specFile+ cabal2spec buildPlatform buildCompilerId mempty True optCabalFile specFile
src/Cabal2Spec.hs view
@@ -197,9 +197,9 @@ putNewline put "%build"- when (flagAssignment /= []) $ do+ when (flagAssignment /= mempty) $ do let cabalFlags = [ "-f" ++ (if b then "" else "-") ++ unFlagName n | (n, b) <- flagAssignment ]- put $ "%define cabal_configure_options " ++ unwords cabalFlags+ put $ "%define cabal_configure_options " ++ unwords (sort cabalFlags) let pkgType = if hasLib then "lib" else "bin" put $ "%ghc_" ++ pkgType ++ "_build" putNewline@@ -219,7 +219,7 @@ docs = docsUnfiltered \\ datafiles unless (null dupdocs) $ -- TODO: What does this warning accomplish?- putStrLn $ "*** " ++ pkgname ++ ": doc files found in datadir:" +-+ unwords dupdocs+ putStrLn $ "*** " ++ pkgname ++ ": doc files found in datadir:" +-+ unwords (sort dupdocs) putNewline unless (null testsuiteDeps) $ do@@ -240,10 +240,10 @@ let execs :: [String] execs = sort $ map (unUnqualComponentName . exeName) $ filter isBuildable $ executables pkgDesc - let listDataFiles = do unless (null (dataFiles pkgDesc)) $ do- put ("%dir %{_datadir}/" ++ pkg_name ++ "-%{version}")- mapM_ (put . (("%dir %{_datadir}/" ++ pkg_name ++ "-%{version}/")++)) (listDirs (dataFiles pkgDesc))- mapM_ (put . (("%{_datadir}/" ++ pkg_name ++ "-%{version}/")++)) (dataFiles pkgDesc)+ let listDataFiles = unless (null (dataFiles pkgDesc)) $ do+ put ("%dir %{_datadir}/" ++ pkg_name ++ "-%{version}")+ mapM_ (put . (("%dir %{_datadir}/" ++ pkg_name ++ "-%{version}/")++)) (sort (listDirs (dataFiles pkgDesc)))+ mapM_ (put . (("%{_datadir}/" ++ pkg_name ++ "-%{version}/")++)) (sort (dataFiles pkgDesc)) listDirs :: [FilePath] -> [FilePath] listDirs = nub . concatMap (map joinPath . tail . inits) . nub . map init . filter (\p -> length p > 1) . map splitDirectories@@ -252,10 +252,10 @@ put "%files" -- Add the license file to the main package only if it wouldn't -- otherwise be empty.- mapM_ (\ l -> put $ license_macro +-+ l) licensefiles+ mapM_ (\ l -> put $ license_macro +-+ l) (sort licensefiles) unless (null docs) $- put $ "%doc" +-+ unwords docs- mapM_ (\ p -> put $ "%{_bindir}/" ++ (if p == name then "%{name}" else p)) execs+ put $ "%doc" +-+ unwords (sort docs)+ mapM_ (\ p -> put $ "%{_bindir}/" ++ (if p == name then "%{name}" else p)) (sort execs) listDataFiles putNewline @@ -266,13 +266,13 @@ put "%defattr(-,root,root,-)" mapM_ (\ l -> put $ license_macro +-+ l) licensefiles unless binlib $- mapM_ (\ p -> put $ "%{_bindir}/" ++ (if p == name then "%{pkg_name}" else p)) execs+ mapM_ (\ p -> put $ "%{_bindir}/" ++ (if p == name then "%{pkg_name}" else p)) (sort execs) unless hasExecPkg listDataFiles putNewline- put $ "%files" +-+ ghcPkgDevel +-+ develFiles+ put $ "%files" +-+ ghcPkgDevel +-+ develFiles put "%defattr(-,root,root,-)" unless (null docs) $- put $ "%doc" +-+ unwords docs+ put $ "%doc" +-+ unwords (sort docs) putNewline put "%changelog"@@ -426,6 +426,7 @@ resolveLib "png" = "libpng16-compat-devel" resolveLib "pq" = "postgresql-devel" resolveLib "pthread" = "glibc-devel"+resolveLib "re2" = "re2-devel" resolveLib "resolv" = "glibc-devel" resolveLib "ruby" = "ruby-devel" resolveLib "sqlite3" = "sqlite3-devel"
test/Main.hs view
@@ -24,4 +24,4 @@ (\ref new -> ["diff", "-u", ref, new]) goldenFile specFile- (cabal2spec pid cid [] True cabalFile specFile)+ (cabal2spec pid cid mempty True cabalFile specFile)
test/golden-test-cases/blank-canvas.spec.golden view
@@ -124,8 +124,8 @@ %dir %{_datadir}/%{name}-%{version} %dir %{_datadir}/%{name}-%{version}/static %{_datadir}/%{name}-%{version}/static/index.html-%{_datadir}/%{name}-%{version}/static/jquery.js %{_datadir}/%{name}-%{version}/static/jquery-json.js+%{_datadir}/%{name}-%{version}/static/jquery.js %files -n ghc-%{name} -f ghc-%{name}.files %defattr(-,root,root,-)
test/golden-test-cases/hakyll.spec.golden view
@@ -140,25 +140,25 @@ %{_bindir}/hakyll-init %dir %{_datadir}/%{name}-%{version} %dir %{_datadir}/%{name}-%{version}/example-%dir %{_datadir}/%{name}-%{version}/example/posts+%dir %{_datadir}/%{name}-%{version}/example/css %dir %{_datadir}/%{name}-%{version}/example/images+%dir %{_datadir}/%{name}-%{version}/example/posts %dir %{_datadir}/%{name}-%{version}/example/templates-%dir %{_datadir}/%{name}-%{version}/example/css %dir %{_datadir}/%{name}-%{version}/templates-%{_datadir}/%{name}-%{version}/example/posts/2015-11-28-carpe-diem.markdown+%{_datadir}/%{name}-%{version}/example/about.rst+%{_datadir}/%{name}-%{version}/example/contact.markdown+%{_datadir}/%{name}-%{version}/example/css/default.css+%{_datadir}/%{name}-%{version}/example/images/haskell-logo.png+%{_datadir}/%{name}-%{version}/example/index.html+%{_datadir}/%{name}-%{version}/example/posts/2015-08-12-spqr.markdown %{_datadir}/%{name}-%{version}/example/posts/2015-10-07-rosa-rosa-rosam.markdown+%{_datadir}/%{name}-%{version}/example/posts/2015-11-28-carpe-diem.markdown %{_datadir}/%{name}-%{version}/example/posts/2015-12-07-tu-quoque.markdown-%{_datadir}/%{name}-%{version}/example/posts/2015-08-12-spqr.markdown %{_datadir}/%{name}-%{version}/example/site.hs-%{_datadir}/%{name}-%{version}/example/images/haskell-logo.png-%{_datadir}/%{name}-%{version}/example/templates/post-list.html-%{_datadir}/%{name}-%{version}/example/templates/default.html %{_datadir}/%{name}-%{version}/example/templates/archive.html+%{_datadir}/%{name}-%{version}/example/templates/default.html+%{_datadir}/%{name}-%{version}/example/templates/post-list.html %{_datadir}/%{name}-%{version}/example/templates/post.html-%{_datadir}/%{name}-%{version}/example/css/default.css-%{_datadir}/%{name}-%{version}/example/index.html-%{_datadir}/%{name}-%{version}/example/about.rst-%{_datadir}/%{name}-%{version}/example/contact.markdown %{_datadir}/%{name}-%{version}/templates/atom-item.xml %{_datadir}/%{name}-%{version}/templates/atom.xml %{_datadir}/%{name}-%{version}/templates/rss-item.xml
test/golden-test-cases/hmpfr.spec.golden view
@@ -79,9 +79,9 @@ %files %doc LICENSE %dir %{_datadir}/%{name}-%{version}+%{_datadir}/%{name}-%{version}/ChangeLog %{_datadir}/%{name}-%{version}/README.md %{_datadir}/%{name}-%{version}/dict.txt-%{_datadir}/%{name}-%{version}/ChangeLog %files -n ghc-%{name} -f ghc-%{name}.files %defattr(-,root,root,-)
test/golden-test-cases/hoogle.spec.golden view
@@ -116,18 +116,18 @@ %doc CHANGES.txt README.md %{_bindir}/%{name} %dir %{_datadir}/%{name}-%{version}-%dir %{_datadir}/%{name}-%{version}/misc %dir %{_datadir}/%{name}-%{version}/html %dir %{_datadir}/%{name}-%{version}/html/plugin-%{_datadir}/%{name}-%{version}/misc/settings.txt+%dir %{_datadir}/%{name}-%{version}/misc+%{_datadir}/%{name}-%{version}/html/*.css+%{_datadir}/%{name}-%{version}/html/*.html %{_datadir}/%{name}-%{version}/html/*.js %{_datadir}/%{name}-%{version}/html/*.png-%{_datadir}/%{name}-%{version}/html/*.css %{_datadir}/%{name}-%{version}/html/*.xml-%{_datadir}/%{name}-%{version}/html/*.html %{_datadir}/%{name}-%{version}/html/plugin/*.css %{_datadir}/%{name}-%{version}/html/plugin/*.js %{_datadir}/%{name}-%{version}/html/plugin/*.png+%{_datadir}/%{name}-%{version}/misc/settings.txt %files -n ghc-%{name} -f ghc-%{name}.files %defattr(-,root,root,-)
test/golden-test-cases/wai-cors.spec.golden view
@@ -100,15 +100,15 @@ %files %doc LICENSE %dir %{_datadir}/%{name}-%{version}-%dir %{_datadir}/%{name}-%{version}/test %dir %{_datadir}/%{name}-%{version}/examples-%{_datadir}/%{name}-%{version}/README.md+%dir %{_datadir}/%{name}-%{version}/test %{_datadir}/%{name}-%{version}/CHANGELOG.md-%{_datadir}/%{name}-%{version}/test/index.html-%{_datadir}/%{name}-%{version}/test/phantomjs.js+%{_datadir}/%{name}-%{version}/README.md %{_datadir}/%{name}-%{version}/examples/Scotty.hs-%{_datadir}/%{name}-%{version}/examples/Wai.hs %{_datadir}/%{name}-%{version}/examples/ServantWai.hs+%{_datadir}/%{name}-%{version}/examples/Wai.hs+%{_datadir}/%{name}-%{version}/test/index.html+%{_datadir}/%{name}-%{version}/test/phantomjs.js %files -n ghc-%{name} -f ghc-%{name}.files %defattr(-,root,root,-)