source: projects/specs/trunk/lib/libg/libghc-aeson/libghc-aeson-vl.spec @ 11386

Revision 11386, 3.4 KB checked in by ara_t, 6 years ago (diff)

new upstream release

Line 
1%define pkg_name    aeson
2%define pkg_version 1.2.3.0
3%define pkg_release 1%{?_dist_release}
4
5%define ghc_version 8.2.2
6
7Summary: Haskell libraries: %{pkg_name} and dependent libraries
8Name:    libghc-%{pkg_name}
9Version: %{pkg_version}
10Release: %{pkg_release}
11
12License: BSD3
13Group:   Applications/Text
14URL:     http://hackage.haskell.org
15
16Source0: %{pkg_name}-%{version}.tar.gz
17Source1: packages
18
19# num=11; for pkg in `cat packages`; do echo "Source${num}: ${pkg}.tar.gz"; num=`expr ${num} + 1`; done
20Source11: base-compat-0.9.3.tar.gz
21Source12: th-abstraction-0.2.6.0.tar.gz
22Source13: time-locale-compat-0.1.1.3.tar.gz
23Source14: transformers-compat-0.5.1.4.tar.gz
24Source15: uuid-types-1.0.3.tar.gz
25Source16: tagged-0.8.5.tar.gz
26
27# to fix wrong dependencies in cabal files
28# do not use '-'
29%define tagged_version 0.8.5
30Source51: tagged.cabal
31
32BuildRoot: %{_tmppath}/%{name}-%{version}-root
33
34BuildRequires: ghc haskell-platform
35BuildRequires: libffi-devel gmp-devel zlib-devel
36BuildRequires: libghc-dlist
37
38BuildRequires: docbook-utils docbook-utils-pdf docbook-style-xsl
39
40Requires: ghc haskell-platform
41Requires: libghc-dlist
42
43Vendor: Project Vine
44Distribution: Vine Linux
45Packager: ara_t
46
47
48%description
49Haskell libraries: %{pkg_name}
50
51
52%prep
53%{__rm} -rf ${RPM_BUILD_ROOT}
54%{__rm} -rf %{_builddir}/package.conf
55%{__rm} -rf ${HOME}/.ghc
56%setup -q -n %{pkg_name}-%{version}
57
58%build
59# Initialise the package db
60ghc-pkg init %{_builddir}/package.conf
61
62PKG_CONF_DIR=${RPM_BUILD_ROOT}%{_libdir}/ghc-%{ghc_version}/package.conf.d
63%{__mkdir_p} ${PKG_CONF_DIR}
64
65# install dependent packages
66cd %{_builddir}
67for pkg in `cat %{SOURCE1}`; do
68  %{__tar} xzf %{_sourcedir}/${pkg}.tar.gz
69  cd ${pkg}
70  # fix wrong dependencies
71  case ${pkg} in
72      "tagged-%{tagged_version}") %{__cp} %{SOURCE51} . ;;
73      *) ;;
74  esac
75
76  cabal configure \
77    --prefix=%{_prefix} \
78    --libdir=%{_libdir}/ghc-lib/%{name}/${pkg} \
79    --libsubdir= \
80    --datadir=%{_datadir}/%{name}/${pkg} \
81    --datasubdir= \
82    --docdir=%{_docdir}/%{name}/${pkg}
83
84  cabal build
85  cabal haddock || : # avoid Error
86  cabal copy --destdir=${RPM_BUILD_ROOT}
87  cabal register --inplace
88  cabal register --gen-pkg-config=${PKG_CONF_DIR}/%{name}_${pkg}.conf
89  cd ..
90done
91
92# build
93cd %{_builddir}/%{pkg_name}-%{version}
94cabal configure \
95    --prefix=%{_prefix} \
96    --libdir=%{_libdir}/ghc-lib/%{name}/%{pkg_name}-%{version} \
97    --libsubdir= \
98    --datadir=%{_datadir}/%{name}/%{pkg_name}-%{version} \
99    --datasubdir= \
100    --docdir=%{_docdir}/%{name}/%{pkg_name}-%{version}
101
102cabal build
103cabal haddock
104cabal copy --destdir=${RPM_BUILD_ROOT}
105cabal register --inplace
106cabal register --gen-pkg-config=${PKG_CONF_DIR}/%{pkg_name}-%{version}.conf
107
108%install
109cabal copy --destdir=${RPM_BUILD_ROOT}
110
111%{__cp} changelog.md LICENSE README.markdown \
112        ${RPM_BUILD_ROOT}%{_docdir}/%{name}/%{pkg_name}-%{version}
113
114%clean
115%{__rm} -rf ${RPM_BUILD_ROOT}
116
117%post
118ghc-pkg recache
119
120%postun
121ghc-pkg recache
122
123
124%files
125%defattr(-, root, root)
126%{_libdir}/ghc-%{ghc_version}/
127%{_libdir}/ghc-lib/
128%{_datadir}/
129
130
131%changelog
132* Tue Jan 09 2018 Toshiaki Ara <ara_t@384.jp> 1.2.3.0-1
133- update to 1.2.3.0
134- build using ghc-8.2.2
135
136* Fri Feb 03 2017 Toshiaki Ara <ara_t@384.jp> 0.11.3.0-1
137- update to 0.11.3.0
138- build using ghc-8.0.1
139
140* Wed May 04 2016 Toshiaki Ara <ara_t@384.jp> 0.9.0.1-3
141- rebuilt
142
143* Tue Apr 12 2016 Toshiaki Ara <ara_t@384.jp> 0.9.0.1-2
144- correct SPEC file
145
146* Tue Mar 01 2016 Toshiaki Ara <ara_t@384.jp> 0.9.0.1-1
147- new package
Note: See TracBrowser for help on using the repository browser.