/
wxhaskell-spec-template
96 lines (81 loc) · 3.44 KB
/
wxhaskell-spec-template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
Summary: A Haskell library for wxWidgets
Name: wxhaskell
Version: %{wxhversion}
Release: %{wxhrelease}
License: wxWindows Library license
Group: Development/Libraries
URL: http://wxhaskell.sourceforge.net
Source: %{name}-src-%{version}.zip
BuildRoot: %{_builddir}/%{name}-%{wxtoolkit}%{wxversion}-%{hcomp}%{hcversion}-%{version}-%{release}-root
%description
# Some useful shorthands
%define wxhpackage %{wxtoolkit}%{wxversion}-%{hcomp}%{hcversion}
%define wxhlibdir %{_libdir}/%{hcomp}-%{hcversion}/%{name}-%{version}
%define libwxc libwxc-%{wxtoolkit}%{wxversion}-%{version}.so
%define source %{name}-src-%{version}.zip
# We define a sub package to build for a specific wxGTK and Haskell compiler
%package %{wxhpackage}
Summary: A Haskell library for wxWidgets
Group: Development/Libraries
BuildRequires: %{hcomp} = %{hcversion}
Requires: %{hcomp} = %{hcversion}
Requires(post,preun): %{hcomp} = %{hcversion}
%description %{wxhpackage}
wxHaskell is a portable GUI library for Haskell that uses wxWidgets.
wxWidgets is a comprehensive C++ library that is portable across all major
GUI platforms; including GTK, Windows, X11, and MacOS X. Furthermore, it is
a mature library (in development since 1992) that supports a wide range of
widgets with native look-and-feel.
wxHaskell exposes almost all relevant wxWidgets functionality -- about 500
classes with 2800 methods and 1200 constants. Furthermore, it adds many
functional abstractions which lead to short and consise code.
This package contains the libraries compiled
- for : %{hcomp}-%{hcversion}
- with: wx%{wxToolkit}-%{wxversion}
We would like to thank the people of the ELJ Eiffel project, and in
particular Uwe Sanders, for providing the basic C interface to wxWidgets.
%prep
%setup -q
%build
# - set the "shared-prefix" to null, such that wxHaskell apps are
# independent of the location of libwxc.
# - explicitly force a specific haskell compiler
./configure %{configflags} --shared-prefix="" --hc=%{hcomp}-%{hcversion} --hcpkg=%{hcpkg}-%{hcversion} --libdir=%{wxhlibdir}
make
%install
# - we use "install-files" so that the packages are not registered with ghc.
# - we move "libwxc" to "_libdir" so that it can be found by the loader.
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install-files
mv %buildroot%{wxhlibdir}/%{libwxc} %buildroot%{_libdir}
%clean
rm -rf $RPM_BUILD_ROOT
%post %{wxhpackage}
if %{hcpkg}-%{hcversion} list > /dev/null 2> /dev/null; then
wxhlibdir=%{wxhlibdir}
cat %{wxhlibdir}/wxcore.pkg | sed -e "s|\${wxhlibdir}|${wxhlibdir}|" | %{hcpkg}-%{hcversion} --global update -
cat %{wxhlibdir}/wx.pkg | sed -e "s|\${wxhlibdir}|${wxhlibdir}|" | %{hcpkg}-%{hcversion} --global update -
else
env wxhlibdir=%{wxhlibdir} %{hcpkg}-%{hcversion} -u -i %{wxhlibdir}/wxcore.pkg
env wxhlibdir=%{wxhlibdir} %{hcpkg}-%{hcversion} -u -i %{wxhlibdir}/wx.pkg
fi
%preun %{wxhpackage}
if [ "$1" = 0 ]; then
if %{hcpkg}-%{hcversion} list > /dev/null 2> /dev/null; then
%{hcpkg}-%{hcversion} unregister wx || :
%{hcpkg}-%{hcversion} unregister wxcore || :
else
%{hcpkg}-%{hcversion} -r wx || :
%{hcpkg}-%{hcversion} -r wxcore || :
fi
fi
%files %{wxhpackage}
%defattr(-,root,root,-)
%{wxhlibdir}/*
%{_libdir}/%{libwxc}
%changelog
* Fri Apr 30 2005 Daan Leijen <http://www.cs.uu.nl/~daan> - 0.9.4
- Updated for ghc-pkg version 6.4+
* Fri Mar 26 2004 Daan Leijen <http://www.cs.uu.nl/~daan> - 0.7-0
- Initial build
- Original spec file was kindly provided by Jens Petersen <petersen@haskell.org>.