%define libname lib%{name}.so Name: nes_ntsc Version: 0.2.2 Release: 3%{?dist} Summary: Provides a NES NTSC video filtering library Group: System Environment/Libraries License: LGPLv2+ URL: http://www.slack.net/~ant/libs/ntsc.html Source0: http://blargg.fileave.com/libs/%{name}-%{version}.zip BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) BuildRequires: SDL-devel %description NES NTSC video filter library. Pixel artifacts and color mixing play an important role in NES games console graphics. Accepts pixels in native 6-bit NES palette format, or a 9-bit format that includes the three color emphasis bits in PPU register $2001. Can also output an RGB palette for use in a regular blitter %package devel Summary: Development files for nes_ntsc Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel Development files for nes_ntsc %package demos Summary: Examples using nes_ntsc Group: Development/Libraries %description demos Examples using nes_ntsc %prep %setup -q # Some location cleanups sed -i 's/\"SDL.h\"/\<SDL\/SDL.h\>/' demo_impl.h sed -i 's/\"test.bmp\"/\"\/usr\/share\/nes_ntsc\/test.bmp\"/' demo.c # mod EOL{dos}->EOL{unix} %{__sed} -i 's/\r//' *.txt #%{__sed} -i 's/\r//' changes.txt #%{__sed} -i 's/\r//' license.txt #%{__sed} -i 's/\r//' nes_ntsc.txt #%{__sed} -i 's/\r//' readme.txt %build # Compile library, link and give it an soname gcc -c $RPM_OPT_FLAGS -fPIC %{name}.c gcc $RPM_OPT_FLAGS -shared -Wl,-soname,%{libname}.0 -o %{libname}.0.2.2 %{name}.o # Make symlinks now as they are needed ln -s %{libname}.0.2.2 %{libname}.0 ln -s %{libname}.0.2.2 %{libname}.0.2.0 ln -s %{libname}.0.2.2 %{libname} # Compile demos gcc $RPM_OPT_FLAGS benchmark.c -o nes_ntsc_benchmark -L. -lnes_ntsc -lm gcc $RPM_OPT_FLAGS demo.c -o nes_ntsc_demo -L. -lnes_ntsc -lm -lSDL %install rm -rf %{buildroot} mkdir -p %{buildroot}%{_bindir} %{buildroot}%{_libdir} \ %{buildroot}%{_includedir} %{buildroot}%{_datadir}/%{name} # Install include install -pm 0644 %{name}.h %{buildroot}%{_includedir} # Install test roms and examples cp -a tests %{buildroot}%{_datadir}/%{name} install -pm 0644 test.bmp %{buildroot}%{_datadir}/%{name} # Install lib and symlinks install -pm 0755 %{libname}.0.2.2 %{buildroot}%{_libdir} mv %{libname}.0 %{buildroot}%{_libdir} mv %{libname}.0.2.0 %{buildroot}%{_libdir} mv %{libname} %{buildroot}%{_libdir} # Install demos install -p -m0755 nes_ntsc_benchmark %{buildroot}%{_bindir} install -p -m0755 nes_ntsc_demo %{buildroot}%{_bindir} %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %clean rm -rf %{buildroot} %files %defattr(-,root,root,-) %{_libdir}/%{libname}.0 %{_libdir}/%{libname}.0.2.0 %{_libdir}/%{libname}.0.2.2 %doc changes.txt license.txt %files devel %defattr(-,root,root,-) %{_libdir}/%{libname} %{_includedir}/%{name}.h %doc nes_ntsc.txt readme.txt %files demos %defattr(-,root,root,-) %{_datadir}/%{name} %{_bindir}/nes_ntsc_benchmark %{_bindir}/nes_ntsc_demo %changelog * Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.2-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Wed Aug 6 2008 David Timms <iinet.net.au@dtimms> 0.2.2-1 - update ex dribble spec to new release @ new url - meet fedora license guidelines - mod sed patches to suit new source filenames * Sun Oct 29 2006 Ian Chapman <packages@amiga-hardware.com> 0.2.0-1 - Initial Release