Blob Blame History Raw
Summary: Set of portable libraries especially useful for games
Name: plib
Version: 1.8.4
Release: 4%{?dist}
License: LGPL
Group: System Environment/Libraries
URL: http://plib.sourceforge.net/
Source: http://plib.sourceforge.net/dist/plib-%{version}.tar.gz
Patch0: plib-1.8.4-extraqualif.patch
Patch1: plib-1.8.4-fullscreen.patch
Patch2: plib-1.8.4-js.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: gcc-c++, freeglut-devel, libpng-devel
# Use monolithic X up to FC4, and modular X for FC5+
%if 0%{?fedora} < 5
BuildRequires: xorg-x11-devel, Mesa-devel
%else
BuildRequires: libXext-devel, libXi-devel, libXmu-devel, libSM-devel
Buildrequires: libXxf86vm-devel
%endif

%description
This is a set of OpenSource (LGPL) libraries that will permit programmers
to write games and other realtime interactive applications that are 100%
portable across a wide range of hardware and operating systems. Here is
what you need - it's all free and available with LGPL'ed source code on
the web. All of it works well together.


%package devel
Summary: Set of portable libraries especially useful for games
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}

%description devel
This package contains the header files and libraries needed to write
or compile programs that use plib.


%prep
%setup -q
%patch0 -p1 -b .extraqualif
%patch1 -p1 -b .fs
%patch2 -p1 -b .js
# for some reason this file has its x permission sets, which makes rpmlint cry
chmod -x src/sg/sgdIsect.cxx


%build
%configure CXXFLAGS="%{optflags} -fPIC -DXF86VIDMODE"
%{__make} %{?_smp_mflags} 
# and below is a somewhat dirty hack inspired by debian to build shared libs
# instead of static. Notice that the adding of -fPIC to CXXFLAGS above is part
# of the hack.
dirnames=(util sg ssg fnt js net psl pui puAux pw sl sl ssgAux)
libnames=(ul sg ssg fnt js net psl pu puaux pw sl sm ssgaux)
libdeps=("" \
  "-L../util -lplibul" \
  "-L../util -lplibul -L../sg -lplibsg -lGL" \
  "-L../util -lplibul -L../sg -lplibsg -lGL" \
  "-L../util -lplibul" \
  "-L../util -lplibul" \
  "-L../util -lplibul" \
  "-L../util -lplibul -L../sg -lplibsg -L../fnt -lplibfnt -lGL" \
  "-L../util -lplibul -L../sg -lplibsg -L../fnt -lplibfnt -L../pui -lplibpu -lGL" \
  "-L../util -lplibul -lX11 -lGL -lXxf86vm" \
  "-L../util -lplibul" \
  "-L../util -lplibul" \
  "-L../util -lplibul -L../sg -lplibsg -L../ssg -lplibssg -lGL")

for (( i = 0; i < 13; i++ )) ; do
  pushd src/${dirnames[$i]}
  gcc -shared -Wl,-soname,libplib${libnames[$i]}.so.%{version} \
    -o libplib${libnames[$i]}.so.%{version} `ar t libplib${libnames[$i]}.a` \
    ${libdeps[$i]}
  ln -s libplib${libnames[$i]}.so.%{version} libplib${libnames[$i]}.so
  popd
done


%install
%{__rm} -rf %{buildroot}
%{__make} install DESTDIR=%{buildroot}
# we don't want the static libs
%{__rm} %{buildroot}%{_libdir}/*.a
# instead do a DIY install of the shared libs we created
%{__cp} -a `find . -name "libplib*.so*"` %{buildroot}%{_libdir}


%clean
%{__rm} -rf %{buildroot}


%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files
%defattr(-, root, root, -)
%doc AUTHORS COPYING ChangeLog NOTICE README
%{_libdir}/libplib*.so.%{version}

%files devel
%defattr(-, root, root, -)
%{_includedir}/*
%{_libdir}/libplib*.so


%changelog
* Sat Jun  3 2006 Hans de Goede <j.w.r.degoede@hhs.nl> 1.8.4-4
- Taking over as plib maintainer (discussed in bz 192086).
- Add a patch for better fullscreen support (bz 192086).
- Build shared libs instead of static ones. Note: this makes the base
  package a real package instead of only having a -devel package.

* Mon Mar  6 2006 Matthias Saou <http://freshrpms.net/> 1.8.4-3
- FC5 rebuild.

* Thu Feb  9 2006 Matthias Saou <http://freshrpms.net/> 1.8.4-2
- Rebuild for new gcc/glibc and modular X.
- Include gcc 4.1 patch to fix extra qualification errors.

* Mon Jun 27 2005 Matthias Saou <http://freshrpms.net/> 1.8.4-1
- Update to 1.8.4.

* Sun May 22 2005 Jeremy Katz <katzj@redhat.com> - 1.8.3-7
- rebuild on all arches

* Fri Apr  7 2005 Michael Schwendt <mschwendt[AT]users.sf.net> 1.8.3-6
- rebuilt

* Wed Feb  9 2005 Matthias Saou <http://freshrpms.net/> 1.8.3-5
- Force -fPIC to be added to CXXFLAGS to fix linking against the lib on x86_64.

* Wed Nov 24 2004 Matthias Saou <http://freshrpms.net/> 1.8.3-4
- Bump release to provide Extras upgrade path.

* Thu Jul 15 2004 Matthias Saou <http://freshrpms.net/> 1.8.3-3
- Only build a devel package now as all files are headers and static libs.

* Wed May 19 2004 Matthias Saou <http://freshrpms.net/> 1.8.3-2
- Rebuild for Fedora Core 2.

* Thu Apr 15 2004 Matthias Saou <http://freshrpms.net/> 1.8.3-1
- Update to 1.8.3.

* Tue Nov 11 2003 Matthias Saou <http://freshrpms.net/> 1.6.0-3
- Rebuild for Fedora Core 1.

* Mon Mar 31 2003 Matthias Saou <http://freshrpms.net/>
- Rebuilt for Red Hat Linux 9.

* Wed Dec  4 2002 Matthias Saou <http://freshrpms.net/>
- Update to 1.6.0.

* Wed Jun 20 2001 Matthias Saou <http://freshrpms.net/>
- Initial RPM release.