Author Topic: issues with menu entries  (Read 1836 times)

Offline Yue

  • Full Member
  • ***
  • Posts: 95
issues with menu entries
« on: May 25, 2010, 11:06:50 PM »
Hi. I'm trying to build an RPM, and I think its almost there, but i can't add menu entries. The RPM builds and installs fine, the program works, and the desktop files appear in a search in lancelot, but they don't appear under Games->Arcade category. Any help is very much appreciated.

Here is my spec file:

Code: [Select]
%define pversion 1.9.0-beta6.9
%define urlsource http://sourceforge.net/projects/deng/files/Doomsday\Engine/1.9.0-beta6.9/deng-%pversion.tar.gz/download

Name : deng
Version : 1.9.0~beta6.9
Release : %mkrel 1
Group : Games/Arcade
Summary : Doomsday Engine: DOOM/Hertic/Hexen port with pretty graphics
License : GPL
URL         : http://doomsdayhq.com/

Source : %{name}-%{pversion}.tar.bz2
BuildRoot         : %{_tmppath}/%{name}-%{version}-build

BuildRequires : cmake
BuildRequires : gcc-c++
BuildRequires : libncurses-devel
BuildRequires : libmesagl1-devel
BuildRequires : libmesaglu1-devel
BuildRequires : libSDL-devel
BuildRequires : libSDL_net-devel
BuildRequires : libSDL_mixer1.2-devel
BuildRequires : libopenal-devel
BuildRequires : libzip1-devel
BuildRequires : libcurl-devel
BuildRequires : libfmod-devel

Requires : openal
Requires : libmesagl1
Requires : libmesaglu1
Requires : libncurses5
Requires : libzip1
Requires : libSDL
Requires : libSDL_mixer1.2
Requires : libSDL_net1.2
Requires : libcurl4
Requires : TiMidity++
Requires : libfmod


%description
The Doomsday Engine allows you to play the classic first-person
shooters DOOM, Heretic, and Hexen using modern technology, with
hardware accelerated 3D graphics, surround sound and much more.

*NOTE* This software is useless without the data files (WAD files)
from the original games. Those should be placed in
/usr/share/deng/data/wads

%prep
%setup -qn deng-%pversion

%build
pushd doomsday;
mkdir obj;
pushd obj;
cmake .. -DCMAKE_INSTALL_PREFIX=%{_prefix} -Dlibdir=%{_libdir} -Ddatadir=%{_datadir}/%{name} -DBUILDOPENAL:BOOL=ON \
-DCMAKE_C_FLAGS:STRING='-O3 -march=i586 -mtune=i586'
make %{?jobs:-j%jobs};
popd;
popd;

%install
b="%{buildroot}";

rm -Rf "$b";
mkdir "$b";
pushd doomsday/obj/;
make install DESTDIR="$b";
popd;

mkdir -p $b%{_datadir}/%{name}/wads;
mkdir -p $b%{_datadir}/%{name}/scripts;

#<---------------------Create startup scripts------------------------------>

cat > $b%{_datadir}/%{name}/scripts/doom << EOF
#!/bin/sh
   %{_bindir}/doomsday -game jdoom -file %{_datadir}/%{name}/wads/doom.wad \
-userdir ~/.deng/jdoom
EOF

cat > $b%{_datadir}/%{name}/scripts/doom2 << EOF
#!/bin/sh
   %{_bindir}/doomsday -game jdoom -file %{_datadir}/%{name}/wads/doom2.wad \
-userdir ~/.deng/jdoom
EOF

cat > $b%{_datadir}/%{name}/scripts/fdtnt << EOF
#!/bin/sh
   %{_bindir}/doomsday -game jdoom -file %{_datadir}/%{name}/wads/tnt.wad \
-userdir ~/.deng/jdoom
EOF

cat > $b%{_datadir}/%{name}/scripts/fdplut << EOF
#!/bin/sh
   %{_bindir}/doomsday -game jdoom -file %{_datadir}/%{name}/wads/plutonia.wad \
-userdir ~/.deng/jdoom
EOF

cat > $b%{_datadir}/%{name}/scripts/heretic << EOF
#!/bin/sh
   %{_bindir}/doomsday -game jheretic -file %{_datadir}/%{name}/wads/heretic.wad \
-userdir ~/.deng/jheretic
EOF

cat > $b%{_datadir}/%{name}/scripts/hexen << EOF
#!/bin/sh
   %{_bindir}/doomsday -game jhexen -file %{_datadir}/%{name}/wads/hexen.wad \
-userdir ~/.deng/jhexen
EOF

chmod +x $b%{_datadir}/%{name}/scripts/*;

#<--------------Copy icons--------------------->

pushd snowberry/graphics/;
mkdir -p $b%{_iconsdir};
cp -f orb* $b%{_iconsdir};
popd;

#<-------------Create .desktop files----------------->

mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications;

cat > $RPM_BUILD_ROOT%{_datadir}/applications/doom.desktop << EOF
[Desktop Entry]
Encoding=UTF-8
Name=Doom
GenericName=FPS game
Exec=%{_datadir}/%{name}/scripts/doom
TryExec=%{_datadir}/%{name}/scripts/doom
Icon=%{_iconsdir}/orb-doom.png
Categories=X-PCLinuxOS-Games-Arcade
Type=Application
X-KDE-StartupNotify=true
EOF

cat > $RPM_BUILD_ROOT%{_datadir}/applications/doom2.desktop << EOF
[Desktop Entry]
Encoding=UTF-8
Name=Doom 2
GenericName=FPS game
Exec=%{_datadir}/%{name}/scripts/doom2
TryExec=%{_datadir}/%{name}/scripts/doom2
Icon=%{_iconsdir}/orb-doom.png
Categories=X-PCLinuxOS-Games-Arcade
Type=Application
X-KDE-StartupNotify=true
EOF

cat > $RPM_BUILD_ROOT%{_datadir}/applications/fdtnt.desktop << EOF
[Desktop Entry]
Encoding=UTF-8
Name=Final Doom - TNT
GenericName=FPS game
Exec=%{_datadir}/%{name}/scripts/fdtnt
TryExec=%{_datadir}/%{name}/scripts/fdtnt
Icon=%{_iconsdir}/orb-doom.png
Categories=X-PCLinuxOS-Games-Arcade
Type=Application
X-KDE-StartupNotify=true
EOF

cat > $RPM_BUILD_ROOT%{_datadir}/applications/fdplut.desktop << EOF
[Desktop Entry]
Encoding=UTF-8
Name=Final Doom - Plutonia
GenericName=FPS game
Exec=%{_datadir}/%{name}/scripts/fdplut
TryExec=%{_datadir}/%{name}/scripts/fdplut
Icon=%{_iconsdir}/orb-doom.png
Categories=X-PCLinuxOS-Games-Arcade
Type=Application
X-KDE-StartupNotify=true
EOF

cat > $RPM_BUILD_ROOT%{_datadir}/applications/heretic.desktop << EOF
[Desktop Entry]
Encoding=UTF-8
Name=Heretic
GenericName=FPS game
Exec=%{_datadir}/%{name}/scripts/heretic
TryExec=%{_datadir}/%{name}/scripts/heretic
Icon=%{_iconsdir}/orb-heretic.png
Categories=X-PCLinuxOS-Games-Arcade
Type=Application
X-KDE-StartupNotify=true
EOF

cat > $RPM_BUILD_ROOT%{_datadir}/applications/hexen.desktop << EOF
[Desktop Entry]
Encoding=UTF-8
Name=Hexen
GenericName=FPS game
Exec=%{_datadir}/%{name}/scripts/hexen
TryExec=%{_datadir}/%{name}/scripts/hexen
Icon=%{_iconsdir}/orb-hexen.png
Categories=X-PCLinuxOS-Games-Arcade
Type=Application
X-KDE-StartupNotify=true
EOF

#<------------Add menu entries--------------->

desktop-file-install \
 --vendor="" \
 --dir $b%{_datadir}/applications \
 $b%{_datadir}/applications/doom.desktop

desktop-file-install \
 --vendor="" \
 --dir $b%{_datadir}/applications \
 $b%{_datadir}/applications/doom2.desktop

desktop-file-install \
 --vendor="" \
 --dir $b%{_datadir}/applications \
 $b%{_datadir}/applications/fdtnt.desktop

desktop-file-install \
 --vendor="" \
 --dir $b%{_datadir}/applications \
 $b%{_datadir}/applications/fdplut.desktop

desktop-file-install \
 --vendor="" \
 --dir $b%{_datadir}/applications \
 $b%{_datadir}/applications/heretic.desktop

desktop-file-install \
 --vendor="" \
 --dir $b%{_datadir}/applications \
 $b%{_datadir}/applications/hexen.desktop

%post
%{update_menus}

%postun
%{clean_menus}

%clean
rm -Rf "%buildroot";

%files
%defattr(-,root,root)
%{_bindir}/doomsday
%{_libdir}/libdpdehread.so
%{_libdir}/libdpwadmapconverter.so
%{_libdir}/libjdoom.so
%{_libdir}/libjheretic.so
%{_libdir}/libjhexen.so
%{_libdir}/libdsopenal.so
%{_datadir}/%{name}
%{_datadir}/applications/doom.desktop
%{_datadir}/applications/doom2.desktop
%{_datadir}/applications/fdtnt.desktop
%{_datadir}/applications/fdplut.desktop
%{_datadir}/applications/heretic.desktop
%{_datadir}/applications/hexen.desktop
%{_iconsdir}/orb-doom.png
%{_iconsdir}/orb-heretic.png
%{_iconsdir}/orb-hexen.png

%changelog
* Sun May 23 2010 xyz_D <xxxxxx@xxxxxx.com> 1.9.0-beta6.9-1pclos2010
- 1.9.0-beta6.9

Thank you.

Offline Texstar

  • Administrator
  • Super Villain
  • *****
  • Posts: 12501
Re: issues with menu entries
« Reply #1 on: May 25, 2010, 11:34:58 PM »
We are still using the legacy xdg menu system from 2007 mdv rebase so the entry would be:

X-MandrivaLinux-MoreApplications-Games-Arcade



You can also check /etc/xdg/menus/applications.menu for possible menu entries in future builds.

Thanks to everyone who donates. You keep the servers running.

Offline Yue

  • Full Member
  • ***
  • Posts: 95
Re: issues with menu entries
« Reply #2 on: May 26, 2010, 11:59:50 AM »
Thank you! that did the trick :D

now, could you tell me how to upload my SRPMs? I already have a dropbox account, but don't know what else to do. Thanks.

Offline Texstar

  • Administrator
  • Super Villain
  • *****
  • Posts: 12501
Re: issues with menu entries
« Reply #3 on: May 27, 2010, 02:57:16 AM »
Thank you! that did the trick :D

now, could you tell me how to upload my SRPMs? I already have a dropbox account, but don't know what else to do. Thanks.

Send me a note to texstar at gmail.com and I will send you an invite to our srpm folder that we share.


Thanks to everyone who donates. You keep the servers running.