[packages/shellcheck] new, version 0.3.7

glen glen at pld-linux.org
Mon Oct 5 12:24:08 CEST 2015


commit 29f04695006614339d004dbefe3fed030b1d1c26
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Mon Oct 5 13:23:22 2015 +0300

    new, version 0.3.7
    
    based on fedora ShellCheck package, 43dbf72
    does not build, need pldize build process

 ShellCheck-disable-TemplateHaskell-runTests.patch | 117 ++++++++++++++++++++++
 shellcheck.spec                                   | 111 ++++++++++++++++++++
 2 files changed, 228 insertions(+)
---
diff --git a/shellcheck.spec b/shellcheck.spec
new file mode 100644
index 0000000..e7b1fc7
--- /dev/null
+++ b/shellcheck.spec
@@ -0,0 +1,111 @@
+#
+# Conditional build:
+%bcond_with	tests		# disable all tests for now to avoid linking QuickCheck
+%bcond_with	prof		# disable profiling symbols
+
+%define		pkg_name	ShellCheck
+Summary:	Shell script analysis tool
+Name:		shellcheck
+Version:	0.3.7
+Release:	0.1
+License:	AGPL v3+
+Group:		Development
+Source0:	https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz
+# Source0-md5:	5e570545d9168e085c465e0fd8902340
+Patch0:		ShellCheck-disable-TemplateHaskell-runTests.patch
+URL:		http://www.shellcheck.net/about.html
+BuildRequires:	ghc-Cabal-devel
+BuildRequires:	ghc-rpm-macros
+# Begin cabal-rpm deps:
+BuildRequires:	chrpath
+BuildRequires:	ghc-containers-devel
+BuildRequires:	ghc-directory-devel
+BuildRequires:	ghc-json-devel
+BuildRequires:	ghc-mtl-devel
+BuildRequires:	ghc-parsec-devel
+BuildRequires:	ghc-regex-tdfa-devel
+BuildRequires:	ghc-transformers-devel
+%if %{with tests}
+BuildRequires:	ghc-QuickCheck-devel
+%endif
+# End cabal-rpm deps
+BuildRequires:	pandoc
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+The goals of ShellCheck are:
+- To point out and clarify typical beginner's syntax issues, that
+  causes a shell to give cryptic error messages.
+- To point out and clarify typical intermediate level semantic
+  problems, that causes a shell to behave strangely and
+  counter-intuitively.
+- To point out subtle caveats, corner cases and pitfalls, that may
+  cause an advanced user's otherwise working script to fail under future
+  circumstances.
+
+%package -n ghc-%{pkg_name}
+Summary:	Haskell %{pkg_name} library
+
+%description -n ghc-%{pkg_name}
+This package provides the Haskell %{pkg_name} shared library.
+
+%package -n ghc-%{pkg_name}-devel
+Summary:	Haskell %{pkg_name} library development files
+Requires:	ghc-compiler = %{ghc_version}
+Provides:	ghc-%{pkg_name}-static = %{version}-%{release}
+Requires(post):	ghc-compiler = %{ghc_version}
+Requires(postun):	ghc-compiler = %{ghc_version}
+Requires:	ghc-%{pkg_name} = %{version}-%{release}
+
+%description -n ghc-%{pkg_name}-devel
+This package provides the Haskell %{pkg_name} library development
+files.
+
+%prep
+%setup -q
+%if %{without tests}
+%patch0 -p1
+%endif
+
+%build
+LANG=en_US.utf8
+%ghc_lib_build
+
+pandoc -s -t man shellcheck.1.md -o shellcheck.1
+
+%check
+%if %{with tests}
+%cabal test
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+%ghc_lib_install
+
+cp -p shellcheck.1 $RPM_BUILD_ROOT%{_mandir}/man1/shellcheck.1
+
+%ghc_fix_dynamic_rpath shellcheck
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post -n ghc-%{pkg_name}-devel
+%ghc_pkg_recache
+
+%postun -n ghc-%{pkg_name}-devel
+%ghc_pkg_recache
+
+%files
+%defattr(644,root,root,755)
+%doc LICENSE
+%doc README.md
+%attr(755,root,root) %{_bindir}/shellcheck
+%{_mandir}/man1/shellcheck.1*
+
+%files -n ghc-%{pkg_name} -f ghc-%{pkg_name}.files
+%defattr(644,root,root,755)
+%doc LICENSE
+
+%files -n ghc-%{pkg_name}-devel -f ghc-%{pkg_name}-devel.files
+%defattr(644,root,root,755)
+%doc README.md
diff --git a/ShellCheck-disable-TemplateHaskell-runTests.patch b/ShellCheck-disable-TemplateHaskell-runTests.patch
new file mode 100644
index 0000000..aa6e774
--- /dev/null
+++ b/ShellCheck-disable-TemplateHaskell-runTests.patch
@@ -0,0 +1,117 @@
+diff --git i/ShellCheck.cabal w/ShellCheck.cabal
+index 6e46dfe..8223f3a 100644
+--- i/ShellCheck.cabal
++++ w/ShellCheck.cabal
+@@ -43,8 +43,7 @@ library
+       json,
+       mtl,
+       parsec,
+-      regex-tdfa,
+-      QuickCheck >= 2.7.4
++      regex-tdfa
+     exposed-modules:
+       ShellCheck.Analytics
+       ShellCheck.AST
+@@ -66,8 +65,7 @@ executable shellcheck
+       mtl,
+       parsec,
+       regex-tdfa,
+-      transformers,
+-      QuickCheck >= 2.7.4
++      transformers
+     main-is: shellcheck.hs
+ 
+ test-suite test-shellcheck
+diff --git i/ShellCheck/Analytics.hs w/ShellCheck/Analytics.hs
+index fe2fcf4..80bc7a0 100644
+--- i/ShellCheck/Analytics.hs
++++ w/ShellCheck/Analytics.hs
+@@ -16,7 +16,7 @@
+     along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ -}
+ {-# LANGUAGE TemplateHaskell, FlexibleContexts #-}
+-module ShellCheck.Analytics (AnalysisOptions(..), defaultAnalysisOptions, filterByAnnotation, runAnalytics, shellForExecutable, runTests) where
++module ShellCheck.Analytics (AnalysisOptions(..), defaultAnalysisOptions, filterByAnnotation, runAnalytics, shellForExecutable) where
+ 
+ import Control.Arrow (first)
+ import Control.Monad
+@@ -32,11 +32,9 @@ import Debug.Trace
+ import ShellCheck.AST
+ import ShellCheck.Options
+ import ShellCheck.Data
+-import ShellCheck.Parser hiding (runTests)
++import ShellCheck.Parser
+ import ShellCheck.Regex
+ import qualified Data.Map as Map
+-import Test.QuickCheck.All (forAllProperties)
+-import Test.QuickCheck.Test (quickCheckWithResult, stdArgs, maxSuccess)
+ 
+ data Parameters = Parameters {
+     variableFlow :: [StackData],
+@@ -3310,7 +3308,3 @@ checkMaskedReturns _ t@(T_SimpleCommand id _ (cmd:rest)) = potentially $ do
+         T_DollarExpansion {} -> True
+         _ -> False
+ checkMaskedReturns _ _ = return ()
+-
+-
+-return []
+-runTests =  $( [| $(forAllProperties) (quickCheckWithResult (stdArgs { maxSuccess = 1 }) ) |])
+diff --git i/ShellCheck/Parser.hs w/ShellCheck/Parser.hs
+index fd2cbea..0ece932 100644
+--- i/ShellCheck/Parser.hs
++++ w/ShellCheck/Parser.hs
+@@ -16,7 +16,7 @@
+     along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ -}
+ {-# LANGUAGE NoMonomorphismRestriction, TemplateHaskell, FlexibleContexts #-}
+-module ShellCheck.Parser (Note(..), Severity(..), parseShell, ParseResult(..), ParseNote(..), sortNotes, noteToParseNote, runTests, readScript) where
++module ShellCheck.Parser (Note(..), Severity(..), parseShell, ParseResult(..), ParseNote(..), sortNotes, noteToParseNote, readScript) where
+ 
+ import ShellCheck.AST
+ import ShellCheck.Data
+@@ -34,7 +34,6 @@ import Prelude hiding (readList)
+ import System.IO
+ import Text.Parsec.Error
+ import GHC.Exts (sortWith)
+-import Test.QuickCheck.All (quickCheckAll)
+ 
+ backslash = char '\\'
+ linefeed = optional carriageReturn >> char '\n'
+@@ -2163,7 +2162,3 @@ parseShell options filename contents =
+ 
+ lt x = trace (show x) x
+ ltt t = trace (show t)
+-
+-return []
+-runTests = $quickCheckAll
+-
+diff --git i/ShellCheck/Simple.hs w/ShellCheck/Simple.hs
+index 71cde43..70f769c 100644
+--- i/ShellCheck/Simple.hs
++++ w/ShellCheck/Simple.hs
+@@ -16,14 +16,13 @@
+     along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ -}
+ {-# LANGUAGE TemplateHaskell #-}
+-module ShellCheck.Simple (shellCheck, ShellCheckComment, scLine, scColumn, scSeverity, scCode, scMessage, runTests) where
++module ShellCheck.Simple (shellCheck, ShellCheckComment, scLine, scColumn, scSeverity, scCode, scMessage) where
+ 
+ import Data.List
+ import Data.Maybe
+-import ShellCheck.Analytics hiding (runTests)
++import ShellCheck.Analytics
+ import ShellCheck.Options
+-import ShellCheck.Parser hiding (runTests)
+-import Test.QuickCheck.All (quickCheckAll)
++import ShellCheck.Parser
+ import Text.Parsec.Pos
+ 
+ shellCheck :: AnalysisOptions -> String -> [ShellCheckComment]
+@@ -74,7 +73,3 @@ prop_optionDisablesIssue1 =
+ 
+ prop_optionDisablesIssue2 =
+     null $ shellCheck (defaultAnalysisOptions { optionExcludes = [2148, 1037] }) "echo \"$10\""
+-
+-return []
+-runTests = $quickCheckAll
+-
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/shellcheck.git/commitdiff/29f04695006614339d004dbefe3fed030b1d1c26



More information about the pld-cvs-commit mailing list