|
@@ -1,13 +1,11 @@
|
|
|
%define pkg_name haskell-platform
|
|
|
%define year_version 2015
|
|
|
%define pkg_version 7.10.3
|
|
|
-%define pkg_release 2%{?_dist_release}
|
|
|
+%define pkg_release 3%{?_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
|
|
@@ -29,8 +27,7 @@ Source0: %{name}-%{pkg_version}.tar.gz
|
|
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{pkg_version}-root
|
|
|
|
|
|
-BuildRequires: ghc cabal-install
|
|
|
-BuildRequires: ghc-bindist
|
|
|
+BuildRequires: ghc
|
|
|
BuildRequires: gmp-devel zlib-devel freeglut-devel
|
|
|
BuildRequires: libffi-devel
|
|
|
BuildRequires: docbook-utils docbook-utils-pdf docbook-style-xsl
|
|
@@ -67,23 +64,12 @@ Group: Applications/Languages
|
|
|
|
|
|
Requires: ghc = %{ghc_version}
|
|
|
Requires: freeglut
|
|
|
+Requires: gmp-devel
|
|
|
|
|
|
%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
|
|
@@ -124,60 +110,71 @@ HappyはHaskell用の構文解析器生成器のシステムで、C用ツール
|
|
|
%prep
|
|
|
%{__rm} -rf ${RPM_BUILD_ROOT}
|
|
|
%setup -q -n %{name}-%{pkg_version}
|
|
|
+%{__cat} etc/build.packages | \
|
|
|
+ %{__sed} -e /hscolour/d | \
|
|
|
+ %{__sed} -e /cabal-install/d > build.packages
|
|
|
|
|
|
%build
|
|
|
-# build hptool
|
|
|
-./platform.sh
|
|
|
+PKGCONFDIR=${RPM_BUILD_ROOT}%{_libdir}/ghc-%{ghc_version}/package.conf.d/%{name}
|
|
|
+%{__mkdir_p} ${PKGCONFDIR}
|
|
|
|
|
|
-# build haskell-platform
|
|
|
+export PATH=${RPM_BUILD_ROOT}%{_bindir}:${PATH}
|
|
|
export LANG=en_US.utf8
|
|
|
-hptool/dist/build/hptool/hptool --prefix=%{_prefix} \
|
|
|
- %{_usrsrc}/ghc-%{ghc_version}-%{rpmarch}-vine-linux.tar.bz2 \
|
|
|
- build-target
|
|
|
+
|
|
|
+# build and install
|
|
|
+cd packages
|
|
|
+for pkg in `cat ../build.packages`; do
|
|
|
+ cd ${pkg}
|
|
|
+ ghc --make Setup
|
|
|
+ if [ ${pkg} = "alex-%{alex_version}" ] || \
|
|
|
+ [ ${pkg} = "happy-%{happy_version}" ]
|
|
|
+ then
|
|
|
+ ./Setup configure \
|
|
|
+ --user \
|
|
|
+ --prefix=%{_prefix} \
|
|
|
+ --datadir=%{_datadir}/${pkg} \
|
|
|
+ --datasubdir= \
|
|
|
+ --docdir=%{_docdir}/${pkg}
|
|
|
+ else
|
|
|
+ ./Setup configure \
|
|
|
+ --user \
|
|
|
+ --prefix=%{_prefix} \
|
|
|
+ --libdir=%{_libdir}/%{name}/${pkg} \
|
|
|
+ --libsubdir= \
|
|
|
+ --datadir=%{_datadir}/%{name}/${pkg} \
|
|
|
+ --datasubdir= \
|
|
|
+ --docdir=%{_docdir}/%{name}-%{year_version}.%{pkg_version}/${pkg}
|
|
|
+ fi
|
|
|
+
|
|
|
+ ./Setup build
|
|
|
+ ./Setup haddock || :
|
|
|
+ ./Setup copy --destdir=${RPM_BUILD_ROOT}
|
|
|
+ ./Setup register --inplace
|
|
|
+ ./Setup register --gen-pkg-config=${PKGCONFDIR}/${pkg}
|
|
|
+ cd ..
|
|
|
+done
|
|
|
|
|
|
%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-*
|
|
|
+# copy document files each directory
|
|
|
+%{__cp} LICENSE README \
|
|
|
+ ${RPM_BUILD_ROOT}%{_docdir}/%{name}-%{year_version}.%{pkg_version}
|
|
|
+%{__cp} packages/alex-%{alex_version}/{ANNOUNCE,README,TODO} \
|
|
|
+ ${RPM_BUILD_ROOT}%{_docdir}/alex-%{alex_version}/
|
|
|
+%{__cp} packages/happy-%{happy_version}/{ANNOUNCE,CHANGES,README,TODO} \
|
|
|
+ ${RPM_BUILD_ROOT}%{_docdir}/happy-%{happy_version}/
|
|
|
|
|
|
%clean
|
|
|
%{__rm} -rf ${RPM_BUILD_ROOT}
|
|
|
|
|
|
%post base
|
|
|
-cd %{_usr}/ghc-%{ghc_version}-%{rpmarch}/etc/registrations
|
|
|
+cd %{_libdir}/ghc-%{ghc_version}/package.conf.d/%{name}
|
|
|
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
|
|
|
+cd %{_libdir}/ghc-%{ghc_version}/package.conf.d/%{name}
|
|
|
for conf in *
|
|
|
do
|
|
|
ghc-pkg unregister --verbose=0 --force $conf 2> /dev/null
|
|
@@ -188,28 +185,26 @@ done
|
|
|
|
|
|
%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
|
|
|
+%{_libdir}/ghc-%{ghc_version}/package.conf.d/%{name}
|
|
|
+%{_libdir}/%{name}/
|
|
|
+%{_datadir}/%{name}/
|
|
|
+%{_docdir}/%{name}-%{year_version}.%{pkg_version}/
|
|
|
|
|
|
%files -n alex
|
|
|
-%doc packages/alex-%{alex_version}/LICENSE
|
|
|
-%doc packages/alex-%{alex_version}/README
|
|
|
%{_bindir}/alex
|
|
|
%{_datadir}/alex-%{alex_version}/
|
|
|
+%{_docdir}/alex-%{alex_version}/
|
|
|
|
|
|
%files -n happy
|
|
|
-%doc packages/happy-%{happy_version}/LICENSE
|
|
|
-%doc packages/happy-%{happy_version}/README
|
|
|
%{_bindir}/happy
|
|
|
%{_datadir}/happy-%{happy_version}/
|
|
|
+%{_docdir}/happy-%{happy_version}/
|
|
|
|
|
|
|
|
|
%changelog
|
|
|
+* Tue May 03 2016 Toshiaki Ara <ara_t@384.jp> 7.10.3-3
|
|
|
+- modify SPEC file without usage of cabal-install
|
|
|
+
|
|
|
* Mon Apr 11 2016 Toshiaki Ara <ara_t@384.jp> 7.10.3-2
|
|
|
- correct SPEC file
|
|
|
|