]>
Commit | Line | Data |
---|---|---|
c623f0c7 KT |
1 | %define name XFree86-glx |
2 | %define mesaname Mesa | |
3 | %define version 4.2.0 | |
4 | %define mesaversion 3.2.1 | |
5 | %define release 0.1 | |
6 | %define serial 3 | |
7 | %define prefix /usr/X11R6 | |
8 | ||
9 | %define glx_ver latest | |
10 | ||
11 | Summary: OpenGL 1.2 compatible 3D graphics library | |
12 | Name: %{name} | |
13 | Version: %{version} | |
14 | Release: %{release} | |
15 | Serial: %{serial} | |
16 | Prefix: %{prefix} | |
17 | Copyright: LGPL | |
18 | Group: System/Libraries | |
19 | URL: http://www.mesa3d.org | |
20 | Vendor: Brian Paul <brian_paul@mesa3d.org> | |
21 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
22 | ||
23 | Source: ftp://ftp.mesa3d.org/pub/mesa/MesaLib-%{mesaversion}.tar.bz2 | |
24 | Source1: ftp://ftp.mesa3d.org/pub/mesa/MesaDemos-%{mesaversion}.tar.bz2 | |
25 | Source2: http://snow.ashlu.bc.ca/glx/snapshots/utah-glx-src-%{glx_ver}.tar.gz | |
26 | Obsoletes: Mesa XFree86-OpenGL-core XFree86-OpenGL-libs | |
27 | ||
28 | BuildPreReq: binutils >= 2.9.1.0.19a | |
29 | Conflicts: XFree86 >= 3.3.6 | |
30 | ||
31 | %description | |
32 | This is an implementation of the Mesa 3D library and GLX with support | |
33 | for hardware acceleration. GLX was developed by SGI as an extension to | |
34 | the X window system to integrate OpenGL rendering functions. | |
35 | This allows the Mesa 3D library to perform its 3D rendering functions | |
36 | within the X server's process, rather than within the X client program. | |
37 | This offers potential performance benefits, because the rendered image | |
38 | does not have to be moved from the X client program to the X server. | |
39 | (Only the commands required to render the image are sent.) | |
40 | It also makes 3-D hardware acceleration much more practical (and fast). This | |
41 | package includes a accelerated hardware drivers for video card | |
42 | based on NVIDIA Riva series and ATI Rage Pro chipsets. | |
43 | ||
44 | The Mesa 3D graphics library is a powerful and generic toolset for creating | |
45 | hardware assisted computer graphics. To the extent that Mesa utilizes the | |
46 | OpenGL command syntax or state machine, it is being used with authorization | |
47 | from Silicon Graphics, Inc. However, the author (Brian Paul) makes no claim | |
48 | that Mesa is in any way a compatible replacement for OpenGL or associated with | |
49 | Silicon Graphics, Inc. Those who want a licensed implementation of OpenGL | |
50 | should contact a licensed vendor. However, Mesa is very similar to OpenGL, and | |
51 | you might find Mesa to be a valid alternative to OpenGL. | |
52 | ||
53 | This package is based on Mesa %{mesaver} and utah glx-%{glxver}. | |
54 | ||
55 | please see http://utah-glx.sourceforge.net/ for more information. | |
56 | ||
57 | %package devel | |
58 | Summary: Development files for Mesa (OpenGL compatible 3D lib) | |
59 | Group: Development/C | |
60 | Requires: %{name} | |
61 | ||
62 | %description devel | |
63 | Mesa is an OpenGL 1.2 compatible 3D graphics library. | |
64 | Headers needed to compile Mesa programs. | |
65 | ||
66 | %prep | |
67 | %setup -q -n %{mesaname}-%{mesaversion} -b1 -a2 | |
68 | [ -d glx-xf4 ] && ln -s glx-xf4 glx; | |
69 | ||
70 | RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS| sed 's/-m486 *//g'`; export RPM_OPT_FLAGS; | |
71 | ||
72 | perl -p -i -e "s/-O3/$RPM_OPT_FLAGS/" Make-config | |
73 | ||
74 | %build | |
75 | RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS| sed 's/-m486 *//g'`; export RPM_OPT_FLAGS; | |
76 | ||
77 | %ifarch i386 i486 | |
78 | CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" \ | |
79 | ./configure --prefix=%{prefix} \ | |
80 | --sysconfdir=/etc/X11 \ | |
81 | --disable-mmx \ | |
82 | --disable-3dnow \ | |
83 | --without-ggi \ | |
84 | --enable-mga=no \ | |
85 | --enable-mach64=no \ | |
86 | --enable-tnt=yes \ | |
87 | --enable-i810=no \ | |
88 | --enable-s3virge=no \ | |
89 | --enable-s3savage=no \ | |
90 | --enable-sis6326=no | |
91 | ||
92 | %endif | |
93 | %ifarch i586 i686 k6 k7 | |
94 | CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" \ | |
95 | ./configure --prefix=%{prefix} \ | |
96 | --sysconfdir=/etc/X11 \ | |
97 | --with-glide=/usr \ | |
98 | --without-ggi \ | |
99 | --enable-mga=no \ | |
100 | --enable-mach64=no \ | |
101 | --enable-tnt=yes \ | |
102 | --enable-i810=no \ | |
103 | --enable-s3virge=no \ | |
104 | --enable-s3savage=no \ | |
105 | --enable-sis6326=no | |
106 | %endif | |
107 | %ifnarch i386 i486 i586 i686 k6 k7 | |
108 | ./configure --prefix=%{prefix} \ | |
109 | --sysconfdir=/etc/X11 \ | |
110 | --disable-3dnow \ | |
111 | --without-ggi \ | |
112 | --enable-mga=no \ | |
113 | --enable-mach64=no \ | |
114 | --enable-tnt=yes \ | |
115 | --enable-i810=no \ | |
116 | --enable-s3virge=no \ | |
117 | --enable-s3savage=no \ | |
118 | --enable-sis6326=no | |
119 | %endif | |
120 | ||
121 | make | |
122 | ||
123 | %ifarch alpha sparc sparc64 ppc # Skip utah_glx for alpha - (fg) also skip it for | |
124 | # sparc - (jb) also added skip for ppc | |
125 | echo 'utah_glx skipped for alpha, powerpc and sparcs' | |
126 | %else | |
127 | cd glx | |
128 | cp -fv ../config.sub ./ | |
129 | ||
130 | CFLAGS="$RPM_OPT_FLAGS" \ | |
131 | ./autogen.sh --with-chipset=both \ | |
132 | --with-mesa=../ \ | |
133 | --enable-extra \ | |
134 | --disable-mtrr \ | |
135 | --disable-agp \ | |
136 | --disable-glut \ | |
137 | --disable-GLU \ | |
138 | --prefix=%{prefix} \ | |
139 | --sysconfdir=/etc/X11 \ | |
140 | --without-x86-asm \ | |
141 | --without-mmx-asm \ | |
142 | --without-3dnow-asm \ | |
143 | --enable-mga=no \ | |
144 | --enable-mach64=no \ | |
145 | --enable-tnt=yes \ | |
146 | --enable-i810=no \ | |
147 | --enable-s3virge=no \ | |
148 | --enable-s3savage=no \ | |
149 | --enable-sis6326=no | |
150 | ||
151 | # Arg docs sux ((Dadou) "are not OK", it's better ;) | |
152 | cd docs | |
153 | cat <<EOF > config.cache | |
154 | ac_cv_path_install=${ac_cv_path_install='/usr/bin/install -c'} | |
155 | ac_cv_prog_CP=${ac_cv_prog_CP='cp -f'} | |
156 | ac_cv_prog_LN_S=${ac_cv_prog_LN_S='ln -s'} | |
157 | ac_cv_prog_MKDIR=${ac_cv_prog_MKDIR='mkdir -p'} | |
158 | ac_cv_prog_MV=${ac_cv_prog_MV='mv -f'} | |
159 | ac_cv_prog_RM=${ac_cv_prog_RM='rm -f'} | |
160 | ac_cv_prog_have_dvips=${ac_cv_prog_have_dvips=no} | |
161 | ac_cv_prog_have_jade=${ac_cv_prog_have_jade=no} | |
162 | ac_cv_prog_have_jadetex=${ac_cv_prog_have_jadetex=no} | |
163 | ac_cv_prog_have_lynx=${ac_cv_prog_have_lynx=no} | |
164 | ac_cv_prog_have_ps2pdf=${ac_cv_prog_have_ps2pdf=no} | |
165 | ac_cv_prog_make_make_set=${ac_cv_prog_make_make_set=yes} | |
166 | EOF | |
167 | ./configure --enable-text --enable-html --enable-ps --enable-pdf | |
168 | cd .. | |
169 | ||
170 | make | |
171 | cd .. | |
172 | %endif # Skip glx for Alpha | |
173 | ||
174 | %install | |
175 | [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT; | |
176 | mkdir -p $RPM_BUILD_ROOT%{prefix}/include | |
177 | mkdir -p $RPM_BUILD_ROOT%{prefix}/include/GL | |
178 | mkdir -p $RPM_BUILD_ROOT%{prefix}/lib/modules/ | |
179 | make DESTDIR=$RPM_BUILD_ROOT install | |
180 | cp include/GL/svgamesa.h $RPM_BUILD_ROOT%{prefix}/include/GL/ | |
181 | cp glx/servGL/libglx.so $RPM_BUILD_ROOT%{prefix}/lib/modules/ | |
182 | ||
183 | %ifarch alpha sparc sparc64 ppc | |
184 | echo 'Skipping utah_glx' | |
185 | %else | |
186 | mkdir -p $RPM_BUILD_ROOT/usr/bin | |
187 | cat > $RPM_BUILD_ROOT/usr/bin/glx <<EOF | |
188 | #!/bin/sh | |
189 | LD_PRELOAD=%{prefix}/lib/libGL.so.1.0 "\$@" | |
190 | EOF | |
191 | chmod +x $RPM_BUILD_ROOT/usr/bin/glx | |
192 | ||
193 | ## glx | |
194 | cd glx | |
195 | mkdir -p $RPM_BUILD_ROOT/etc/X11 | |
196 | make DESTDIR=$RPM_BUILD_ROOT sysconfdir=/etc/X11 install | |
197 | cd .. | |
198 | %endif # glx | |
199 | ||
200 | cd $RPM_BUILD_ROOT/%{prefix}/lib/ | |
201 | ln -sf libGL.so.1 libGL.so | |
202 | ln -sf libGLU.so.1 libGLU.so | |
203 | ln -sf libGLU.so.1 libGLU.so.3 | |
204 | ln -sf libglut.so.3 libglut.so | |
205 | ||
206 | # (gc) add Mesa symlinks for compatibility | |
207 | ln -sf libGL.so libMesaGL.so | |
208 | ln -sf libGL.so.1 libMesaGL.so.1 | |
209 | ln -sf libGL.so.1.0 libMesaGL.so.1.0 | |
210 | ln -sf libGLU.so libMesaGLU.so | |
211 | ln -sf libGLU.so.1 libMesaGLU.so.1 | |
212 | ||
213 | %clean | |
214 | [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT; | |
215 | ||
216 | %post -p /sbin/ldconfig | |
217 | %postun -p /sbin/ldconfig | |
218 | ||
219 | %files | |
220 | %defattr(-,root,root) | |
221 | %doc docs/COPYRIGHT docs/README docs/README.X11 docs/COPYING | |
222 | %doc glx/docs/README.i810 glx/docs/README.mach64 glx/docs/README.mga | |
223 | %doc glx/docs/README.nv glx/docs/README.s3virge | |
224 | %doc docs/COPYRIGHT docs/README docs/README.X11 docs/COPYING | |
225 | %{prefix}/lib/libGL.so.* | |
226 | %{prefix}/lib/libMesaGL.so.* | |
227 | %{prefix}/lib/libGLU.so.* | |
228 | %{prefix}/lib/libMesaGLU.so.* | |
229 | %{prefix}/lib/libglut.so.* | |
230 | %{prefix}/lib/modules/libglx.so | |
231 | ||
232 | %ifarch i386 i486 i586 i686 k6 k7 | |
233 | /usr/bin/glx | |
234 | # %{prefix}/lib/modules/* | |
235 | %config /etc/X11/glx.conf | |
236 | %endif | |
237 | %config /etc/X11/mesa.conf | |
238 | ||
239 | %files devel | |
240 | %defattr(-,root,root) | |
241 | %doc docs/COPYRIGHT docs/README docs/README.X11 docs/COPYING docs/DEVINFO | |
242 | %doc docs/CONFORM docs/VERSIONS | |
243 | %doc docs/COPYRIGHT docs/README docs/README.X11 docs/COPYING | |
244 | %dir %{prefix}/include/GL | |
245 | %{prefix}/include/GL/glu.h | |
246 | %{prefix}/include/GL/glu_mangle.h | |
247 | %{prefix}/include/GL/glut.h | |
248 | %{prefix}/lib/libGLU.so | |
249 | %{prefix}/lib/libMesaGLU.so | |
250 | %{prefix}/lib/libglut.so | |
251 | %{prefix}/lib/libGL.la | |
252 | %{prefix}/lib/libGLU.la | |
253 | %{prefix}/lib/libglut.la | |
254 | %{prefix}/include/GL/gl.h | |
255 | %{prefix}/include/GL/gl_mangle.h | |
256 | %{prefix}/include/GL/osmesa.h | |
257 | %ifarch i386 i486 i586 i686 k6 k7 | |
258 | %{prefix}/include/GL/svgamesa.h | |
259 | %endif | |
260 | %{prefix}/include/GL/glx.h | |
261 | %{prefix}/include/GL/glx_mangle.h | |
262 | %{prefix}/include/GL/xmesa.h | |
263 | %{prefix}/include/GL/xmesa_x.h | |
264 | %{prefix}/include/GL/xmesa_xf86.h | |
265 | %{prefix}/lib/libGL.so | |
266 | %{prefix}/lib/libMesaGL.so |