Added a lablgl demo.
[fedora-mingw.git] / ocaml-lablgl / mingw32-ocaml-lablgl.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-lablgl
8 Version:        1.03
9 Release:        1%{?dist}
10 Summary:        MinGW Windows port of LablGL is an OpenGL interface
11
12 License:        BSD
13 Group:          Development/Libraries
14
15 URL:            http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/lablgl.html
16 Source0:        http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/dist/lablgl-%{version}.tar.gz
17
18 # Patches from native Fedora package:
19 Patch0:         lablgl-tk8.5.patch
20
21 Patch1000:      mingw32-ocaml-lablgl-1.03-make-fixes.patch
22
23 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
24 BuildArch:      noarch
25
26 BuildRequires:  mingw32-filesystem >= 35
27 BuildRequires:  mingw32-gcc
28 BuildRequires:  mingw32-binutils
29
30 BuildRequires:  mingw32-ocaml >= 3.11.0
31
32 # labltk is used by the native package, but is essentially optional.
33 #BuildRequires: mingw32-ocaml-labtk
34
35
36 %description
37 LablGL is is an Objective Caml interface to OpenGL. Support is
38 included for use inside LablTk, and LablGTK also includes specific
39 support for LablGL.  It can be used either with proprietary OpenGL
40 implementations (SGI, Digital Unix, Solaris...), with XFree86 GLX
41 extension, or with open-source Mesa.
42
43 This is the MinGW Windows port of this package.  Currently it does not
44 support Togl (Tk integration) or GLUT.
45
46
47 %prep
48 %setup -q -n lablgl-%{version}
49
50 %patch0 -p1
51 %patch1000 -p1
52
53 cat > Makefile.config <<__EOF__
54 CAMLC = %{_mingw32_target}-ocamlc
55 CAMLOPT = %{_mingw32_target}-ocamlopt
56 BINDIR = %{_bindir}
57 #XINCLUDES = -I%{_prefix}/X11R6/include
58 #XLIBS = -lXext -lXmu -lX11
59 #TKINCLUDES = -I%{_includedir}
60 GLINCLUDES = -DHAS_GLEXT_H -DGL_GLEXT_PROTOTYPES -DGLU_VERSION_1_3
61 GLLIBS = -lglu32 -lopengl32
62 GLUTLIBS = -lglut32
63 RANLIB = i686-pc-mingw32-ranlib
64 TOOLCHAIN = msvc
65 XB = .bat
66 XE = .exe
67 XS = .dll
68 # NB: The next two lines have a space after them.
69 MKLIB = i686-pc-mingw32-ar rcs 
70 MKDLL = i686-pc-mingw32-ocamlmklib -o 
71 LIBDIR = %{_libdir}/%{_mingw32_target}-ocaml
72 DLLDIR = %{_libdir}/%{_mingw32_target}-ocaml/stublibs
73 INSTALLDIR = %{_libdir}/%{_mingw32_target}-ocaml/lablGL
74 #TOGLDIR=Togl
75 #COPTS = $RPM_OPT_FLAGS
76 __EOF__
77
78
79 %build
80 make lib
81 make libopt
82
83
84 %install
85 rm -rf $RPM_BUILD_ROOT
86
87 mkdir -p $RPM_BUILD_ROOT%{_bindir}
88 mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/lablGL
89 mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/stublibs
90 make INSTALLDIR=$RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/lablGL \
91     DLLDIR=$RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/stublibs \
92     BINDIR=$RPM_BUILD_ROOT%{_bindir} \
93     install
94
95 # Make and install a META file.
96 cat <<EOM >META
97 version="%{version}"
98 directory="+lablgl"
99 archive(byte) = "lablgl.cma"
100 archive(native) = "lablgl.cmxa"
101 EOM
102 cp META $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/lablGL
103
104 # Remove unnecessary *.ml files (ones which have a *.mli).
105 pushd $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/lablGL
106 for f in *.ml; do \
107   b=`basename $f .ml`; \
108   if [ -f "$b.mli" ]; then \
109     rm $f; \
110   fi; \
111 done
112 popd
113
114
115 %clean
116 rm -rf $RPM_BUILD_ROOT
117
118
119 %files
120 %defattr(-,root,root)
121 %{_libdir}/%{_mingw32_target}-ocaml/lablGL/
122
123
124 %changelog
125 * Sun Nov 23 2008 Richard W.M. Jones <rjones@redhat.com> - 1.03-1
126 - Initial RPM release.