Hello:
Here is a draft spec file.
I was unable to get the application to open the FAQ/Readme pdf's file url unless I installed the renamed files (to version 0.9.9) to usr/bin/Docs
I need some help with this.
The resulting rpm file will install on either x86 or x86_64 Fedora, using yum localinstall
Any i686 requirements to run on x86_64 will be installed automatically.
It will only build on an x86 at this time.
--------------------------------------------------
%global pcsx2_version 0.9.8
%global pcsx2_subversion 4851
Name: pcsx2
Version: %{pcsx2_version}.%{pcsx2_subversion}
Release: 1%{?dist}
Summary: A Sony Playstation2 emulator
Group: Applications/Emulators
License: GPLv3
URL:
http://pcsx2.net/
Source0:
http://pcsx2.googlecode.com/svn/trunk/%{...n}.tar.bz2
Source1: %{name}.desktop
Source2: %{name}.png
BuildArch: i686
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
#Build patches
BuildRequires: desktop-file-utils
BuildRequires: cmake
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: zlib-devel
BuildRequires: bzip2-devel
BuildRequires: Cg
BuildRequires: libXrandr-devel
BuildRequires: freetype-devel
BuildRequires: glew-devel
BuildRequires: gettext
BuildRequires: mesa-libGL-devel
BuildRequires: mesa-libGLU-devel
BuildRequires: libjpeg-turbo-devel
BuildRequires: alsa-lib-devel
BuildRequires: libCg
BuildRequires: SDL-devel
BuildRequires: gtk2-devel
BuildRequires: portaudio-devel
BuildRequires: sparsehash-devel
BuildRequires: wxGTK-devel
BuildRequires: soundtouch-devel
BuildRequires: subversion
BuildRequires: libX11-devel
BuildRequires: libICE-devel
Requires: joystick
Requires: evince
%description
PCSX2 is an open source Playstation 2 emulator. It's purpose
is to mimic the the PS2 hardware, using a combination MIPS CPU
Interpreters, Recompilers and a Virtual Machine which manages
hardware states and PS2 system memory. It requires a dump of a
real Playstation 2 BIOS, which is not included.
%prep
%setup -q %{pcsx2_subversion}
%build
# Move and cleanup the Docs and such for Fedora rpm installation
# Cosmetic changes to meet some packaging guidelines.
mv %{name}/Docs/License.txt LICENSE
sed -i 's/\r//' LICENSE
mv %{name}/Docs/GPL.txt GPL
sed -i 's/\r//' GPL
mv %{name}/Docs/readme-Docs.txt README
sed -i 's/\r//' README
# Temporarily rename pdf to match version
mv bin/docs/PCSX2_Readme_0.9.8.pdf bin/docs/PCSX2_Readme_0.9.9.pdf
mv bin/docs/PCSX2_FAQ_0.9.8.pdf bin/docs/PCSX2_FAQ_0.9.9.pdf
# Move some misc files for installation inclusion
mv %{name}/Docs/PCSX2_FAQ_0.9.8.doc PCSX2_FAQ
mv %{name}/Docs/PCSX2_Readme_0.9.8.doc PCSX2_README
mv bin/docs/GPL.html GPL.html
mv fps2bios/doc/overview.doc OVERVIEW
# To create a man page format for Fedora and remove executable bits
mv bin/docs/pcsx2.man pcsx2.1
gzip pcsx2.1
# To remove executable bits from doc files
chmod -x GPL OVERVIEW LICENSE README PCSX2_FAQ PCSX2_README pcsx2.1.gz
# Need to to move the installation of usr/bin/Docs as not permitted a subdir in Fedora
# This doesn't work as it is at the moment
# sed -i 's| L"file:///%s/Docs/PCSX2_FAQ_%u.%u.%u.pdf"| L"file:/usr/share/games/pcsx2/PCSX2_FAQ_%u.%u.%u.pdf"|' pcsx2/gui/Dialogs/FirstTimeWizard.cpp
export CFLAGS="$RPM_OPT_FLAGS"
export CXXFLAGS="$RPM_OPT_FLAGS"
###
cmake . \
-DCMAKE_INSTALL_PREFIX="/usr" \
-DPACKAGE_MODE=TRUE \
-DCMAKE_BUILD_TYPE=Release \
-DFORCE_INTERNAL_ALL=FALSE \
-DPLUGIN_DIR="/usr/lib/pcsx2" \
-DFORCE_INTERNAL_SDL=FALSE \
-DFORCE_INTERNAL_ZLIB=FALSE \
-DFORCE_INTERNAL_SOUNDTOUCH=FALSE \
-DFORCE_INTERNAL_SDL=TRUE \
-DGAMEINDEX_DIR="/usr/share/games/pcsx2"
make %{?_smp_mflags} VERBOSE=1
%install
rm -rf %{buildroot}
%makeinstall DESTDIR=%{buildroot}
# Messages are not picked up by find-lang or I can't get it to work.
# Not good at sed so this might be done more effectively. Thanks to Rahul for a model.
pushd %{buildroot}
find -type f -o -type l \
| sed '
s:%{buildroot}/usr::
s:^\.::
s:\(.*/share/locale/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) \1\2\3:
s:^\([^%].*\)::
s:%lang© ::
/^$/d' \
> %{name}.lang
# Need to move it back to sources to be picked up by the macro [%files -f].
popd && mv %{buildroot}/%{name}.lang .
# Install icon
%{__mkdir_p} %{buildroot}/%{_datadir}/icons
install -pm 755 %{SOURCE2} %{buildroot}/%{_datadir}/icons
# Install Desktop file
%{__mkdir_p} %{buildroot}/%{_datadir}/applications
desktop-file-install --vendor pcsx2 \
--dir=%{buildroot}/%{_datadir}/applications \
%{SOURCE1}
# Install FAQ README pdf's.
# These are installed but should not be installed to a subdir of bin.
# Needs to be fixed upstream or a working patch.
%{__mkdir_p} %{buildroot}/%{_bindir}/Docs
install -pm 755 bin/docs/*.pdf %{buildroot}/%{_bindir}/Docs
install -pm 755 %{name}/Docs/PCSX2_timeline_0.9.8.xlsx %{buildroot}%{_datadir}/games/%{name}
# Install man page
%{__mkdir_p} %{buildroot}/%{_mandir}/man1
install -p -D -m 644 pcsx2.1.gz %{buildroot}/%{_mandir}/man1
%clean
rm -rf rm -rf %{buildroot}
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files -f %{name}.lang
%defattr(-,root,root, 0755)
%doc GPL OVERVIEW LICENSE README PCSX2_FAQ PCSX2_README
%{_bindir}/%{name}
%{_libdir}/%{name}/*
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/%{name}.png
%{_datadir}/games/%{name}/GameIndex.dbf
%{_bindir}/Docs/*.pdf
%{_datadir}/games/%{name}/*.xlsx
%{_mandir}/man1/%{name}.*
%changelog
* Tue Aug 09 2011 Danger Boy <Danger[dot] Boy [at]necac.tv.idl> 0.9.8.4851-1
- initial build
---------------------------------
Also attached the two SOURCE files (icon, desktop) I had to rename
the desktop file to upload.
Not sure I can upload my scr.rpm or not ... is there a size restriction / limit ?