| 1 | %define pkg_name haskell-platform |
|---|
| 2 | %define year_version 2015 |
|---|
| 3 | %define pkg_version 7.10.3 |
|---|
| 4 | %define pkg_release 3%{?_dist_release} |
|---|
| 5 | |
|---|
| 6 | %define ghc_version 7.10.3 |
|---|
| 7 | %define alex_version 3.1.4 |
|---|
| 8 | %define happy_version 1.19.5 |
|---|
| 9 | |
|---|
| 10 | %ifarch %{ix86} |
|---|
| 11 | %define rpmarch i386 |
|---|
| 12 | %endif |
|---|
| 13 | %ifarch x86_64 |
|---|
| 14 | %define rpmarch x86_64 |
|---|
| 15 | %endif |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | Summary: An advanced purely-functional programming language |
|---|
| 19 | Name: %{pkg_name} |
|---|
| 20 | Version: %{year_version}.%{pkg_version} |
|---|
| 21 | Release: %{pkg_release} |
|---|
| 22 | |
|---|
| 23 | License: BSD-like |
|---|
| 24 | Group: Applications/Languages |
|---|
| 25 | |
|---|
| 26 | Source0: %{name}-%{pkg_version}.tar.gz |
|---|
| 27 | |
|---|
| 28 | BuildRoot: %{_tmppath}/%{name}-%{pkg_version}-root |
|---|
| 29 | |
|---|
| 30 | BuildRequires: ghc |
|---|
| 31 | BuildRequires: gmp-devel zlib-devel freeglut-devel |
|---|
| 32 | BuildRequires: libffi-devel |
|---|
| 33 | BuildRequires: docbook-utils docbook-utils-pdf docbook-style-xsl |
|---|
| 34 | BuildRequires: hscolour |
|---|
| 35 | |
|---|
| 36 | Requires: haskell-platform-base = %{version} |
|---|
| 37 | Requires: alex |
|---|
| 38 | Requires: happy |
|---|
| 39 | Requires: cabal-install |
|---|
| 40 | Requires: hscolour |
|---|
| 41 | |
|---|
| 42 | Vendor: Project Vine |
|---|
| 43 | Distribution: Vine Linux |
|---|
| 44 | Packager: ara_t |
|---|
| 45 | |
|---|
| 46 | |
|---|
| 47 | %description |
|---|
| 48 | Haskell is a computer programming language. |
|---|
| 49 | In particular, it is a polymorphically statically typed, lazy, purely |
|---|
| 50 | functional language, quite different from most other programming languages. |
|---|
| 51 | The language is named for Haskell Brooks Curry, whose work in mathematical |
|---|
| 52 | logic serves as a foundation for functional languages. |
|---|
| 53 | |
|---|
| 54 | This is a meta package for installing haskell-platform, alex, happy and |
|---|
| 55 | cabal-install. |
|---|
| 56 | |
|---|
| 57 | |
|---|
| 58 | %package base |
|---|
| 59 | Version: %{version} |
|---|
| 60 | Summary: base package of haskell-platform |
|---|
| 61 | Summary(ja): haskell-platformの基本パッケージ |
|---|
| 62 | License: BSD-like |
|---|
| 63 | Group: Applications/Languages |
|---|
| 64 | |
|---|
| 65 | Requires: ghc = %{ghc_version} |
|---|
| 66 | Requires: freeglut |
|---|
| 67 | Requires: gmp-devel |
|---|
| 68 | |
|---|
| 69 | %description base |
|---|
| 70 | Base package for haskell-platform without alex, cabal, happy and HsColour. |
|---|
| 71 | |
|---|
| 72 | |
|---|
| 73 | %package -n alex |
|---|
| 74 | Version: %{alex_version} |
|---|
| 75 | Summary: lexical analyser generator for Haskell |
|---|
| 76 | Summary(ja): Haskell用の構文解析器生成器 |
|---|
| 77 | License: BSD3 |
|---|
| 78 | Group: Applications/Text |
|---|
| 79 | |
|---|
| 80 | %description -n alex |
|---|
| 81 | Alex is a tool for generating lexical analysers in Haskell, |
|---|
| 82 | given a description of the tokens to be recognised |
|---|
| 83 | in the form of regular expressions. |
|---|
| 84 | It is similar to the tool lex or flex for C/C++. |
|---|
| 85 | |
|---|
| 86 | %description -l ja -n alex |
|---|
| 87 | AlexはHaskellで字句解析器を生成するツールで、 |
|---|
| 88 | トークン群の記述を正規表現の形式で認識します。 |
|---|
| 89 | C/C++用のlexやflexといったツールに似ています。 |
|---|
| 90 | |
|---|
| 91 | |
|---|
| 92 | %package -n happy |
|---|
| 93 | Version: %{happy_version} |
|---|
| 94 | Summary: a parser generator system for Haskell |
|---|
| 95 | Summary(ja): Haskell 用の構文解析器生成器 |
|---|
| 96 | License: BSD3 |
|---|
| 97 | Group: Applications/Text |
|---|
| 98 | |
|---|
| 99 | %description -n happy |
|---|
| 100 | Happy is a parser generator system for Haskell, similar to the tool 'yacc' |
|---|
| 101 | for C. Like 'yacc', it takes a file containing an annotated BNF specification |
|---|
| 102 | of a grammar and produces a Haskell module containing a parser for the grammar. |
|---|
| 103 | |
|---|
| 104 | %description -l ja -n happy |
|---|
| 105 | HappyはHaskell用の構文解析器生成器のシステムで、C用ツールの'yacc'に似ています。 |
|---|
| 106 | 'yacc'の様に注釈付きのBNF形式の文法の仕様を含んだファイルを受け取って、 |
|---|
| 107 | その文法の構文解析器を含んだHaskellモジュールを生成します。 |
|---|
| 108 | |
|---|
| 109 | |
|---|
| 110 | %prep |
|---|
| 111 | %{__rm} -rf ${RPM_BUILD_ROOT} |
|---|
| 112 | %setup -q -n %{name}-%{pkg_version} |
|---|
| 113 | %{__cat} etc/build.packages | \ |
|---|
| 114 | %{__sed} -e /hscolour/d | \ |
|---|
| 115 | %{__sed} -e /cabal-install/d > build.packages |
|---|
| 116 | |
|---|
| 117 | %build |
|---|
| 118 | PKGCONFDIR=${RPM_BUILD_ROOT}%{_libdir}/ghc-%{ghc_version}/package.conf.d/%{name} |
|---|
| 119 | %{__mkdir_p} ${PKGCONFDIR} |
|---|
| 120 | |
|---|
| 121 | export PATH=${RPM_BUILD_ROOT}%{_bindir}:${PATH} |
|---|
| 122 | export LANG=en_US.utf8 |
|---|
| 123 | |
|---|
| 124 | # build and install |
|---|
| 125 | cd packages |
|---|
| 126 | for pkg in `cat ../build.packages`; do |
|---|
| 127 | cd ${pkg} |
|---|
| 128 | ghc --make Setup |
|---|
| 129 | if [ ${pkg} = "alex-%{alex_version}" ] || \ |
|---|
| 130 | [ ${pkg} = "happy-%{happy_version}" ] |
|---|
| 131 | then |
|---|
| 132 | ./Setup configure \ |
|---|
| 133 | --user \ |
|---|
| 134 | --prefix=%{_prefix} \ |
|---|
| 135 | --datadir=%{_datadir}/${pkg} \ |
|---|
| 136 | --datasubdir= \ |
|---|
| 137 | --docdir=%{_docdir}/${pkg} |
|---|
| 138 | else |
|---|
| 139 | ./Setup configure \ |
|---|
| 140 | --user \ |
|---|
| 141 | --prefix=%{_prefix} \ |
|---|
| 142 | --libdir=%{_libdir}/%{name}/${pkg} \ |
|---|
| 143 | --libsubdir= \ |
|---|
| 144 | --datadir=%{_datadir}/%{name}/${pkg} \ |
|---|
| 145 | --datasubdir= \ |
|---|
| 146 | --docdir=%{_docdir}/%{name}-%{year_version}.%{pkg_version}/${pkg} |
|---|
| 147 | fi |
|---|
| 148 | |
|---|
| 149 | ./Setup build |
|---|
| 150 | ./Setup haddock || : |
|---|
| 151 | ./Setup copy --destdir=${RPM_BUILD_ROOT} |
|---|
| 152 | ./Setup register --inplace |
|---|
| 153 | ./Setup register --gen-pkg-config=${PKGCONFDIR}/${pkg} |
|---|
| 154 | cd .. |
|---|
| 155 | done |
|---|
| 156 | |
|---|
| 157 | %install |
|---|
| 158 | # copy document files each directory |
|---|
| 159 | %{__cp} LICENSE README \ |
|---|
| 160 | ${RPM_BUILD_ROOT}%{_docdir}/%{name}-%{year_version}.%{pkg_version} |
|---|
| 161 | %{__cp} packages/alex-%{alex_version}/{ANNOUNCE,README,TODO} \ |
|---|
| 162 | ${RPM_BUILD_ROOT}%{_docdir}/alex-%{alex_version}/ |
|---|
| 163 | %{__cp} packages/happy-%{happy_version}/{ANNOUNCE,CHANGES,README,TODO} \ |
|---|
| 164 | ${RPM_BUILD_ROOT}%{_docdir}/happy-%{happy_version}/ |
|---|
| 165 | |
|---|
| 166 | %clean |
|---|
| 167 | %{__rm} -rf ${RPM_BUILD_ROOT} |
|---|
| 168 | |
|---|
| 169 | %post base |
|---|
| 170 | cd %{_libdir}/ghc-%{ghc_version}/package.conf.d/%{name} |
|---|
| 171 | for conf in * |
|---|
| 172 | do |
|---|
| 173 | ghc-pkg register --verbose=0 --force $conf 2> /dev/null |
|---|
| 174 | done |
|---|
| 175 | |
|---|
| 176 | %preun base |
|---|
| 177 | cd %{_libdir}/ghc-%{ghc_version}/package.conf.d/%{name} |
|---|
| 178 | for conf in * |
|---|
| 179 | do |
|---|
| 180 | ghc-pkg unregister --verbose=0 --force $conf 2> /dev/null |
|---|
| 181 | done |
|---|
| 182 | |
|---|
| 183 | |
|---|
| 184 | %files |
|---|
| 185 | |
|---|
| 186 | %files base |
|---|
| 187 | %defattr(-, root, root) |
|---|
| 188 | %{_libdir}/ghc-%{ghc_version}/package.conf.d/%{name} |
|---|
| 189 | %{_libdir}/%{name}/ |
|---|
| 190 | %{_datadir}/%{name}/ |
|---|
| 191 | %{_docdir}/%{name}-%{year_version}.%{pkg_version}/ |
|---|
| 192 | |
|---|
| 193 | %files -n alex |
|---|
| 194 | %{_bindir}/alex |
|---|
| 195 | %{_datadir}/alex-%{alex_version}/ |
|---|
| 196 | %{_docdir}/alex-%{alex_version}/ |
|---|
| 197 | |
|---|
| 198 | %files -n happy |
|---|
| 199 | %{_bindir}/happy |
|---|
| 200 | %{_datadir}/happy-%{happy_version}/ |
|---|
| 201 | %{_docdir}/happy-%{happy_version}/ |
|---|
| 202 | |
|---|
| 203 | |
|---|
| 204 | %changelog |
|---|
| 205 | * Tue May 03 2016 Toshiaki Ara <ara_t@384.jp> 7.10.3-3 |
|---|
| 206 | - modify SPEC file without usage of cabal-install |
|---|
| 207 | |
|---|
| 208 | * Mon Apr 11 2016 Toshiaki Ara <ara_t@384.jp> 7.10.3-2 |
|---|
| 209 | - correct SPEC file |
|---|
| 210 | |
|---|
| 211 | * Fri Feb 19 2016 Toshiaki Ara <ara_t@384.jp> 7.10.3-1 |
|---|
| 212 | - update to 7.10.3 |
|---|
| 213 | |
|---|
| 214 | * Mon Feb 15 2016 Toshiaki Ara <ara_t@384.jp> 2013.2.0.0-4 |
|---|
| 215 | - delete subpackage cabal-install |
|---|
| 216 | - delete %{cabal_version} from Requires: cabal-install-%{cabal_version} |
|---|
| 217 | - add BuildRequires: libffi-devel |
|---|
| 218 | |
|---|
| 219 | * Thu Feb 11 2016 Toshiaki Ara <ara_t@384.jp> 2013.2.0.0-3 |
|---|
| 220 | - correct Requires |
|---|
| 221 | |
|---|
| 222 | * Thu Feb 11 2016 Toshiaki Ara <ara_t@384.jp> 2013.2.0.0-2 |
|---|
| 223 | - install Haskell libraries into %{_libdir}/ghc-lib |
|---|
| 224 | - add BuildRequires: hscolour |
|---|
| 225 | - devide insto subpackages |
|---|
| 226 | |
|---|
| 227 | * Thu Feb 04 2016 Toshiaki Ara <ara_t@384.jp> 2013.2.0.0-1 |
|---|
| 228 | - new package |
|---|