Create E2 Plugins / OPKG Packages with a Linux PC and Gnome desktop with Nautilus file manager, or KDE desktop with Dolphin file manager.
Be aware: don't translate the code, keep it English
Using a Linux PC and Nautilus (Gnome) file manager you can follow this procedure in order to build an ipk package. This guide uses an Enigma2 plugin as example.
Requirements: dpkg(Debian package management system) and fakeroot(Gives a fake root environment).
Do check your Linux package manager for installing these software.
1. Create Package folders
Create a directory with the following contents.
enigma2-plugin-extensions-mytestplugin_1.0_mipsel/ debian-binary DEBIAN/ control postinst postrm preinst usr/lib/enigma2/python/Plugins/Extensions/MyTestPlugin/ __init__.py plugin.py
2. Create Package files
The debian-binary file contains only '2.0', the plugin directory obviously contains the plugin python source and the DEBIAN folder files must have [like] the following contents :
control:
Package: enigma2-plugin-extensions-mytestplugin Version: 1.0 Description: MyTestPlugin plugin does this and that (Enigma2) Section: extra Priority: optional Maintainer: me <me@foo.com> Architecture: mipsel OE: Homepage: www.vuduo.com Depends: Source: www.vuduo.com
postinst:
#!/bin/sh echo "Restarting Enigma2 to load MyTestPlugin Plugin ..." init 4 killall -9 enigma2 > /dev/null 2>&1 init 3 exit 0
postrm:
#!/bin/sh echo "Removing MyTestPlugin Plugin from the system ..." rm -r /usr/lib/enigma2/python/Plugins/Extensions/MyTestPlugin > /dev/null 2>&1 echo "Restarting Enigma2 to get rid of MyTestPlugin Plugin ..." init 4 killall -9 enigma2 > /dev/null 2>&1 init 3 exit 0
preinst:
#!/bin/sh echo "Checking for an older version of MyTestPlugin in the system..." if [ -d /usr/lib/enigma2/python/Plugins/Extensions/MyTestPlugin ] then rm -rf /usr/lib/enigma2/python/Plugins/Extensions/MyTestPlugin > /dev/null 2>&1 echo "An older version of MyTestPlugin was found and removed" echo "Proceeding to installation..." else echo "MyTestPlugin was not found in the system" echo "Proceeding to installation..." fi exit 0
3. Create nautilus script (Gnome only!)
In order to build ipk directly from nautilus you need to have a script in
~/.gnome2/nautilus-scripts/
Build_folder_into_ipk_package :
#!/bin/bash BASENAME=`basename $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS` DIRNAME=`dirname $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS` cd $DIRNAME && fakeroot -- dpkg-deb --build ./$BASENAME "$BASENAME.ipk" if [ ! -f $DIRNAME/$BASENAME.ipk ]; then zenity --error --title "ERROR.: ipkg not created!" --text " Don't creat it.!\n Please check it." exit 0 else zenity --info --title "OK.: ipkg created successfully." --text " ipkg file created successfully..\n File path: $DIRNAME/$BASENAME.ipk" fi exit 0
To build the package using Nautilus simply right click on folder enigma2-plugin-extensions-mytestplugin_1.0_mipsel and go to Scripts-> Build_folder_into_ipk_package
3. Create Dolphin script (KDE only!)
Create a .desktop file on folder
~/.kde/share/kde4/services/ServiceMenus/
Build_folder_into_ipk_package.desktop [Desktop Entry] Type=Service Icon=utilities-file-archiver X-KDE-Icon=utilities-file-archiver Actions=Build_folder_into_ipk_package ServiceTypes=KonqPopupMenu/Plugin,inode/directory,inode/directory-locked Terminal=true [Desktop Action Build_folder_into_ipk_package] Exec=/bin/sh -c "cd `dirname %U` && fakeroot dpkg-deb --build ./`basename %U` `basename %U`.ipk" Icon=utilities-file-archiver X-KDE-Icon=utilities-file-archiver Name=Build folder into ipk package
Create E2 Plugins / OPKG (IPKG) Packages with Multi OS computer and Enigma2 tuner.
Requirements:
-PuTTY (windows/Linux-see package manager)
-WinSCP(windows)
-Terminal (Linux howto + OS-X howto)
Install: dreambox-opkg-tools-mips_1.0_mipsel.ipk on your Enigma2 tuner, download the package (1.2 version download link).and put it on your Enigma2 tuner in the folder:
/home/root
Execute the following command with putty:
1.0
opkg install /home/root/dreambox-opkg-tools-mips_1.0_mipsel.ipk
1.2
opkg install /home/root/enigma2-plugin-extensions-opkg-tools_1.2_mipsel.ipk
Now the opkg tools are installed.
Building a package:
Let's say that we are going to build a picon package...
Create the following directory structures on your Dreambox/VU+ DUO:
/home/root/SOMENAME
/home/root/SOMENAME/CONTROL
/home/root/SOMENAME/picon
In the folder /home/root/SOMENAME/CONTROL you put the following files.
control
postrm
Make sure that the line endings are in UNIX style if you're doing the work from a Windows machine, you can use NotePad(PlusPlus) wich has support for UNIX style line endings.
In the file control put the following text:
Package: enigma2-plugin-picons-MYPACKAGENAME Version: 2010-10-29 Description: Picons Architecture: mipsel Section: extra Priority: optional Maintainer: xxxx Homepage: xxxx Depends: enigma2 Source: xxxx
When you look at the package name structure 'enigma2-plugin-' will always be the same, the word 'picons' can change according to the style of you package, take a look at your download menu on your Dreambox/VU+ DUO and you'll understand. The xxxx can also be changed to something of your liking.
Then we also have the file postrm, in our example we will put the following in postrm:
#!/bin/sh rm -rf /picon
This file will get executed after we have removed our package, to do some more cleanup.
There is no need to put commands in here to remove the files that you install, they wil automatically be removed.
You can also use the files:
postinst <--Right after the installation
preinst <--Right before the installation
prerm <--Right before the removal
There is still one thing to do in our example, we should put some picon files in the folder:
/home/root/SOMENAME/picon
You can put also some other folders in /home/root/SOMENAME, the directory stucture that you create there, will be the final directory structure that is installed on your Dreambox/VU+ DUO.
Now you can build the package using the command:
opkg-build /home/root/SOMENAME
Wait a bit...., depending on how large your package is, when it has finished building your package. There should be a file called:
/home/root/enigma2-plugin-picons-MYPACKAGENAME_ 2010-10-29_mipsel.ipk
This file you can install using the command:
opkg install /home/root/enigma2-plugin-picons-MYPACKAGENAME_ 2010-10-29_mipsel.ipk
If you put your file somewhere on a webserver you can also use:
opkg install http://www.MYWEBSERVER.com/enigma2-plugin-picons-MYPACKAGENAME_ 2010-10-29_mipsel.ipk
The package will then be downloaded and installed.
E2 Plugin Wiki : Back to the PLi� Wiki : DM500 : DM500+ : DM56xx : DM600 : DM7000 : DM7020 : DM7025 : DM800 : DM8000