mesa/mesa.spec

changeset 745
55a8b8e82e56
parent 85
e6a1cd7ed6ba
equal deleted inserted replaced
3:be35f52b9771 4:99029a09a687
1 ## 1 ##
2 ## mesa.spec -- OpenPKG RPM Package Specification 2 ## mesa.spec -- OpenPKG RPM Package Specification
3 ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/> 3 ## Copyright (c) 2000-2009 OpenPKG Foundation e.V. <http://openpkg.net/>
4 ## 4 ##
5 ## Permission to use, copy, modify, and distribute this software for 5 ## Permission to use, copy, modify, and distribute this software for
6 ## any purpose with or without fee is hereby granted, provided that 6 ## any purpose with or without fee is hereby granted, provided that
7 ## the above copyright notice and this permission notice appear in all 7 ## the above copyright notice and this permission notice appear in all
8 ## copies. 8 ## copies.
29 Packager: OpenPKG Foundation e.V. 29 Packager: OpenPKG Foundation e.V.
30 Distribution: OpenPKG Community 30 Distribution: OpenPKG Community
31 Class: EVAL 31 Class: EVAL
32 Group: XWindow 32 Group: XWindow
33 License: LGPL 33 License: LGPL
34 Version: 7.2 34 Version: 7.4.4
35 Release: 20090106 35 Release: 20101008
36
37 # package options
38 %option with_demos no
39 36
40 # list of sources 37 # list of sources
41 Source0: http://osdn.dl.sourceforge.net/sourceforge/mesa3d/MesaLib-%{version}.tar.bz2 38 Source0: http://osdn.dl.sourceforge.net/sourceforge/mesa3d/MesaLib-%{version}.tar.bz2
42 Source1: http://osdn.dl.sourceforge.net/sourceforge/mesa3d/MesaGLUT-%{version}.tar.bz2 39 Source1: http://osdn.dl.sourceforge.net/sourceforge/mesa3d/MesaGLUT-%{version}.tar.bz2
43 Source2: http://osdn.dl.sourceforge.net/sourceforge/mesa3d/MesaDemos-%{version}.tar.bz2
44 Patch0: mesa.patch 40 Patch0: mesa.patch
45 41
46 # build information 42 # build information
47 Prefix: %{l_prefix} 43 Prefix: %{l_prefix}
48 BuildRoot: %{l_buildroot} 44 BuildRoot: %{l_buildroot}
49 BuildPreReq: OpenPKG, openpkg >= 20040130 45 BuildPreReq: OpenPKG, openpkg >= 20040130, X11, gcc, make, autoconf
50 PreReq: OpenPKG, openpkg >= 20040130 46 PreReq: OpenPKG, openpkg >= 20040130, X11
51 BuildPreReq: make, gcc, gcc::with_cxx = yes, autoconf, binutils
52 BuildPreReq: X11
53 PreReq: X11
54 AutoReq: no 47 AutoReq: no
55 AutoReqProv: no 48 AutoReqProv: no
56 49
57 %description 50 %description
58 Mesa is a full-featured 3D graphics rendering library providing the 51 Mesa is a full-featured 3D graphics rendering library providing the
62 GPUs. 55 GPUs.
63 56
64 %track 57 %track
65 prog mesa:MesaLib = { 58 prog mesa:MesaLib = {
66 version = %{version} 59 version = %{version}
67 url = http://prdownloads.sourceforge.net/mesa3d/ 60 url = http://sourceforge.net/projects/mesa3d/files/
68 regex = MesaLib-(7\.\d+(?:\.\d+)?)\.tar\.bz2 61 regex = MesaLib-(7\.\d+(?:\.\d+)?)\.tar\.bz2
69 } 62 }
70 prog mesa:MesaGLUT = { 63 prog mesa:MesaGLUT = {
71 version = %{version} 64 version = %{version}
72 url = http://prdownloads.sourceforge.net/mesa3d/ 65 url = http://sourceforge.net/projects/mesa3d/files/
73 regex = MesaGLUT-(7\.\d+(?:\.\d+)?)\.tar\.bz2 66 regex = MesaGLUT-(7\.\d+(?:\.\d+)?)\.tar\.bz2
74 }
75 prog mesa:MesaDemos = {
76 version = %{version}
77 url = http://prdownloads.sourceforge.net/mesa3d/
78 regex = MesaDemos-(7\.\d+(?:\.\d+)?)\.tar\.bz2
79 } 67 }
80 68
81 %prep 69 %prep
82 # announce exceptional build requirements
83 ( echo "This package has exceptional storage requirements:"
84 echo " mesa-%{version}-root (500 Mo)"
85 echo " Mesa-%{version} (3,5 Go)"
86 echo " mesa-%{version}-<date>.<arch>-<os>-<tag>.rpm (200 Mo)"
87 ) | %{l_rpmtool} msg -b -t notice
88
89 %setup -q -n Mesa-%{version} 70 %setup -q -n Mesa-%{version}
90 %setup -q -n Mesa-%{version} -T -D -b 1 71 %setup -q -n Mesa-%{version} -T -D -b 1
91 %patch -p0 72 %patch -p0
92 %if "%{with_demos}" == "yes"
93 %setup -q -n Mesa-%{version} -T -D -b 2
94 %endif
95 %{l_shtool} subst \ 73 %{l_shtool} subst \
96 -e "s;@l_x11bindir@;`%{l_rc} --query x11_bindir`;g" \ 74 -e "s;@l_x11bindir@;`%{l_rc} --query x11_bindir`;g" \
97 configs/default 75 configs/default
98 %{l_shtool} subst \ 76 %{l_shtool} subst \
99 -e "s;^\(CC\ \ *=\).*;\1 %{l_cc};" \ 77 -e 's;\(PIC_FLAGS =\).*;\1 -fPIC;' \
100 -e "s;^\(CXX\ \ *=\).*;\1 %{l_cxx};" \ 78 configs/linux-*
101 -e "s;^\(CFLAGS\ \ *=\)\(.*\);\1 %{l_cflags -O}\2;" \
102 -e "s;^\(CXXFLAGS\ \ *=\)\(.*\);\1 %{l_cxxflags -O}\2;" \
103 -e "s;^\(CPPFLAGS\ \ *=\)\(.*\);\1 %{l_cppflags}\2;" \
104 -e "s;^\(LDFLAGS\ \ *=\)\(.*\);\1 %{l_ldflags}\2;" \
105 configs/*
106 %{l_shtool} subst \
107 -e 's;^\(EXTRA_LIB_PATH\ *=.*\);\1 -L$(X11LIB_DIR);' \
108 configs/*
109 %{l_shtool} subst \
110 -e "s;\.\./images/;%{l_prefix}/lib/mesa/images/;" \
111 `find . -name '*.c' -o -name '*.cxx'`
112 %{l_shtool} subst \
113 -e 's;\(APP_LIB_DEPS *=.*-l\$(GL_LIB)\);\1 -lstdc++;' \
114 configs/*
115 79
116 %build 80 %build
117 case "%{l_platform -t}" in 81 case "%{l_platform -t}" in
118 *-freebsd* ) plat="freebsd" ;; 82 *-freebsd* ) plat="freebsd" ;;
119 *-netbsd* ) plat="netbsd" ;; 83 *-netbsd* ) plat="netbsd" ;;
121 *-linux* ) plat="linux-static" ;; 85 *-linux* ) plat="linux-static" ;;
122 i?86*-sunos* ) plat="solaris-x86-gcc" ;; 86 i?86*-sunos* ) plat="solaris-x86-gcc" ;;
123 *-sunos* ) plat="sunos5-gcc" ;; 87 *-sunos* ) plat="sunos5-gcc" ;;
124 * ) echo "platform %{l_platform -t} not supported" 2>&1; exit 1; ;; 88 * ) echo "platform %{l_platform -t} not supported" 2>&1; exit 1; ;;
125 esac 89 esac
126 90 CC="%{l_cc}" \
127 # begin building broken mesa build logic 91 CXX="%{l_cxx}" \
128 ( cd configs && rm -f current && ln -s $plat current ) 92 CFLAGS="%{l_cflags -O}" \
129 ( cd src 93 CXXFLAGS="%{l_cxxflags -O}" \
130 CC="%{l_cc}" \ 94 CPPFLAGS="%{l_cppflags}" \
131 CXX="%{l_cxx}" \ 95 LDFLAGS="%{l_ldflags}" \
132 CFLAGS="%{l_cflags -O}" \ 96 X11LIB_DIR="`%{l_rc} --query x11_libdir`" \
133 CXXFLAGS="%{l_cxxflags -O}" \ 97 %{l_make} %{l_mflags} \
134 CPPFLAGS="%{l_cppflags}" \ 98 SHELL="%{l_bash}" \
135 LDFLAGS="%{l_ldflags}" \ 99 $plat
136 X11LIB_DIR="`%{l_rc} --query x11_libdir`" \
137 %{l_make} %{l_mflags -O} \
138 SHELL="%{l_bash}"
139 ) || exit $?
140
141 # correct broken mesa archive logic
142 %{l_shtool} mkdir -f -p -m 755 temphack
143 ( cd temphack
144 %{l_prefix}/bin/ar -x ../src/mesa/libglapi.a
145 %{l_prefix}/bin/ar -x ../src/mesa/libmesa.a
146 %{l_prefix}/bin/ar -d ../lib/libGL.a libglapi.a libmesa.a
147 %{l_prefix}/bin/ar -ru ../lib/libGL.a *.o
148 ) || exit $?
149
150 %if "%{with_demos}" == "yes"
151 # continue building with corrected mesa library
152 ( cd progs
153 CC="%{l_cc}" \
154 CXX="%{l_cxx}" \
155 CFLAGS="%{l_cflags -O}" \
156 CXXFLAGS="%{l_cxxflags -O}" \
157 CPPFLAGS="%{l_cppflags}" \
158 LDFLAGS="%{l_ldflags}" \
159 X11LIB_DIR="`%{l_rc} --query x11_libdir`" \
160 %{l_make} %{l_mflags -O} \
161 SHELL="%{l_bash}"
162 ) || exit $?
163 %endif
164 100
165 %install 101 %install
166 rm -rf $RPM_BUILD_ROOT 102 rm -rf $RPM_BUILD_ROOT
167 %{l_shtool} mkdir -f -p -m 755 \ 103 %{l_shtool} mkdir -f -p -m 755 \
168 $RPM_BUILD_ROOT%{l_prefix}/lib \ 104 $RPM_BUILD_ROOT%{l_prefix}/lib \
169 $RPM_BUILD_ROOT%{l_prefix}/include/GL 105 $RPM_BUILD_ROOT%{l_prefix}/include/GL
170 %{l_shtool} install -c -m 644 \ 106 %{l_shtool} install -c -m 644 \
171 lib/* $RPM_BUILD_ROOT%{l_prefix}/lib/ 107 lib/* $RPM_BUILD_ROOT%{l_prefix}/lib/
172 %{l_shtool} install -c -m 644 \ 108 %{l_shtool} install -c -m 644 \
173 include/GL/*.h $RPM_BUILD_ROOT%{l_prefix}/include/GL/ 109 include/GL/*.h $RPM_BUILD_ROOT%{l_prefix}/include/GL/
174 %if "%{with_demos}" == "yes"
175 %{l_shtool} mkdir -f -p -m 755 \
176 $RPM_BUILD_ROOT%{l_prefix}/lib/mesa/demos \
177 $RPM_BUILD_ROOT%{l_prefix}/lib/mesa/images
178 %{l_shtool} install -s -c -m 755 \
179 `find progs/demos/ -type f -prune -perm 755 -print` \
180 `find progs/redbook/ -type f -prune -perm 755 -print` \
181 `find progs/samples/ -type f -prune -perm 755 -print` \
182 `find progs/xdemos/ -type f -prune -perm 755 -print` \
183 $RPM_BUILD_ROOT%{l_prefix}/lib/mesa/demos/
184 %{l_shtool} install -c -m 644 \
185 progs/images/* $RPM_BUILD_ROOT%{l_prefix}/lib/mesa/images/
186 %endif
187 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} 110 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
188 111
189 %files -f files 112 %files -f files
190 113
191 %clean 114 %clean

mercurial