Bump all spec releases for mass rebuild to mingw32-gcc 4.4
[fedora-mingw.git] / ocaml-lablgtk / mingw32-ocaml-lablgtk.spec
1 %define __strip %{_mingw32_strip}
2 %define __objdump %{_mingw32_objdump}
3 %define _use_internal_dependency_generator 0
4 %define __find_requires %{_mingw32_findrequires}
5 %define __find_provides %{_mingw32_findprovides}
6
7 Name:           mingw32-ocaml-lablgtk
8 Version:        2.10.1
9 Release:        2%{?dist}
10 Summary:        MinGW Windows port of LablGTK, OCaml interface to Gtk+
11
12 License:        LGPLv2 with exceptions
13 Group:          Development/Libraries
14
15 URL:            http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/lablgtk.html
16 Source0:        http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/dist/lablgtk-%{version}.tar.gz
17
18 Patch1000:      mingw32-ocaml-lablgtk-2.10.1-build-hacks.patch
19
20 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
21 BuildArch:      noarch
22
23 BuildRequires:  mingw32-filesystem >= 38
24 BuildRequires:  mingw32-gcc
25 BuildRequires:  mingw32-binutils
26 BuildRequires:  mingw32-glib2
27 BuildRequires:  mingw32-gtk2
28 BuildRequires:  mingw32-pango
29
30 BuildRequires:  mingw32-ocaml >= 3.11.0
31 BuildRequires:  mingw32-ocaml-lablgl >= 1.03
32
33 BuildRequires:  pkgconfig
34
35 # These are all in the native package, but missing as dependencies.
36 #BuildRequires:  ncurses-devel
37 #BuildRequires:  gnome-panel-devel
38 #BuildRequires:  gtkglarea2-devel
39 #BuildRequires:  gtkspell-devel
40 #BuildRequires:  libXmu-devel
41 #BuildRequires:  libglade2-devel
42 #BuildRequires:  libgnomecanvas-devel
43 #BuildRequires:  libgnomeui-devel
44 #BuildRequires:  librsvg2-devel
45
46
47 %description
48 LablGTK is is an Objective Caml interface to gtk+.
49
50 It uses the rich type system of Objective Caml 3 to provide a strongly
51 typed, yet very comfortable, object-oriented interface to gtk+. This
52 is not that easy if you know the dynamic typing approach taken by
53 gtk+.
54
55 This is the MinGW Windows port of this package.  Currently it does not
56 support Togl (Tk integration).
57
58
59 %prep
60 %setup -q -n lablgtk-%{version}
61
62 %patch1000 -p1
63
64 # version information in META file is wrong
65 perl -pi -e 's|version="1.3.1"|version="%{version}"|' META
66
67
68 %build
69 %{_mingw32_configure} \
70   CAMLC=i686-pc-mingw32-ocamlc \
71   OCAMLCDOTOPT=no \
72   CAMLOPT=i686-pc-mingw32-ocamlopt \
73   OCAMLOPTDOTOPT=no \
74   OCAMLDEP=i686-pc-mingw32-ocamldep \
75   OCAMLLIB=%{_libdir}/%{_mingw32_target}-ocaml \
76   CAMLMKTOP=i686-pc-mingw32-ocamlmktop \
77   CAMLMKLIB=i686-pc-mingw32-ocamlmklib \
78   EXE=.exe \
79   --enable-debug \
80   --without-glade \
81   --without-rsvg \
82   --without-gl \
83   --without-gnomecanvas \
84   --without-gnomeui \
85   --without-panel \
86   --without-gtkspell \
87   --without-gtksourceview
88
89 perl -pi -e "s|-O|$RPM_OPT_FLAGS|" src/Makefile
90 make world
91
92
93 %install
94 rm -rf $RPM_BUILD_ROOT
95
96 mkdir -p $RPM_BUILD_ROOT%{_mingw32_bindir}
97 mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/lablgtk2
98 mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/stublibs
99
100 make install \
101      BINDIR=$RPM_BUILD_ROOT%{_mingw32_bindir} \
102      LIBDIR=$RPM_BUILD_ROOT%{_libdir} \
103      INSTALLDIR=$RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/lablgtk2 \
104      DLLDIR=$RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/stublibs
105 cp META $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/lablgtk2
106
107 # Remove unnecessary *.ml files (ones which have a *.mli).
108 pushd $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/lablgtk2
109 for f in *.ml; do \
110   b=`basename $f .ml`; \
111   if [ -f "$b.mli" ]; then \
112     rm $f; \
113   fi; \
114 done
115 popd
116
117
118 %clean
119 rm -rf $RPM_BUILD_ROOT
120
121
122 %files
123 %defattr(-,root,root)
124 %{_mingw32_bindir}/lablgtk2
125 %{_libdir}/%{_mingw32_target}-ocaml/lablgtk2/
126
127
128 %changelog
129 * Fri Feb 20 2009 Richard W.M. Jones <rjones@redhat.com> - 2.10.1-2
130 - Rebuild for mingw32-gcc 4.4
131
132 * Mon Nov 24 2008 Richard W.M. Jones <rjones@redhat.com> - 2.10.1-1
133 - Initial RPM release.