These instructions will change after the 0810 release, so I am not putting this in the wiki, it is temporary.
This will take some work, but, since you're only doing a simple device, the following instructions will work. If you choose to do full development on LMCE, you'll need to install 0810, and create a complete build environment, with a functioning build server...
do an SVN checkout of the following branch:
http://svn.linuxmce.org/branches/LinuxMCE-0810 put it in /home/src for example. This is the top of the checkout, which i will refer to as $TOP. It will refer to /home/src/LinuxMCE-0810
then copy the contents of /usr/pluto/lib into $TOP/src.. Notice there is a lib dfirectory under the src/ directory in the checkout, just to clarify.
you then need to create two scripts, and put these into /usr/local/bin
prep.sh
#!/bin/bash
### Use this script to prepare the build for dev work.
### NOTE: Be sure to run unprep to revert the prepped
### makefiles!
## Back up the original unprepped makefiles.
for i in $(find . -name Makefile)
do
echo Backing up $i to $i.unprep
cp $i $i.unprep
done
echo Prepping sources...
find . -iname Makefile -exec sed -e 's/<-mkr_t_compile_defines->/-DKDE_LMCE -DDEBUG -DTHREAD_LOG -DLOG_ALL_QUERIES -I\/opt\/libxine1
-pluto\/include -I\/opt\/libsdl1.2-1.2.7+1.2.8cvs20041007\/include -I\/opt\/libsdl1.2-1.2.7+1.2.8cvs20041007\/include\/SD/' -i '{}'
\;
find . -iname Makefile -exec sed -e 's/<-mkr_t_compile_libs->/-L\/opt\/libxine1-pluto\/lib -L\/opt\/libsdl1.2-1.2.7+1.2.8cvs20041007\/lib/' -i '{}' \;
unprep.sh
#!/bin/bash
### this script undoes all of the prepping steps done by prep.sh by
### simply moving the old prep files back into place.
for i in $(find . -name Makefile.unprep)
do
echo Undoing Prep for $i
mv $i `dirname $i`/Makefile
done
So, now... you can use those to prep and unprep your makefiles generated by DCEGen. I say this, because you'll have to prep them, before building, and unprep them, before sending in a patch.
Once you have this in place:
apt-get install pluto-dcegen
apt-get install pluto-sql2cpp
and you'll have everything you need.
So the basic process to developing a device:
* create a new device template, make note of the device template id#
* in that device template, specify what type of device it is (probably an interface), the commands it should deal with, the events it can send to the rest of the system, and other bits such as plug and play information (if it's a USB device, what's the vendor/model ID, if it's a serial device, do you have a way to send strings to detect it?, if it's an ethernet device, is there a MAC address range?, etc.).
* you then go to $TOP/src/DCEGen and run /usr/pluto/bin/DCEGen -d xxxx where xxxx is the device template #
* then go to $TOP/src/sql2cpp and run /usr/pluto/bin/sql2cpp ... this will generate new define constants that the code needs.
* your new code skeleton is in $TOP/src/MyNewDevice with stubs for each command you need to implement.
you can then manually add the device via advanced > config > devices, make note of the device #.
then you can do the following process:
* hack
* make bin
* cp MyNewDevice /usr/pluto/bin
* /usr/pluto/bin/MyNewDevice -d yy where yy is the device #.
* repeat.
When you are ready to contribute the code, talk to us, and we'll try to fold it in.
-Thom