pandora-scripts: Moved scripts from libpnd-GIT to a proper place :)
[openpandora.oe.git] / recipes / pandora-system / pandora-scripts / genpxml.sh
1 #!/bin/bash
2 if [ $1 ]; then cd $1; fi
3  
4 for x in $(pwd)/*
5 do
6 if [ -x $x ] && [ ! -d $x ] && [ ! $(echo $x | cut -d . -f 2 -s) ] ; then exe=$x; break; fi
7 done
8 BASENAMEnoex=$(basename "$exe" | cut -d'.' -f1)
9 BASENAME=$(basename "$exe")
10 rnd=$RANDOM;
11 loc=$(dirname "$0")
12  
13 echo '
14 <?xml version="1.0" encoding="UTF-8"?>
15 <PXML xmlns="http://openpandora.org/namespaces/PXML" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="PXML_schema.xsd">
16
17   <application id="'$BASENAME-$rnd'">
18  
19     <exec command="'$BASENAME'"/>
20
21     <title lang="en_US">'$BASENAMEnoex'</title>
22     <title lang="de_DE">'$BASENAMEnoex' - German (lol!)</title><!--optional, only one title tag required-->
23  
24     <author name="'$USERNAME'" website="http://www.openpandora.org"/><!--Optional email and website, name required-->
25  
26     <version major="1" minor="1" release="1" build="2"/><!--This programs version-->
27     <osversion major="1" minor="0" release="0" build="0"/><!--The minimum OS version required, optional-->
28  
29     <description lang="en_US">en_US Automatically generated pxml from'$(pwd)' exe='$BASENAME'</description>
30     <description lang="de_DE">de_DE Automatisch generiertes pxml aus'$(pwd)' exe='$BASENAME'</description>
31  
32     <!-- if you want to provide an icon, uncomment the following line and set correct filename! -->
33     <!-- <icon src="icon.png"/> -->
34  
35     <previewpics>'
36 #add all images in the folder as preview pics
37 for image in $(file -i -0 * | grep -a image | cut -d" " -f1)
38 do
39 echo "      <pic src="$image"/>"
40 done
41 echo '    </previewpics>
42  
43     <!-- if you want to provide a manual, uncomment the following line and set correct values! -->
44     <!-- <info name="'$BASENAMEnoex' manual" type="text/html" src="manual.html"/> -->
45  
46     <categories>
47     <!-- for information about valid categories and explainations of them, please have a look at this website:
48          http://standards.freedesktop.org/menu-spec/menu-spec-latest.html#category-registry
49          entries with invalid category/subcategory combinations will appear under "others" in the menus! -->
50       <category name="Main category">
51       <!--valid values for "Main category": "AudioVideo", "Audio", "Video", "Development", "Education", "Game", "Graphics", "Network", "Office", "Settings", "System", "Utility"-->
52         <subcategory name="Main Subcategory"/>
53         <!--valid Values for "Subcategory": "Building", "Debugger", "IDE", "GUIDesigner", "Profiling", "RevisionControl", "Translation", "Calendar", "ContactManagement", "Database", "Dictionary", "Chart", "Email", "Finance", "FlowChart", "PDA", "ProjectManagement", "Presentation", "Spreadsheet", "WordProcessor", "2DGraphics", "VectorGraphics", "RasterGraphics", "3DGraphics", "Scanning", "OCR", "Photography", "Publishing", "Viewer", "TextTools", "DesktopSettings", "HardwareSettings", "Printing", "PackageManager", "Dialup", "InstantMessaging", "Chat", "IRCClient", "FileTransfer", "HamRadio", "News", "P2P", "RemoteAccess", "Telephony", "TelephonyTools", "VideoConference", "WebBrowser", "WebDevelopment", "Midi", "Mixer", "Sequencer", "Tuner", "TV", "AudioVideoEditing", "Player", "Recorder", "DiscBurning", "ActionGame", "AdventureGame", "ArcadeGame", "BoardGame", "BlocksGame", "CardGame", "KidsGame", "LogicGame", "RolePlaying", "Simulation", "SportsGame", "StrategyGame", "Art", "Construction", "Music", "Languages", "Science", "ArtificialIntelligence", "Astronomy", "Biology", "Chemistry", "ComputerScience", "DataVisualization", "Economy", "Electricity", "Geography", "Geology", "Geoscience", "History", "ImageProcessing", "Literature", "Math", "NumericalAnalysis", "MedicalSoftware", "Physics", "Robotics", "Sports", "ParallelComputing", "Amusement", "Archiving", "Compression", "Electronics", "Emulator", "Engineering", "FileTools", "FileManager", "TerminalEmulator", "Filesystem", "Monitor", "Security", "Accessibility", "Calculator", "Clock", "TextEditor", "Documentation", "Core", "KDE", "GNOME", "GTK", "Qt", "Motif", "Java", "ConsoleOnly"-->
54         <subcategory name="Subcategory 2"/>
55       </category>
56       <category name="Alternative category">
57         <subcategory name="Alternative Subcategory 1"/>
58       </category>
59     </categories>
60  
61     <!-- if you want to set a fixed clockrate differening from the default (500MHz), uncomment the following line and set it to the value you want (in MHz) -->
62     <!-- <clockspeed frequency="600"/> -->
63
64   </application>
65
66 </PXML>
67 '