]>
Commit | Line | Data |
---|---|---|
98dcf998 | 1 | %define realname glut |
2 | Summary: OpenGL Utility Toolkit (GLUT) - Mingw32 cross version | |
693a8fd8 | 3 | Summary(pl.UTF-8): OpenGL Utility Toolkit (GLUT) - wersja skrośna dla Mingw32 |
98dcf998 | 4 | Name: crossmingw32-%{realname} |
5 | Version: 3.7 | |
7f143f6d | 6 | Release: 3 |
b36f3920 | 7 | License: distributable |
184a0ea9 | 8 | Group: Development/Libraries |
98dcf998 | 9 | Source0: http://www.opengl.org/resources/libraries/glut/%{realname}-%{version}.tar.gz |
10 | # Source0-md5: dc932666e2a1c8a0b148a4c32d111ef3 | |
11 | URL: http://www.opengl.org/resources/libraries/glut.html | |
12 | BuildRequires: crossmingw32-gcc | |
13 | BuildRequires: crossmingw32-w32api | |
14 | BuildRequires: /bin/csh | |
15 | Conflicts: crossmingw32-w32api < 2.5-4 | |
16 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
17 | ||
18 | %define no_install_post_strip 1 | |
19 | ||
20 | %define target i386-mingw32 | |
21 | %define target_platform i386-pc-mingw32 | |
22 | %define arch %{_prefix}/%{target} | |
98dcf998 | 23 | |
24 | %define __cc %{target}-gcc | |
25 | %define __cxx %{target}-g++ | |
26 | ||
27 | %ifarch alpha sparc sparc64 sparcv9 | |
28 | %define optflags -O2 | |
29 | %endif | |
30 | ||
31 | %description | |
32 | A 3-D graphics library which uses the OpenGL API. | |
33 | ||
c90c5a57 JR |
34 | %description -l pl.UTF-8 |
35 | Biblioteka graficzna 3D używająca API z OpenGL. | |
98dcf998 | 36 | |
37 | %package dll | |
38 | Summary: %{realname} - DLL library for Windows | |
693a8fd8 | 39 | Summary(pl.UTF-8): %{realname} - biblioteka DLL dla Windows |
98dcf998 | 40 | Group: Applications/Emulators |
41 | ||
42 | %description dll | |
43 | %{realname} - DLL library for Windows. | |
44 | ||
c90c5a57 | 45 | %description dll -l pl.UTF-8 |
98dcf998 | 46 | %{realname} - biblioteka DLL dla Windows. |
47 | ||
48 | %prep | |
49 | %setup -q -n %{realname}-%{version} | |
50 | ||
51 | %build | |
52 | CC=%{target}-gcc ; export CC | |
53 | CXX=%{target}-g++ ; export CXX | |
54 | LD=%{target}-ld ; export LD | |
55 | AR=%{target}-ar ; export AR | |
56 | AS=%{target}-as ; export AS | |
57 | CROSS_COMPILE=1 ; export CROSS_COMPILE | |
58 | CPPFLAGS="-I%{arch}/include" ; export CPPFLAGS | |
59 | RANLIB=%{target}-ranlib ; export RANLIB | |
60 | LDSHARED="%{target}-gcc -shared" ; export LDSHARED | |
61 | TARGET="%{target}" ; export TARGET | |
62 | ||
7f143f6d | 63 | sed -i -e 's/defined(_STDCALL_SUPPORTED)/defined(WIN32)/' include/GL/glut.h |
64 | ||
98dcf998 | 65 | cd lib/glut |
66 | ||
764d1a11 | 67 | for i in glut_8x13.c glut_9x15.c glut_bitmap.c glut_bwidth.c glut_cindex.c glut_cmap.c glut_cursor.c glut_dials.c glut_dstr.c glut_event.c glut_ext.c glut_fullscrn.c glut_gamemode.c glut_get.c glut_hel10.c glut_hel12.c glut_hel18.c glut_init.c glut_input.c glut_joy.c glut_key.c glut_keyctrl.c glut_keyup.c glut_mesa.c glut_modifier.c glut_mroman.c glut_overlay.c glut_roman.c glut_shapes.c glut_space.c glut_stroke.c glut_swap.c glut_swidth.c glut_tablet.c glut_teapot.c glut_tr10.c glut_tr24.c glut_util.c glut_vidresize.c glut_warp.c glut_win.c glut_winmisc.c win32_glx.c win32_menu.c win32_util.c win32_winproc.c win32_x11.c |
98dcf998 | 68 | do |
69 | %{__cc} %{rpmcflags} -c $i -I../../include | |
70 | done | |
71 | ||
72 | rm -f libglut.a | |
73 | $AR cru libglut.a *.o | |
74 | $RANLIB libglut.a | |
75 | ||
76 | %{__cc} --shared *.o -Wl,--enable-auto-image-base -o glut.dll -Wl,--out-implib,libglut.dll.a -lopengl32 -lglu32 -lgdi32 -lwinmm | |
77 | ||
78 | %if 0%{!?debug:1} | |
79 | %{target}-strip *.dll | |
80 | %{target}-strip -g -R.comment -R.note *.a | |
81 | %endif | |
82 | ||
83 | %install | |
84 | rm -rf $RPM_BUILD_ROOT | |
85 | install -d $RPM_BUILD_ROOT%{arch}/{include/GL,lib} | |
86 | install -d $RPM_BUILD_ROOT%{_datadir}/wine/windows/system | |
87 | ||
88 | install include/GL/{f,g}*.h $RPM_BUILD_ROOT%{arch}/include/GL | |
89 | install lib/glut/libglut{,.dll}.a $RPM_BUILD_ROOT%{arch}/lib | |
90 | install lib/glut/glut.dll $RPM_BUILD_ROOT%{_datadir}/wine/windows/system | |
91 | ||
764d1a11 | 92 | cd $RPM_BUILD_ROOT%{arch}/lib |
93 | ln -s libglut{,32}.a | |
94 | ln -s libglut{,32}.dll.a | |
95 | ||
98dcf998 | 96 | %clean |
97 | rm -rf $RPM_BUILD_ROOT | |
98 | ||
99 | %files | |
100 | %defattr(644,root,root,755) | |
101 | %{arch}/include/* | |
102 | %{arch}/lib/* | |
103 | ||
104 | %files dll | |
105 | %defattr(644,root,root,755) | |
106 | %{_datadir}/wine/windows/system/* |