%define pkg_name haskell-platform %define year_version 2015 %define pkg_version 7.10.3 %define pkg_release 2%{?_dist_release} %define ghc_version 7.10.3 %define alex_version 3.1.4 %define cabal_version 1.22.6.0 %define happy_version 1.19.5 %define hscolour_version 1.23 %ifarch %{ix86} %define rpmarch i386 %endif %ifarch x86_64 %define rpmarch x86_64 %endif Summary: An advanced purely-functional programming language Name: %{pkg_name} Version: %{year_version}.%{pkg_version} Release: %{pkg_release} License: BSD-like Group: Applications/Languages Source0: %{name}-%{pkg_version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{pkg_version}-root BuildRequires: ghc cabal-install BuildRequires: ghc-bindist BuildRequires: gmp-devel zlib-devel freeglut-devel BuildRequires: libffi-devel BuildRequires: docbook-utils docbook-utils-pdf docbook-style-xsl BuildRequires: hscolour Requires: haskell-platform-base = %{version} Requires: alex Requires: happy Requires: cabal-install Requires: hscolour Vendor: Project Vine Distribution: Vine Linux Packager: ara_t %description Haskell is a computer programming language. In particular, it is a polymorphically statically typed, lazy, purely functional language, quite different from most other programming languages. The language is named for Haskell Brooks Curry, whose work in mathematical logic serves as a foundation for functional languages. This is a meta package for installing haskell-platform, alex, happy and cabal-install. %package base Version: %{version} Summary: base package of haskell-platform Summary(ja): haskell-platformの基本パッケージ License: BSD-like Group: Applications/Languages Requires: ghc = %{ghc_version} Requires: freeglut %description base Base package for haskell-platform without alex, cabal, happy and HsColour. # %package -n cabal-install # Version: %{cabal_version} # Summary: A command-line program simplifies the process of managing Haskell software # License: BSD3 # Group: Applications/Languages # %description -n cabal-install # The 'cabal' command-line program simplifies the process of # managing Haskell software by automating the fetching, configuration, # compilation and installation of Haskell libraries and programs. %package -n alex Version: %{alex_version} Summary: lexical analyser generator for Haskell Summary(ja): Haskell用の構文解析器生成器 License: BSD3 Group: Applications/Text %description -n alex Alex is a tool for generating lexical analysers in Haskell, given a description of the tokens to be recognised in the form of regular expressions. It is similar to the tool lex or flex for C/C++. %description -l ja -n alex AlexはHaskellで字句解析器を生成するツールで、 トークン群の記述を正規表現の形式で認識します。 C/C++用のlexやflexといったツールに似ています。 %package -n happy Version: %{happy_version} Summary: a parser generator system for Haskell Summary(ja): Haskell 用の構文解析器生成器 License: BSD3 Group: Applications/Text %description -n happy Happy is a parser generator system for Haskell, similar to the tool 'yacc' for C. Like 'yacc', it takes a file containing an annotated BNF specification of a grammar and produces a Haskell module containing a parser for the grammar. %description -l ja -n happy HappyはHaskell用の構文解析器生成器のシステムで、C用ツールの'yacc'に似ています。 'yacc'の様に注釈付きのBNF形式の文法の仕様を含んだファイルを受け取って、 その文法の構文解析器を含んだHaskellモジュールを生成します。 %prep %{__rm} -rf ${RPM_BUILD_ROOT} %setup -q -n %{name}-%{pkg_version} %build # build hptool ./platform.sh # build haskell-platform export LANG=en_US.utf8 hptool/dist/build/hptool/hptool --prefix=%{_prefix} \ %{_usrsrc}/ghc-%{ghc_version}-%{rpmarch}-vine-linux.tar.bz2 \ build-target %install # make directories for alex and happy %{__mkdir_p} ${RPM_BUILD_ROOT}%{_bindir} %{__mkdir_p} ${RPM_BUILD_ROOT}%{_libdir} %{__mkdir_p} ${RPM_BUILD_ROOT}%{_datadir} %{__mkdir_p} ${RPM_BUILD_ROOT}%{_docdir} %{__cp} -r build/target/usr/ ${RPM_BUILD_ROOT}/ # move files for subpackages cd ${RPM_BUILD_ROOT}%{_usr}/ghc-%{ghc_version}-%{rpmarch} ## alex %{__mv} bin/alex ${RPM_BUILD_ROOT}%{_bindir} %{__mv} share/alex-%{alex_version} ${RPM_BUILD_ROOT}%{_datadir} %{__rm} -rf lib/alex-%{alex_version} ## happy %{__mv} bin/happy ${RPM_BUILD_ROOT}%{_bindir} %{__mv} share/happy-%{happy_version} ${RPM_BUILD_ROOT}%{_datadir} %{__rm} -rf lib/happy-%{happy_version} ## delete files and folders from ghc, cabal and hscolour cd ${RPM_BUILD_ROOT}/usr/ghc-%{ghc_version}-%{rpmarch} %{__rm} -rf bin %{__rm} -rf lib/ghc-%{ghc_version} %{__rm} -rf lib/hscolour-%{hscolour_version} %{__rm} -rf share/hscolour-%{hscolour_version} %{__rm} -f etc/registrations/hscolour-%{hscolour_version} %{__rm} -rf share/doc %{__rm} -rf share/man %{__rm} -f haskell-platform.cabal %{__rm} -f version-* %clean %{__rm} -rf ${RPM_BUILD_ROOT} %post base cd %{_usr}/ghc-%{ghc_version}-%{rpmarch}/etc/registrations for conf in * do ghc-pkg register --verbose=0 --force $conf 2> /dev/null done %preun base cd %{_usr}/ghc-%{ghc_version}-%{rpmarch}/etc/registrations for conf in * do ghc-pkg unregister --verbose=0 --force $conf 2> /dev/null done %files %files base %defattr(-, root, root) %doc LICENSE README %{_usr}/ghc-%{ghc_version}-%{rpmarch}/ # %files -n cabal-install # %doc packages/cabal-install-%{cabal_version}/LICENSE # %doc packages/cabal-install-%{cabal_version}/README # %{_bindir}/cabal %files -n alex %doc packages/alex-%{alex_version}/LICENSE %doc packages/alex-%{alex_version}/README %{_bindir}/alex %{_datadir}/alex-%{alex_version}/ %files -n happy %doc packages/happy-%{happy_version}/LICENSE %doc packages/happy-%{happy_version}/README %{_bindir}/happy %{_datadir}/happy-%{happy_version}/ %changelog * Mon Apr 11 2016 Toshiaki Ara 7.10.3-2 - correct SPEC file * Fri Feb 19 2016 Toshiaki Ara 7.10.3-1 - update to 7.10.3 * Mon Feb 15 2016 Toshiaki Ara 2013.2.0.0-4 - delete subpackage cabal-install - delete %{cabal_version} from Requires: cabal-install-%{cabal_version} - add BuildRequires: libffi-devel * Thu Feb 11 2016 Toshiaki Ara 2013.2.0.0-3 - correct Requires * Thu Feb 11 2016 Toshiaki Ara 2013.2.0.0-2 - install Haskell libraries into %{_libdir}/ghc-lib - add BuildRequires: hscolour - devide insto subpackages * Thu Feb 04 2016 Toshiaki Ara 2013.2.0.0-1 - new package