smock: Document how to use it without httpd
[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:        5%{?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 Patch1001:      mingw32-ocaml-lablgl-1.03-no-toplevel.patch
23 Patch1002:      mingw32-ocaml-lablgl-1.03-evil-glut-header.patch
24
25 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
26 BuildArch:      noarch
27
28 BuildRequires:  mingw32-filesystem >= 38
29 BuildRequires:  mingw32-gcc
30 BuildRequires:  mingw32-binutils
31
32 BuildRequires:  mingw32-ocaml >= 3.11.0
33
34 # labltk is used by the native package, but is essentially optional.
35 #BuildRequires: mingw32-ocaml-labtk
36
37 # Because of the evil glut patch above, we in fact use the
38 # native GLUT header files.
39 BuildRequires:  freeglut-devel
40
41 %description
42 LablGL is is an Objective Caml interface to OpenGL. Support is
43 included for use inside LablTk, and LablGTK also includes specific
44 support for LablGL.  It can be used either with proprietary OpenGL
45 implementations (SGI, Digital Unix, Solaris...), with XFree86 GLX
46 extension, or with open-source Mesa.
47
48 This is the MinGW Windows port of this package.  Currently it does not
49 support Togl (Tk integration).
50
51
52 %prep
53 %setup -q -n lablgl-%{version}
54
55 %patch0 -p1
56 %patch1000 -p1
57 %patch1001 -p1
58 %patch1002 -p1
59
60 cat > Makefile.config <<__EOF__
61 CAMLC = %{_mingw32_target}-ocamlc
62 CAMLOPT = %{_mingw32_target}-ocamlopt
63 BINDIR = %{_mingw32_bindir}
64 #XINCLUDES = -I%{_prefix}/X11R6/include
65 #XLIBS = -lXext -lXmu -lX11
66 #TKINCLUDES = -I%{_includedir}
67 GLINCLUDES = -DHAS_GLEXT_H -DGL_GLEXT_PROTOTYPES -DGLU_VERSION_1_3
68 GLLIBS = -lglu32 -lopengl32
69 GLUTLIBS = -lglut32
70 RANLIB = i686-pc-mingw32-ranlib
71 TOOLCHAIN = unix
72 XB = .bat
73 XE = .exe
74 XS = .dll
75 # NB: The next two lines have a space after them.
76 MKLIB = i686-pc-mingw32-ar rcs 
77 MKDLL = i686-pc-mingw32-ocamlmklib -o 
78 LIBDIR = %{_libdir}/%{_mingw32_target}-ocaml
79 DLLDIR = %{_libdir}/%{_mingw32_target}-ocaml/stublibs
80 INSTALLDIR = %{_libdir}/%{_mingw32_target}-ocaml/lablGL
81 #TOGLDIR=Togl
82 #COPTS = $RPM_OPT_FLAGS
83 __EOF__
84
85
86 %build
87 # XXX w32api-3.12 had libglut32.a, but 3.13 lacks this, so we have
88 # had to disable glut compilation.
89 #make LIBRARIAN=i686-pc-mingw32-ocamlmklib lib glut libopt glutopt
90 make LIBRARIAN=i686-pc-mingw32-ocamlmklib lib libopt
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/lablGL
98 mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/stublibs
99 make INSTALLDIR=$RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/lablGL \
100     DLLDIR=$RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/stublibs \
101     BINDIR=$RPM_BUILD_ROOT%{_mingw32_bindir} \
102     install
103
104 # Make and install a META file.
105 cat <<EOM >META
106 version="%{version}"
107 directory="+lablgl"
108 archive(byte) = "lablgl.cma"
109 archive(native) = "lablgl.cmxa"
110 EOM
111 cp META $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/lablGL
112
113 # Remove unnecessary *.ml files (ones which have a *.mli).
114 pushd $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/lablGL
115 for f in *.ml; do \
116   b=`basename $f .ml`; \
117   if [ -f "$b.mli" ]; then \
118     rm $f; \
119   fi; \
120 done
121 popd
122
123
124 %clean
125 rm -rf $RPM_BUILD_ROOT
126
127
128 %files
129 %defattr(-,root,root)
130 # XXX See above for reason why glut is missing.
131 #%{_mingw32_bindir}/lablglut.bat
132 %{_libdir}/%{_mingw32_target}-ocaml/lablGL/
133 %{_libdir}/%{_mingw32_target}-ocaml/stublibs/dlllablgl.dll
134 #%{_libdir}/%{_mingw32_target}-ocaml/stublibs/dlllablglut.dll
135
136
137 %changelog
138 * Fri Feb 20 2009 Richard W.M. Jones <rjones@redhat.com> - 1.03-5
139 - Rebuild for mingw32-gcc 4.4
140
141 * Sat Jan 24 2009 Richard W.M. Jones <rjones@redhat.com> - 1.03-4
142 - Disable GLUT since the library has been dropped from w32api.
143
144 * Sun Nov 23 2008 Richard W.M. Jones <rjones@redhat.com> - 1.03-3
145 - Initial RPM release.