summaryrefslogtreecommitdiff
path: root/happy.spec
diff options
context:
space:
mode:
Diffstat (limited to 'happy.spec')
-rw-r--r--happy.spec80
1 files changed, 80 insertions, 0 deletions
diff --git a/happy.spec b/happy.spec
new file mode 100644
index 0000000..7e0d334
--- /dev/null
+++ b/happy.spec
@@ -0,0 +1,80 @@
+%bcond_with tests
+
+Name: happy
+Version: 1.20.1.1
+Release: 1
+Summary: Happy is a parser generator for Haskell
+License: BSD-2-Clause
+URL: https://hackage.haskell.org/package/%{name}
+Source0: https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
+BuildRequires: autoconf
+BuildRequires: docbook-dtds
+BuildRequires: docbook-style-xsl
+BuildRequires: ghc-Cabal-devel
+BuildRequires: ghc-array-devel
+BuildRequires: ghc-array-prof
+BuildRequires: ghc-base-devel
+BuildRequires: ghc-base-prof
+BuildRequires: ghc-containers-devel
+BuildRequires: ghc-containers-prof
+BuildRequires: ghc-mtl-devel
+BuildRequires: ghc-mtl-prof
+BuildRequires: ghc-rpm-macros
+BuildRequires: libxml2
+BuildRequires: libxslt
+ExcludeArch: %{ix86}
+%if %{with tests}
+BuildRequires: ghc-process-devel
+BuildRequires: ghc-process-prof
+%endif
+
+%description
+Happy is a parser generator for Haskell. Given a grammar specification in BNF,
+Happy generates Haskell code to parse the grammar. Happy works in a similar way
+to the 'yacc' tool for C.
+
+%prep
+%autosetup
+find . -type f -exec chmod -x {} +
+
+%build
+%define cabal_configure_options -f-bootstrap
+%ghc_bin_build
+cd doc
+autoreconf
+%configure
+%make_build html
+
+%install
+%ghc_bin_install
+# drop artifacts from autoconf that differ across builds to fix build-compare
+rm -rf doc/autom4te.cache doc/config.log doc/config.status
+
+install -D --mode=444 doc/%{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1
+
+%check
+%cabal_test
+
+%files
+%license LICENSE
+%doc ChangeLog.md doc examples
+%{_bindir}/%{name}
+%dir %{_datadir}/%{name}-%{version}
+%{_mandir}/man1/*
+%{_datadir}/%{name}-%{version}/GLR_Base
+%{_datadir}/%{name}-%{version}/GLR_Lib
+%{_datadir}/%{name}-%{version}/GLR_Lib-ghc
+%{_datadir}/%{name}-%{version}/GLR_Lib-ghc-debug
+%{_datadir}/%{name}-%{version}/HappyTemplate
+%{_datadir}/%{name}-%{version}/HappyTemplate-arrays
+%{_datadir}/%{name}-%{version}/HappyTemplate-arrays-coerce
+%{_datadir}/%{name}-%{version}/HappyTemplate-arrays-coerce-debug
+%{_datadir}/%{name}-%{version}/HappyTemplate-arrays-debug
+%{_datadir}/%{name}-%{version}/HappyTemplate-arrays-ghc
+%{_datadir}/%{name}-%{version}/HappyTemplate-arrays-ghc-debug
+%{_datadir}/%{name}-%{version}/HappyTemplate-coerce
+%{_datadir}/%{name}-%{version}/HappyTemplate-ghc
+
+%changelog
+* Tue Aug 22 2023 Lin Runze <lrzlin@163.com> 1.20.1.1-1
+- Initial packaging (Version 1.20.1.1)