LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-16-2007, 10:18 PM   #1
dsubbarao
LQ Newbie
 
Registered: Jan 2007
Distribution: Redhat
Posts: 14

Rep: Reputation: 0
adding shortcut menu from spec file


Hi All,

I am writing spec file for my java application.
I want to create shortcut menu from my spec file. I have used desktop-file-install command but i am gettting the following error:
not enough data to guess encoding!


Please can any body tell me where i am doing wrong???

Here is my spec file for reference.

Summary: Test
Name: AddtGRE
Version: 1.0
Release: 0.1
Source0: gre.tar.gz
License: navayuga
BuildRoot: /var/tmp/%{name}-buildroot
Group : Navayuga
Prefix : /usr/share

%description
This is test file

%prep
%setup -c -q

%install
cp -a ./ $RPM_BUILD_ROOT/

cat > GRE.desktop << EOF
[Desktop Entry]
Name=ddGRE
Comment=GRE
Exec=$RPM_BUILD_ROOT/GRE/GRE -data gre_ws -vmargs -Dcom.amdosoft.oct.ruleeditor.oct_ip_address=127.0.0.1 -Dcom.amdosoft.oct.ruleeditor.oct_session_id=LITESESSIONID -cp $RPM_BUILD_ROOT/GRE/startup.jar org.eclipse.core.launcher.Main -application com.amdosoft.oct.ruleeditor.ui.ruleeditor.application
Terminal=false
Type=Application
Encoding=UTF-8
EOF

desktop-file-install --vendor amdosoft --dir=/usr/share/applications --add-category X-Red-Hat-Extra --add-category Application --add-category Development GRE.desktop


%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
/usr/share/GRE
/usr/bin

%changelog
* Wed Jan 17 2007 sdd sdd@ndddga.co.in
- created the test spec file



Thanks in Advance
 
Old 01-17-2007, 06:12 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Hello and welcome to LQ, hope you like it here.

A few remarks. Your .spec file has values that are, as far as I know, bogus: License, Group. Some valid licensenames you can retrieve with `rpm -qa --qf="%{license}\n"|sort|uniq` or check your RPM / distro docs. For valid groupnames see /usr/share/doc/rpm-%{version}-%{release}/GROUPS or check your distro's docs. It won't stop the build I think but you should not distribute the .spec or RPM this way. Besides that your %files section seems a bit sparsely populated.

If you want to install the desktop file as part of the installation process you should, as far as I know, use a %post clause for it (and a %preun clause for removing it) and change the "here document" location "$RPM_BUILD_ROOT/GRE/GRE" (which expands to /var/tmp/AddtGRE-buildroot/GRE/GRE) to read "/usr/share/GRE" since that's the location the commands will be executed in when installed.

Next think of installing the desktop file as a separate action which you don't need to build an RPM for to test it. Just executing the here doc and install line should show what's the problem. I find that if you remove the "bogus UTF-8 line" it will install and *add* the UTF line all by itself. In closing saving the debug output of building the RPM (tee) and looking at the temp files it leaves on a b0rken build should show clues so use them to your advantage.
 
Old 01-18-2007, 05:14 AM   #3
dsubbarao
LQ Newbie
 
Registered: Jan 2007
Distribution: Redhat
Posts: 14

Original Poster
Rep: Reputation: 0
HI

Thanks for the reply.
Yes i have changed the location to /usr/share.

and i have succeeded in installing it as desktop-file also.The problem was in line " Terminal = false " I have given some spaces after false and it is taking that spaces also as value for the key Terminal .. when i removed the extra spaces ,the creation of rpm was successful.

Thank you very much..
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to add shortcut to k menu abhijeetnayak Linux - Newbie 1 06-09-2006 01:49 PM
Firefox shortcut on menu houmie SUSE / openSUSE 7 04-21-2005 08:30 PM
RPM Spec file creation: %file section question davidas Linux - Newbie 0 03-16-2004 10:36 PM
How do i add a shortcut to my menu? Braveheart1980 Linux - General 1 03-07-2004 10:09 PM
Adding shortcut to the menu & pop up menus hiteshmaisheri Linux - Software 3 11-11-2003 10:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration