]>
Commit | Line | Data |
---|---|---|
265a2f1b JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without prof # profiling library | |
4 | # | |
5 | %define pkgname hslua | |
6 | Summary: A Lua language interpreter embedding in Haskell | |
7 | Summary(pl.UTF-8): Osadzanie interpretera języka Lua w Haskellu | |
8 | Name: ghc-%{pkgname} | |
cce1bc1a | 9 | Version: 1.1.0 |
265a2f1b JB |
10 | Release: 1 |
11 | License: MIT | |
12 | Group: Development/Languages | |
13 | #Source0Download: http://hackage.haskell.org/package/hslua | |
14 | Source0: http://hackage.haskell.org/package/%{pkgname}-%{version}/%{pkgname}-%{version}.tar.gz | |
cce1bc1a | 15 | # Source0-md5: 765647d6f5788fa12f5d82557e73786c |
265a2f1b JB |
16 | URL: http://hackage.haskell.org/package/hslua |
17 | BuildRequires: ghc >= 6.12.3 | |
18 | BuildRequires: ghc-base >= 4 | |
19 | BuildRequires: ghc-base < 5 | |
20 | BuildRequires: ghc-mtl >= 2.1 | |
21 | %if %{with prof} | |
22 | BuildRequires: ghc-prof >= 6.12.3 | |
23 | BuildRequires: ghc-base-prof >= 4 | |
24 | BuildRequires: ghc-base-prof < 5 | |
25 | BuildRequires: ghc-mtl-prof >= 2.1 | |
26 | %endif | |
cce1bc1a | 27 | BuildRequires: lua53-devel |
265a2f1b JB |
28 | BuildRequires: pkgconfig |
29 | BuildRequires: rpmbuild(macros) >= 1.608 | |
30 | BuildRequires: sed >= 4.0 | |
31 | Requires(post,postun): /usr/bin/ghc-pkg | |
32 | %requires_eq ghc | |
33 | Requires: ghc-base >= 4 | |
34 | Requires: ghc-base < 5 | |
35 | Requires: ghc-mtl >= 2.1 | |
36 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
37 | ||
38 | # debuginfo is not useful for ghc | |
39 | %define _enable_debug_packages 0 | |
40 | ||
41 | # don't compress haddock files | |
42 | %define _noautocompressdoc *.haddock | |
43 | ||
44 | %description | |
cce1bc1a | 45 | The Foreign.Lua module is a wrapper of Lua language interpreter as |
265a2f1b JB |
46 | described in <http://www.lua.org/>. |
47 | ||
48 | %description -l pl.UTF-8 | |
cce1bc1a | 49 | Moduł Foreign.Lua to obudowanie interpretera języka Lua, opisanego |
265a2f1b JB |
50 | na <http://www.lua.org/>. |
51 | ||
52 | %package prof | |
53 | Summary: Profiling %{pkgname} library for GHC | |
54 | Summary(pl.UTF-8): Biblioteka profilująca %{pkgname} dla GHC | |
55 | Group: Development/Libraries | |
56 | Requires: %{name} = %{version}-%{release} | |
57 | Requires: ghc-base-prof >= 4 | |
58 | Requires: ghc-base-prof < 5 | |
59 | Requires: ghc-mtl-prof >= 2.1 | |
60 | ||
61 | %description prof | |
62 | Profiling %{pkgname} library for GHC. Should be installed when | |
63 | GHC's profiling subsystem is needed. | |
64 | ||
65 | %description prof -l pl.UTF-8 | |
66 | Biblioteka profilująca %{pkgname} dla GHC. Powinna być zainstalowana | |
67 | kiedy potrzebujemy systemu profilującego z GHC. | |
68 | ||
69 | %package doc | |
70 | Summary: HTML documentation for ghc %{pkgname} package | |
71 | Summary(pl.UTF-8): Dokumentacja w formacie HTML dla pakietu ghc %{pkgname} | |
72 | Group: Documentation | |
73 | ||
74 | %description doc | |
75 | HTML documentation for ghc %{pkgname} package. | |
76 | ||
77 | %description doc -l pl.UTF-8 | |
78 | Dokumentacja w formacie HTML dla pakietu ghc %{pkgname}. | |
79 | ||
80 | %prep | |
81 | %setup -q -n %{pkgname}-%{version} | |
82 | ||
265a2f1b JB |
83 | %build |
84 | runhaskell Setup.hs configure -v2 \ | |
85 | %{?with_prof:--enable-library-profiling} \ | |
cce1bc1a | 86 | --flags=pkg-config \ |
265a2f1b JB |
87 | --prefix=%{_prefix} \ |
88 | --libdir=%{_libdir} \ | |
89 | --libexecdir=%{_libexecdir} \ | |
90 | --docdir=%{_docdir}/%{name}-%{version} \ | |
91 | ||
92 | runhaskell Setup.hs build | |
93 | runhaskell Setup.hs haddock --executables | |
94 | ||
95 | %install | |
96 | rm -rf $RPM_BUILD_ROOT | |
97 | install -d $RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d | |
98 | ||
99 | runhaskell Setup.hs copy --destdir=$RPM_BUILD_ROOT | |
100 | ||
101 | # work around automatic haddock docs installation | |
102 | %{__rm} -rf %{name}-%{version}-doc | |
103 | cp -a $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} %{name}-%{version}-doc | |
104 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} | |
105 | ||
106 | runhaskell Setup.hs register \ | |
107 | --gen-pkg-config=$RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf | |
108 | ||
109 | %clean | |
110 | rm -rf $RPM_BUILD_ROOT | |
111 | ||
112 | %post | |
113 | %ghc_pkg_recache | |
114 | ||
115 | %postun | |
116 | %ghc_pkg_recache | |
117 | ||
118 | %files | |
119 | %defattr(644,root,root,755) | |
cce1bc1a | 120 | %doc CHANGELOG.md LICENSE README.md |
265a2f1b JB |
121 | %{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf |
122 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version} | |
cce1bc1a JR |
123 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/libHShslua-%{version}-*.so |
124 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/libHShslua-%{version}-*.a | |
125 | %exclude %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/libHShslua-%{version}-*_p.a | |
126 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Foreign | |
127 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Foreign/*.hi | |
128 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Foreign/*.dyn_hi | |
129 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Foreign/Lua | |
130 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Foreign/Lua/*.hi | |
131 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Foreign/Lua/*.dyn_hi | |
132 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Foreign/Lua/Core | |
133 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Foreign/Lua/Core/*.hi | |
134 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Foreign/Lua/Core/*.dyn_hi | |
135 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Foreign/Lua/Types | |
136 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Foreign/Lua/Types/*.hi | |
137 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Foreign/Lua/Types/*.dyn_hi | |
265a2f1b JB |
138 | |
139 | %if %{with prof} | |
140 | %files prof | |
141 | %defattr(644,root,root,755) | |
cce1bc1a JR |
142 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/libHShslua-%{version}-*_p.a |
143 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Foreign/Lua.p_hi | |
144 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Foreign/Lua/*.p_hi | |
145 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Foreign/Lua/Core/*.p_hi | |
146 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Foreign/Lua/Types/*.p_hi | |
265a2f1b JB |
147 | %endif |
148 | ||
149 | %files doc | |
150 | %defattr(644,root,root,755) | |
151 | %doc %{name}-%{version}-doc/* |