source: projects/specs/trunk/h/haskell-platform/haskell-platform-vl.spec @ 10233

Revision 10233, 6.2 KB checked in by ara_t, 8 years ago (diff)

rebuild without cabal-install

Line 
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
18Summary: An advanced purely-functional programming language
19Name:    %{pkg_name}
20Version: %{year_version}.%{pkg_version}
21Release: %{pkg_release}
22
23License: BSD-like
24Group:   Applications/Languages
25
26Source0: %{name}-%{pkg_version}.tar.gz
27
28BuildRoot: %{_tmppath}/%{name}-%{pkg_version}-root
29
30BuildRequires: ghc
31BuildRequires: gmp-devel zlib-devel freeglut-devel
32BuildRequires: libffi-devel
33BuildRequires: docbook-utils docbook-utils-pdf docbook-style-xsl
34BuildRequires: hscolour
35
36Requires: haskell-platform-base = %{version}
37Requires: alex
38Requires: happy
39Requires: cabal-install
40Requires: hscolour
41
42Vendor: Project Vine
43Distribution: Vine Linux
44Packager: ara_t
45
46
47%description
48Haskell is a computer programming language.
49In particular, it is a polymorphically statically typed, lazy, purely
50functional language, quite different from most other programming languages.
51The language is named for Haskell Brooks Curry, whose work in mathematical
52logic serves as a foundation for functional languages.
53
54This is a meta package for installing haskell-platform, alex, happy and
55cabal-install.
56
57
58%package base
59Version:     %{version}
60Summary:     base package of haskell-platform
61Summary(ja): haskell-platformの基本パッケージ
62License:     BSD-like
63Group:       Applications/Languages
64
65Requires: ghc = %{ghc_version}
66Requires: freeglut
67Requires: gmp-devel
68
69%description base
70Base package for haskell-platform without alex, cabal, happy and HsColour.
71
72
73%package -n alex
74Version:     %{alex_version}
75Summary:     lexical analyser generator for Haskell
76Summary(ja): Haskell用の構文解析器生成器
77License:     BSD3
78Group:       Applications/Text
79
80%description -n alex
81Alex is a tool for generating lexical analysers in Haskell,
82given a description of the tokens to be recognised
83in the form of regular expressions.
84It is similar to the tool lex or flex for C/C++.
85
86%description -l ja -n alex
87AlexはHaskellで字句解析器を生成するツールで、
88トークン群の記述を正規表現の形式で認識します。
89C/C++用のlexやflexといったツールに似ています。
90
91
92%package -n happy
93Version:     %{happy_version}
94Summary:     a parser generator system for Haskell
95Summary(ja): Haskell 用の構文解析器生成器
96License:     BSD3
97Group:       Applications/Text
98
99%description -n happy
100Happy is a parser generator system for Haskell, similar to the tool 'yacc'
101for C. Like 'yacc', it takes a file containing an annotated BNF specification
102of a grammar and produces a Haskell module containing a parser for the grammar.
103
104%description -l ja -n happy
105Happyは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
118PKGCONFDIR=${RPM_BUILD_ROOT}%{_libdir}/ghc-%{ghc_version}/package.conf.d/%{name}
119%{__mkdir_p} ${PKGCONFDIR}
120
121export PATH=${RPM_BUILD_ROOT}%{_bindir}:${PATH}
122export LANG=en_US.utf8
123
124# build and install
125cd packages
126for 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 ..
155done
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
170cd %{_libdir}/ghc-%{ghc_version}/package.conf.d/%{name}
171for conf in *
172do
173  ghc-pkg register --verbose=0 --force $conf 2> /dev/null
174done
175
176%preun base
177cd %{_libdir}/ghc-%{ghc_version}/package.conf.d/%{name}
178for conf in *
179do
180  ghc-pkg unregister --verbose=0 --force $conf 2> /dev/null
181done
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
Note: See TracBrowser for help on using the repository browser.