diff --git a/ShellCheck-skip-TemplateHaskell-on-ARM.patch b/ShellCheck-skip-TemplateHaskell-on-ARM.patch
new file mode 100644
index 0000000..824805d
--- /dev/null
+++ b/ShellCheck-skip-TemplateHaskell-on-ARM.patch
@@ -0,0 +1,72 @@
+diff -up ShellCheck-0.3.4/ShellCheck/Analytics.hs~ ShellCheck-0.3.4/ShellCheck/Analytics.hs
+--- ShellCheck-0.3.4/ShellCheck/Analytics.hs~ 2014-07-09 10:52:01.000000000 +0900
++++ ShellCheck-0.3.4/ShellCheck/Analytics.hs 2014-09-22 11:30:02.572576093 +0900
+@@ -15,8 +15,7 @@
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see .
+ -}
+-{-# LANGUAGE TemplateHaskell #-}
+-module ShellCheck.Analytics (AnalysisOption(..), filterByAnnotation, runAnalytics, shellForExecutable, runTests) where
++module ShellCheck.Analytics (AnalysisOption(..), filterByAnnotation, runAnalytics, shellForExecutable) where
+
+ import Control.Arrow (first)
+ import Control.Monad
+@@ -2879,7 +2878,3 @@ checkFindActionPrecedence params = check
+ param <- getLiteralString t
+ return $ param `elem` strs
+ warnFor t = warn (getId t) 2146 "This action ignores everything before the -o. Use \\( \\) to group."
+-
+-return []
+-runTests = $quickCheckAll
+-
+diff -up ShellCheck-0.3.4/ShellCheck/Parser.hs~ ShellCheck-0.3.4/ShellCheck/Parser.hs
+--- ShellCheck-0.3.4/ShellCheck/Parser.hs~ 2014-07-09 10:52:01.000000000 +0900
++++ ShellCheck-0.3.4/ShellCheck/Parser.hs 2014-09-22 11:30:32.801636172 +0900
+@@ -15,8 +15,8 @@
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see .
+ -}
+-{-# LANGUAGE NoMonomorphismRestriction, TemplateHaskell #-}
+-module ShellCheck.Parser (Note(..), Severity(..), parseShell, ParseResult(..), ParseNote(..), sortNotes, noteToParseNote, runTests) where
++{-# LANGUAGE NoMonomorphismRestriction #-}
++module ShellCheck.Parser (Note(..), Severity(..), parseShell, ParseResult(..), ParseNote(..), sortNotes, noteToParseNote) where
+
+ import ShellCheck.AST
+ import ShellCheck.Data
+@@ -2093,7 +2093,3 @@ parseShell filename contents =
+
+ lt x = trace (show x) x
+ ltt t = trace (show t)
+-
+-return []
+-runTests = $quickCheckAll
+-
+diff -up ShellCheck-0.3.4/ShellCheck/Simple.hs~ ShellCheck-0.3.4/ShellCheck/Simple.hs
+--- ShellCheck-0.3.4/ShellCheck/Simple.hs~ 2014-07-09 10:52:01.000000000 +0900
++++ ShellCheck-0.3.4/ShellCheck/Simple.hs 2014-09-22 11:29:17.715486995 +0900
+@@ -15,15 +15,14 @@
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see .
+ -}
+-{-# 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 ShellCheck.Parser hiding (runTests)
+ import ShellCheck.Analytics hiding (runTests)
+ import Data.Maybe
+ import Text.Parsec.Pos
+ import Data.List
+-import Test.QuickCheck.All (quickCheckAll)
++--import Test.QuickCheck.All (quickCheckAll)
+
+ shellCheck :: String -> [AnalysisOption] -> [ShellCheckComment]
+ shellCheck script options =
+@@ -66,7 +65,3 @@ prop_commentDisablesAnalysisIssue1 =
+ null $ shellCheck "#shellcheck disable=SC2086\necho $1" []
+ prop_commentDisablesAnalysisIssue2 =
+ null $ shellCheck "#shellcheck disable=SC2086\n#lol\necho $1" []
+-
+-return []
+-runTests = $quickCheckAll
+-
diff --git a/ShellCheck.spec b/ShellCheck.spec
index 1821cd9..8ff58c0 100644
--- a/ShellCheck.spec
+++ b/ShellCheck.spec
@@ -1,5 +1,11 @@
%global pkg_name ShellCheck
+
+%ifnarch %{arm}
%global with_tests 1
+%endif
+
+# no useful debuginfo for Haskell packages without C sources
+%global debug_package %{nil}
Name: %{pkg_name}
Version: 0.3.4
@@ -8,7 +14,8 @@ Summary: Tool for checking common errors in POSIX shell scripts
License: AGPLv3+
URL: http://www.shellcheck.net/about.html
-Source0: http://hackage.haskell.org/package/ShellCheck-%{version}/ShellCheck-%{version}.tar.gz
+Source0: http://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
+Patch0: ShellCheck-skip-TemplateHaskell-on-ARM.patch
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-rpm-macros
@@ -21,7 +28,6 @@ BuildRequires: ghc-json-devel
BuildRequires: ghc-mtl-devel
BuildRequires: ghc-parsec-devel
BuildRequires: ghc-regex-compat-devel
-BuildRequires: ghc-transformers-devel
# End cabal-rpm deps
BuildRequires: pandoc
@@ -60,13 +66,16 @@ This package provides the Haskell %{name} library development files.
%prep
%setup -q
+%ifarch %{arm}
+%patch0 -p1 -b .orig
+%endif
%build
LANG=en_US.utf8
%ghc_lib_build
-pandoc -s -t man shellcheck.1.md -o $@ shellcheck.1
+pandoc -s -t man shellcheck.1.md -o shellcheck.1
%install
@@ -78,15 +87,9 @@ install -Dpm 0644 shellcheck.1 %{buildroot}%{_mandir}/man1/shellcheck.1
%check
+%if %{with tests}
%cabal test
-
-
-%post -n ghc-%{name}
-%{_sbindir}/ldconfig
-
-
-%postun -n ghc-%{name}
-%{_sbindir}/ldconfig
+%endif
%post -n ghc-%{name}-devel
@@ -117,6 +120,7 @@ install -Dpm 0644 shellcheck.1 %{buildroot}%{_mandir}/man1/shellcheck.1
- bumped to version 0.3.4
- switched to hackage for the source tarball
- tests are now driven by cabal
+- skip tests on ARM since TemplateHaskell fails
* Fri Sep 5 2014 Jens Petersen - 0.3.3-2
- reenable pandoc on ARM