# HG changeset patch # User Michael Schloh von Bennewitz # Date 1231406330 -3600 # Node ID 673ed164f8e55d647081bc9f668e39790a9a8bad # Parent fa4856f209c2c6ab5cfb153fd9175dead475dc5f Import package vendor original specs for necessary manipulations. diff -r fa4856f209c2 -r 673ed164f8e5 lsof/lsof.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lsof/lsof.patch Thu Jan 08 10:18:50 2009 +0100 @@ -0,0 +1,183 @@ +Index: Configure +--- Configure.orig 2008-04-15 15:24:36 +0200 ++++ Configure 2008-04-16 08:19:20 +0200 +@@ -413,7 +413,7 @@ + fi # } + fi # } + LSOF_TGT="aix" +- echo $LSOF_CC | grep gcc > /dev/null ++ $LSOF_CC --version | grep GCC > /dev/null + if test $? -eq 0 # { + then + +@@ -567,7 +567,7 @@ + + rm -f dialects/aix/aix5/j2/j2_snapshot.h + fi # } +- echo $LSOF_CC | grep gcc > /dev/null ++ $LSOF_CC --version | grep GCC > /dev/null + if test $? -eq 0 # { + then + +@@ -605,7 +605,7 @@ + # This is AIX >= 5 on ia64. + + LSOF_TSTK64=1 +- echo $LSOF_CC | grep gcc > /dev/null ++ $LSOF_CC --version | grep GCC > /dev/null + if test $? -eq 0 # { + then + +@@ -682,7 +682,7 @@ + fi # } + LSOF_TSTK64=1 + LSOF_TMP1=1 +- echo $LSOF_CC | grep gcc > /dev/null ++ $LSOF_CC --version | grep GCC > /dev/null + if test $? -eq 0 # { + then + LSOF_CFGF="$LSOF_CFGF -maix64" +@@ -729,7 +729,7 @@ + fi #} + LSOF_CFGF="$LSOF_CFGF -DAIXV=$LSOF_VERS" + LSOF_DIALECT_DIR=aix +- echo $LSOF_CC | grep gcc > /dev/null ++ $LSOF_CC --version | grep GCC > /dev/null + if test $? -eq 0 # { + then + +@@ -1995,7 +1995,7 @@ + fi # } + fi # } + fi # } +- echo $LSOF_CC | grep gcc > /dev/null ++ $LSOF_CC --version | grep GCC > /dev/null + if test $? -eq 0 # { + then + LSOF_CCV=`$LSOF_CC -v 2>&1 | sed -n 's/.*version \(.*\)/\1/p'` +@@ -2047,7 +2047,7 @@ + then + LSOF_CFGF="$LSOF_CFGF -Ae +DD32" + else +- echo $LSOF_CC | grep -q gcc ++ $LSOF_CC --version | grep -q GCC + if test $? -ne 0 # { + then + LSOF_CFGF="$LSOF_CFGF +DD32" +@@ -2127,7 +2127,7 @@ + echo "* NOTICE! Configuring for 64 bit HP-UX *" + echo "* *" + echo "*****************************************" +- echo $LSOF_CC | grep gcc > /dev/null ++ $LSOF_CC --version | grep GCC > /dev/null + if test $? -eq 0 # { + then + +@@ -2196,7 +2196,7 @@ + else + LSOF_CFGF="$LSOF_CFGF -D_FILE_OFFSET_BITS=64" + LSOF_CINFO="${LSOF_CINFO}, 32 bit HP-UX" +- echo $LSOF_CC | grep gcc > /dev/null ++ $LSOF_CC --version | grep GCC > /dev/null + if test $? -ne 0 # { + then + LSOF_CFGF="$LSOF_CFGF +DAportable" +@@ -3403,7 +3403,7 @@ + LSOF_CCV=`$LSOF_CC -v 2>&1 | sed -n 's/.*version \(.*\)/\1/p'` + fi # } + fi # } +- echo $LSOF_CC | grep gcc > /dev/null ++ $LSOF_CC --version | grep GCC > /dev/null + if test $? -eq 0 # { + then + LSOF_CFGL="-w" +@@ -4040,6 +4040,9 @@ + LSOF_TSTBIGF=" " + LSOF_TSTLFLG="-lsocket -lnsl" + LSOF_VERS="100000" ++ if [ ".`isainfo -k`" = .amd64 ]; then ++ LSOF_CFGL="$LSOF_CFGL -lmp -lmd5 -lscf -ldoor -luutil" ++ fi + ;; + *) + echo Unknown Solaris version: $LSOF_VSTR +@@ -4118,7 +4121,7 @@ + echo "main(){" >> ${LSOF_TMPC}.c + echo "enum prnodetype p=PR_GWINDOWS;}" >> ${LSOF_TMPC}.c + echo "Testing prdata.h for PR_GWINDOWS, using $LSOF_CC" +- echo $LSOF_CC | grep gcc > /dev/null ++ $LSOF_CC --version | grep GCC > /dev/null + if test $? -eq 0 # { + then + $LSOF_CC ${LSOF_TMPC}.c -o ${LSOF_TMPC}.x > /dev/null 2>&1 +@@ -4143,7 +4146,7 @@ + echo "main(){" >> ${LSOF_TMPC}.c + echo "enum prnodetype p=PR_LDT;}" >> ${LSOF_TMPC}.c + echo "Testing prdata.h for PR_LDT, using $LSOF_CC" +- echo $LSOF_CC | grep gcc > /dev/null ++ $LSOF_CC --version | grep GCC > /dev/null + if test $? -eq 0 # { + then + $LSOF_CC ${LSOF_TMPC}.c -o ${LSOF_TMPC}.x > /dev/null 2>&1 +@@ -4173,7 +4176,7 @@ + echo $SOLARIS_KERNBITS | grep 64 > /dev/null + if test $? -eq 0 # { + then +- echo $LSOF_CC | grep gcc > /dev/null ++ $LSOF_CC --version | grep GCC > /dev/null + if test $? -eq 0 # { + then + +@@ -4377,7 +4380,7 @@ + + # Check for Solaris 10 or higher ZFS. + +- if test -r ${LSOF_INCLUDE}/sys/fs/zfs.h # { ++ if false # { + then + LSOF_TMP1="dmu.h zfs_acl.h zfs_debug.h zfs_rlock.h zil.h spa.h zfs_context.h zfs_dir.h zfs_vfsops.h zio.h txg.h zfs_ctldir.h zfs_ioctl.h zfs_znode.h zio_impl.h" + LSOF_TMP2="" +@@ -4460,7 +4463,7 @@ + echo "main(){" >> ${LSOF_TMPC}.c + echo "enum vtype p=VSOCK;}" >> ${LSOF_TMPC}.c + echo "Testing vnode.h for VSOCK, using $LSOF_CC" +- echo $LSOF_CC | grep gcc > /dev/null ++ $LSOF_CC --version | grep GCC > /dev/null + if test $? -eq 0 # { + then + $LSOF_CC ${LSOF_TMPC}.c -o ${LSOF_TMPC}.x > /dev/null 2>&1 +@@ -5139,7 +5142,7 @@ + echo "$i" >> $LSOF_TSTCFLG + done # } + fi # } +-echo $LSOF_CC | grep gcc > /dev/null 2>&1 ++$LSOF_CC --version | grep GCC > /dev/null 2>&1 + if test $? -eq 0 # { + then + echo "-DLT_GCC" >> $LSOF_TSTCFLG +Index: dialects/freebsd/machine.h +--- dialects/freebsd/machine.h.orig 2006-03-28 01:29:14 +0200 ++++ dialects/freebsd/machine.h 2008-04-16 08:17:46 +0200 +@@ -436,6 +436,11 @@ + */ + + /* #define HASSECURITY 1 */ ++#if FREEBSDV>=6000 ++#define HASSECURITY 1 ++#define HAS_SI_PRIV 1 ++#endif /* FREEBSDV>=6000 */ ++ + + + /* +Index: dialects/sun/machine.h +--- dialects/sun/machine.h.orig 2007-04-24 18:23:25 +0200 ++++ dialects/sun/machine.h 2008-04-16 08:17:46 +0200 +@@ -75,6 +75,7 @@ + #include + + # if solaris>=80000 ++#include + #include + #include + #define _KERNEL 1 diff -r fa4856f209c2 -r 673ed164f8e5 lsof/lsof.spec --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lsof/lsof.spec Thu Jan 08 10:18:50 2009 +0100 @@ -0,0 +1,109 @@ +## +## lsof.spec -- OpenPKG RPM Package Specification +## Copyright (c) 2000-2008 OpenPKG Foundation e.V. +## +## Permission to use, copy, modify, and distribute this software for +## any purpose with or without fee is hereby granted, provided that +## the above copyright notice and this permission notice appear in all +## copies. +## +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## + +# package information +Name: lsof +Summary: List Open Files +URL: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ +Vendor: Victor A. Abell +Packager: OpenPKG Foundation e.V. +Distribution: OpenPKG Community +Class: BASE +Group: Debugging +License: BSD +Version: 4.81 +Release: 20081023 + +# list of sources +Source0: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_%{version}.tar.gz +Patch0: lsof.patch + +# build information +Prefix: %{l_prefix} +BuildRoot: %{l_buildroot} +BuildPreReq: OpenPKG, openpkg >= 20040130, gcc +PreReq: OpenPKG, openpkg >= 20040130 +AutoReq: no +AutoReqProv: no + +%description + List Open Files (lsof) shows all currently open file descriptors of + processes. + +%track + prog lsof = { + version = %{version} + url = ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ + regex = lsof_(__VER__)\.tar\.gz + } + +%prep + %setup -q -n lsof_%{version} + %{l_tar} xf lsof_%{version}_src.tar + cd lsof_%{version}_src + %patch -p0 + +%build + cd lsof_%{version}_src + export PATH="/bin:/usr/bin:$PATH" + export LSOF_CC="%{l_cc}" + export LSOF_MAKE="%{l_make} %{l_mflags}" + case "%{l_platform -t}" in + *-freebsd* ) platform="freebsd"; LSOF_CC="/usr/bin/cc"; LSOF_MAKE="/usr/bin/make" ;; + *-linux* ) platform="linux" ;; + *-sunos* ) platform="solaris" ;; + *-netbsd* ) platform="netbsd" ;; + *-hpux* ) platform="hpuxgcc" ;; + *-aix* ) platform="aixgcc" ;; + * ) echo "Platform %{l_platform -t} not supported" 1>&2; exit 1 ;; + esac + ./Configure -n $platform + eval $LSOF_MAKE + +%install + rm -rf $RPM_BUILD_ROOT + %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/bin + %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/man/man8 + ( cd lsof_%{version}_src + %{l_shtool} install -c lsof $RPM_BUILD_ROOT%{l_prefix}/bin/ + %{l_shtool} install -c lsof.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/ + ) || exit $? + strip $RPM_BUILD_ROOT%{l_prefix}/bin/lsof >/dev/null 2>&1 || true + setgid="" + case "%{l_platform -t}" in + *-freebsd* ) setgid="kmem" ;; + *-linux* ) setgid="kmem" ;; + *-sunos* ) setgid="sys" ;; + *-netbsd* ) setgid="kmem" ;; + *-hpux* ) setgid="sys" ;; + *-aix* ) setgid="sys" ;; + esac + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ + %{l_files_std} \ + "%attr(2755,%{l_musr},$setgid) %{l_prefix}/bin/lsof" + +%files -f files + +%clean + rm -rf $RPM_BUILD_ROOT + diff -r fa4856f209c2 -r 673ed164f8e5 mesa/mesa.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mesa/mesa.patch Thu Jan 08 10:18:50 2009 +0100 @@ -0,0 +1,26 @@ +Index: configs/default +--- src/glut/glx/glut_event.c.orig 2008-11-26 19:10:59.000000000 +0100 ++++ src/glut/glx/glut_event.c 2008-11-26 19:11:40.000000000 +0100 +@@ -24,7 +24,7 @@ + # ifdef __sgi + # include /* prototype for bzero used by FD_ZERO */ + # endif +-# if (defined(__FreeBSD__) || defined(SVR4) || defined(CRAY) || defined(AIXV3)) && !defined(FD_SETSIZE) ++# if (defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(SVR4) || defined(CRAY) || defined(AIXV3)) && !defined(FD_SETSIZE) + # include /* select system call interface */ + # ifdef luna + # include +Index: src/glut/glx/glut_event.c +--- configs/default.orig 2008-11-26 19:08:51.000000000 +0100 ++++ configs/default 2008-11-26 19:09:33.000000000 +0100 +@@ -27,8 +27,8 @@ + # Misc tools and flags + SHELL = /bin/sh + MKLIB = $(SHELL) $(TOP)/bin/mklib +-MKLIB_OPTIONS = +-MKDEP = makedepend ++MKLIB_OPTIONS = -static ++MKDEP = @l_x11bindir@/makedepend + MKDEP_OPTIONS = -fdepend + MAKE = make + INSTALL = $(SHELL) $(TOP)/bin/minstall diff -r fa4856f209c2 -r 673ed164f8e5 mesa/mesa.patch.demos --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mesa/mesa.patch.demos Thu Jan 08 10:18:50 2009 +0100 @@ -0,0 +1,79 @@ +Index: progs/demos/Makefile +diff -Nau progs/demos/Makefile.orig progs/demos/Makefile +--- progs/demos/Makefile.orig 2008-08-25 16:46:41.000000000 +0200 ++++ progs/demos/Makefile 2008-11-26 21:42:37.000000000 +0100 +@@ -5,17 +5,17 @@ + + INCDIR = $(TOP)/include + +-OSMESA_LIBS = -L$(TOP)/$(LIB_DIR) -lglut -lOSMesa -lGLU -lGL $(APP_LIB_DEPS) ++OSMESA_LIBS = -L$(TOP)/$(LIB_DIR) -lglut -lOSMesa -lGLU -lGL $(GLUT_LIB_DEPS) + +-OSMESA16_LIBS = -L$(TOP)/$(LIB_DIR) -lglut -lOSMesa16 -lGLU -lGL $(APP_LIB_DEPS) ++OSMESA16_LIBS = -L$(TOP)/$(LIB_DIR) -lglut -lOSMesa16 -lGLU -lGL $(GLUT_LIB_DEPS) + +-OSMESA32_LIBS = -L$(TOP)/$(LIB_DIR) -lglut -lOSMesa32 -lGLU -lGL $(APP_LIB_DEPS) ++OSMESA32_LIBS = -L$(TOP)/$(LIB_DIR) -lglut -lOSMesa32 -lGLU -lGL $(GLUT_LIB_DEPS) + + LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) \ + $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME) + + LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) \ +- $(APP_LIB_DEPS) ++ $(GLUT_LIB_DEPS) + + PROGS = \ + arbfplight \ +@@ -125,14 +125,14 @@ + + + reflect: reflect.o showbuffer.o readtex.o +- $(CC) $(CFLAGS) $(LDFLAGS) reflect.o showbuffer.o readtex.o $(LIBS) -o $@ ++ $(CC) $(CFLAGS) $(LDFLAGS) reflect.o showbuffer.o readtex.o $(OSMESA_LIBS) -o $@ + + reflect.o: reflect.c showbuffer.h + $(CC) -c -I$(INCDIR) $(CFLAGS) reflect.c + + + shadowtex: shadowtex.o showbuffer.o +- $(CC) $(CFLAGS) $(LDFLAGS) shadowtex.o showbuffer.o $(LIBS) -o $@ ++ $(CC) $(CFLAGS) $(LDFLAGS) shadowtex.o showbuffer.o $(OSMESA_LIBS) -o $@ + + shadowtex.o: shadowtex.c showbuffer.h + $(CC) -c -I$(INCDIR) $(CFLAGS) shadowtex.c +Index: progs/samples/Makefile +diff -Nau progs/samples/Makefile.orig progs/samples/Makefile +--- progs/samples/Makefile.orig 2008-08-25 16:46:42.000000000 +0200 ++++ progs/samples/Makefile 2008-11-26 21:46:18.000000000 +0100 +@@ -7,7 +7,7 @@ + + LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME) + +-LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS) ++LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(GLUT_LIB_DEPS) + + PROGS = accum bitmap1 bitmap2 blendeq blendxor copy cursor depth eval fog \ + font line logo nurb olympic overlay point prim quad select \ +@@ -28,6 +28,9 @@ + default: $(PROGS) + + ++nurb: nurb.c ++ $(CC) -I$(INCDIR) $(CFLAGS) $< -L$(LIB_DIR) -l$(GLUT_LIB) $(GLUT_LIB_DEPS) -o $@ ++ + sphere: sphere.o readtex.o + $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) sphere.o readtex.o $(LIBS) -o $@ + +Index: progs/xdemos/Makefile +diff -Nau progs/xdemos/Makefile.orig progs/xdemos/Makefile +--- progs/xdemos/Makefile.orig 2008-08-25 16:46:42.000000000 +0200 ++++ progs/xdemos/Makefile 2008-11-26 21:48:28.000000000 +0100 +@@ -8,7 +8,7 @@ + + LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) + +-LIBS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(APP_LIB_DEPS) ++LIBS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(GLUT_LIB_DEPS) + + PROGS = \ + corender \ diff -r fa4856f209c2 -r 673ed164f8e5 mesa/mesa.spec --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mesa/mesa.spec Thu Jan 08 10:18:50 2009 +0100 @@ -0,0 +1,189 @@ +## +## mesa.spec -- OpenPKG RPM Package Specification +## Copyright (c) 2000-2008 OpenPKG Foundation e.V. +## +## Permission to use, copy, modify, and distribute this software for +## any purpose with or without fee is hereby granted, provided that +## the above copyright notice and this permission notice appear in all +## copies. +## +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## + +# package information +Name: mesa +Summary: OpenGL Toolkit +URL: http://www.mesa3d.org/ +Vendor: Brian Paul +Packager: OpenPKG Foundation e.V. +Distribution: OpenPKG Community +Class: EVAL +Group: XWindow +License: LGPL +Version: 7.2 +Release: 20081126 + +# package options +%option with_demos no + +# list of sources +Source0: http://osdn.dl.sourceforge.net/sourceforge/mesa3d/MesaLib-%{version}.tar.bz2 +Source1: http://osdn.dl.sourceforge.net/sourceforge/mesa3d/MesaGLUT-%{version}.tar.bz2 +Source2: http://osdn.dl.sourceforge.net/sourceforge/mesa3d/MesaDemos-%{version}.tar.bz2 +Patch0: mesa.patch + +# build information +Prefix: %{l_prefix} +BuildRoot: %{l_buildroot} +BuildPreReq: OpenPKG, openpkg >= 20040130 +PreReq: OpenPKG, openpkg >= 20040130 +BuildPreReq: X11, gcc, make, autoconf, binutils +PreReq: X11 +AutoReq: no +AutoReqProv: no + +%description + Mesa is a full-featured 3D graphics rendering library providing the + official OpenGL 2.0 and OpenGL 2.1 APIs. A variety of device drivers + allow Mesa to be used in many different environments ranging from + software emulation to complete hardware acceleration for modern + GPUs. + +%track + prog mesa:MesaLib = { + version = %{version} + url = http://prdownloads.sourceforge.net/mesa3d/ + regex = MesaLib-(7\.\d+(?:\.\d+)?)\.tar\.bz2 + } + prog mesa:MesaGLUT = { + version = %{version} + url = http://prdownloads.sourceforge.net/mesa3d/ + regex = MesaGLUT-(7\.\d+(?:\.\d+)?)\.tar\.bz2 + } + prog mesa:MesaDemos = { + version = %{version} + url = http://prdownloads.sourceforge.net/mesa3d/ + regex = MesaDemos-(7\.\d+(?:\.\d+)?)\.tar\.bz2 + } + +%prep + # announce exceptional build requirements + ( echo "This package has exceptional storage requirements:" + echo " mesa-%{version}-root (500 Mo)" + echo " Mesa-%{version} (3,5 Go)" + echo " mesa-%{version}-.--.rpm (200 Mo)" + ) | %{l_rpmtool} msg -b -t notice + + %setup -q -n Mesa-%{version} + %setup -q -n Mesa-%{version} -T -D -b 1 + %patch -p0 +%if "%{with_demos}" == "yes" + %setup -q -n Mesa-%{version} -T -D -b 2 +%endif + %{l_shtool} subst \ + -e "s;@l_x11bindir@;`%{l_rc} --query x11_bindir`;g" \ + configs/default + %{l_shtool} subst \ + -e "s;^\(CC\ \ *=\).*;\1 %{l_cc};" \ + -e "s;^\(CXX\ \ *=\).*;\1 %{l_cxx};" \ + -e "s;^\(CFLAGS\ \ *=\)\(.*\);\1 %{l_cflags -O}\2;" \ + -e "s;^\(CXXFLAGS\ \ *=\)\(.*\);\1 %{l_cxxflags -O}\2;" \ + -e "s;^\(CPPFLAGS\ \ *=\)\(.*\);\1 %{l_cppflags}\2;" \ + -e "s;^\(LDFLAGS\ \ *=\)\(.*\);\1 %{l_ldflags}\2;" \ + configs/* + %{l_shtool} subst \ + -e 's;^\(EXTRA_LIB_PATH\ *=.*\);\1 -L$(X11LIB_DIR);' \ + configs/* + %{l_shtool} subst \ + -e "s;\.\./images/;%{l_prefix}/lib/mesa/images/;" \ + `find . -name '*.c' -or -name '*.cxx'` + +%build + case "%{l_platform -t}" in + *-freebsd* ) plat="freebsd" ;; + *-netbsd* ) plat="netbsd" ;; + i?86*-linux* ) plat="linux-x86-static" ;; + *-linux* ) plat="linux-static" ;; + i?86*-sunos* ) plat="solaris-x86-gcc" ;; + *-sunos* ) plat="sunos5-gcc" ;; + * ) echo "platform %{l_platform -t} not supported" 2>&1; exit 1; ;; + esac + + # begin building broken mesa build logic + ( cd configs && rm -f current && ln -s $plat current ) + ( cd src + CC="%{l_cc}" \ + CXX="%{l_cxx}" \ + CFLAGS="%{l_cflags -O}" \ + CXXFLAGS="%{l_cxxflags -O}" \ + CPPFLAGS="%{l_cppflags}" \ + LDFLAGS="%{l_ldflags}" \ + X11LIB_DIR="`%{l_rc} --query x11_libdir`" \ + %{l_make} %{l_mflags -O} \ + SHELL="%{l_bash}" + ) || exit $? + + # correct broken mesa archive logic + %{l_shtool} mkdir -f -p -m 755 temphack + ( cd temphack + %{l_prefix}/bin/ar -x ../src/mesa/libglapi.a + %{l_prefix}/bin/ar -x ../src/mesa/libmesa.a + %{l_prefix}/bin/ar -d ../lib/libGL.a libglapi.a libmesa.a + %{l_prefix}/bin/ar -ru ../lib/libGL.a *.o + ) || exit $? + +%if "%{with_demos}" == "yes" + # continue building with corrected mesa library + ( cd progs + CC="%{l_cc}" \ + CXX="%{l_cxx}" \ + CFLAGS="%{l_cflags -O}" \ + CXXFLAGS="%{l_cxxflags -O}" \ + CPPFLAGS="%{l_cppflags}" \ + LDFLAGS="%{l_ldflags}" \ + X11LIB_DIR="`%{l_rc} --query x11_libdir`" \ + %{l_make} %{l_mflags -O} \ + SHELL="%{l_bash}" + ) || exit $? +%endif + +%install + rm -rf $RPM_BUILD_ROOT + %{l_shtool} mkdir -f -p -m 755 \ + $RPM_BUILD_ROOT%{l_prefix}/lib \ + $RPM_BUILD_ROOT%{l_prefix}/include/GL + %{l_shtool} install -c -m 644 \ + lib/* $RPM_BUILD_ROOT%{l_prefix}/lib/ + %{l_shtool} install -c -m 644 \ + include/GL/*.h $RPM_BUILD_ROOT%{l_prefix}/include/GL/ +%if "%{with_demos}" == "yes" + %{l_shtool} mkdir -f -p -m 755 \ + $RPM_BUILD_ROOT%{l_prefix}/lib/mesa/demos \ + $RPM_BUILD_ROOT%{l_prefix}/lib/mesa/images + %{l_shtool} install -s -c -m 755 \ + `find progs/demos/ -type f -prune -perm 755 -print` \ + `find progs/redbook/ -type f -prune -perm 755 -print` \ + `find progs/samples/ -type f -prune -perm 755 -print` \ + `find progs/xdemos/ -type f -prune -perm 755 -print` \ + $RPM_BUILD_ROOT%{l_prefix}/lib/mesa/demos/ + %{l_shtool} install -c -m 644 \ + progs/images/* $RPM_BUILD_ROOT%{l_prefix}/lib/mesa/images/ +%endif + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} + +%files -f files + +%clean + rm -rf $RPM_BUILD_ROOT +