Reply
Thread Tools
ArnimS's Avatar
Posts: 1,107 | Thanked: 720 times | Joined on Mar 2007 @ Germany
#1
Andrew Flegg has written a utility called Mud-Builder to help automate debian package building in Maemo. After spending a few minutes looking at it, i wrote:

Originally Posted by ArnimS View Post
It should be explained up front in the documentation that 'handle the debianisation for you' doesn't mean you can download a non-debian source package and use mud-builder to make a maemo .deb out of it.
... to which Andrew responded:

Originally Posted by aflegg View Post
That's exactly what it allows you to do. How far it can get is a question of the complexity of the app.
...
Suggestions for specific improvements to the documentation to make this clearer would be welcome. "More documentation" doesn't help with the prioritisation, unfortunately (it's also well known ;-)). Even better is more contributed documentation (e.g. tutorials) etc.
Today I'd like to protocol an attempt to use mud-builder to build a package of a simple SDL app called scavenger, using the mud-builder documentation as a resource. I hope it will serve to help others learn how to use mud-builder, as well as provide constructive feedback for documentation improvements.

Commands will be in normal text, mud-builder doc instructions will be in bold and my comments in italics.

<BEGIN TRANSCRIPT: 14:40 CET>
-------------------------------------------------------------------------
-- Loged-in to scratchbox armel target, svn is installed within the target

From the workflow:
User downloads/installs mud to his scratchbox and adds the necessary configuration to build nmap. Ideally, this would take no more than a single file containing a single line, but obviously more options are available.

Check out mud-builder/trunk from Subversion into a directory under your Scratchbox home:
[sbox-SB_Arm2: ~/Mudbuilder] > svn co https://garage.maemo.org/svn/mud-builder/trunk mud-builder
[sbox-SB_Arm2: ~/Mudbuilder] > cd mud-builder && ls
ARTISTIC AUTHORS INSTALL README TODO config.example lib mud packages upload

# Switch to your SDK_ARMEL target:
sbox-config -st SDK_ARMEL

-- but I'm already IN my armel target!

# Build the existing netcat package:
mud build netcat

-- What? There is no existing package! I just have the source tarball. You did write that it was for building from non-debian sources.

[sbox-SB_Arm2: ~/Mudbuilder] > wget http://www.xdr.com/dash/sdlscav-144.tgz
[sbox-SB_Arm2: ~/Mudbuilder/mud-builder] > tar xzvf sdlscav-144.tgz
[sbox-SB_Arm2: ~/Mudbuilder/mud-builder] > cd sdlscav-144/src/
[sbox-SB_Arm2: ~/Mudbuilder/mud-builder/sdlscav-144/src] > make && strip sdlscav
...
[sbox-SB_Arm2: ~/Mudbuilder/mud-builder/sdlscav-144/src] > ls -l sdlscav
-rwxrwxr-x 1 arnims arnims 58676 Oct 6 14:48 sdlscav

-- ok sdlscav builds fine... now what does mud-builder need to know to build it? Oh.. theres another page of docs, creating a new package. The fact that one must prepare the package wasn't mentioned in the workflow and the getting started docs. Lets do that then...

Switch to the SDK_PC target.
-- For crying out loud, WHY? I've got 12 open windows in the armel target with info and work in-progress, and i'm not bloody-well not losing all that state information just to do this next step.

# Create a file, packages/mycal.xml:

<package>
<fetch type="debian">
<name>cal</name>
</fetch>
</package>

-- Ok, created a sdlscavenger.xml with <name>sdlscavenger</name>

Extract the source to build/mycal/.build:
-- There is no build subdirectory of mud-builder. I guess I have to create one.

[sbox-SB_Arm2: ~/Mudbuilder/mud-builder] > mkdir build
[sbox-SB_Arm2: ~/Mudbuilder/mud-builder] > mkdir build/sdlscavenger
[sbox-SB_Arm2: ~/Mudbuilder/mud-builder] > mkdir build/sdlscavenger/.build
[sbox-SB_Arm2: ~/Mudbuilder/mud-builder/build/sdlscavenger/.build] > cd build/sdlscavenger/.build/
[sbox-SB_Arm2: ~/Mudbuilder/mud-builder/build/sdlscavenger/.build] > tar xzvf ../../../sdlscav-144.tgz
[sbox-SB_Arm2: ~/Mudbuilder/mud-builder/build/sdlscavenger/.build] > cd ../../..
[sbox-SB_Arm2: ~/Mudbuilder/mud-builder] >

mud get mycal
[sbox-SB_Arm2: ~/Mudbuilder/mud-builder] > mud get sdlscavenger
bash: /home/arnims/Mudbuilder/mud: No such file or directory
-- thought this might be a problem

[sbox-SB_Arm2: ~/Mudbuilder/mud-builder] > echo $PWD
/home/minra/Mudbuilder/mud-builder
[sbox-SB_Arm2: ~/Mudbuilder/mud-builder] > alias |grep mud
alias mud='/home/arnims/Mudbuilder/mud'
-- well lets reset that then

[sbox-SB_Arm2: ~/Mudbuilder/mud-builder] > alias mud=$PWD/mud
[sbox-SB_Arm2: ~/Mudbuilder/mud-builder] > alias |grep mud
alias mud='/home/minra/Mudbuilder/mud-builder/mud'

-- rerunning the command
[sbox-SB_Arm2: ~/Mudbuilder/mud-builder] > mud get sdlscavenger
Failed to run get on sdlscavenger: XMLin() requires either XML::SAX or XML::Parser at /home/minra/Mudbuilder/mud-builder/lib/MUD/Package.pm line 40
-- well i've got perl installed in the armel target - i'll just grab a perl module

[sbox-SB_Arm2: ~/Mudbuilder/mud-builder] > cpan -i XML::Parser
(answer "no" to manual configuration)

[sbox-SB_Arm2: ~/Mudbuilder/mud-builder] > mud get sdlscave
Failed to run get on sdlscavenger: XMLin() requires either XML::SAX or XML::Parser at /home/minra/Mudbuilder/mud-builder/lib/MUD/Package.pm line 40
-- Huh? Ok i'll try XML::SAX

[sbox-SB_Arm2: ~/Mudbuilder/mud-builder] > cpan -i XML::SAX
-- answer "yes" to prepend dependencies

[sbox-SB_Arm2: ~/Mudbuilder/mud-builder] > mud get sdlscavenger
.....
Reading Package Lists...
fakeroot apt-get -y -o Dir::Etc::SourceList=/home/minra/Mudbuilder/mud-builder/build/sources.list source sdlscavenger
Reading Package Lists...
Building Dependency Tree...
W: Couldn't stat source package list http://ftp.debian.org etch/main Packages (/var/lib/apt/lists/ftp.debian.org_dists_etch_main_binary-armel_Packages) - stat (2 No such file or directory)
W: You may want to run apt-get update to correct these problems
E: Unable to find a source package for sdlscavenger
Failed to run get on sdlscavenger: Couldn't find extract directory!
at /home/minra/Mudbuilder/mud-builder/lib/MUD/Build.pm line 84


--WHAT? it's trying to get a source package for sdlscavenger? That's it for now. I'm going out for beer.
-------------------------------------------------------------------------
<END TRANSCRIPT: 16:49 CET>

Was this statement correct after all?
Originally Posted by ArnimS View Post
It should be explained up front in the documentation that 'handle the debianisation for you' doesn't mean you can download a non-debian source package and use mud-builder to make a maemo .deb out of it.
... to be continued
 
ArnimS's Avatar
Posts: 1,107 | Thanked: 720 times | Joined on Mar 2007 @ Germany
#2
17:09 < Jaffa> pupnikbeer: I'd need to see the XML file, but it sounds
like you're specifying the source type as debian, when it's
not.
17:09 < pupnikbeer> what should go into type="" for a local file?
17:10 < Jaffa> Because of the way it works, it's probably best to get it
to download the tarball from somewhere.
17:11 < Jaffa> See
http://mud-builder.garage.maemo.org/...=packageformat for
more details
17:11 < Jaffa> In particular, <fetch type="tarball">
17:11 < Jaffa> You can put a local path outside of the mud tree, or a URL
17:11 < pupnikbeer> thanks! i should have read through that. sorry.
 
Reply


 
Forum Jump


All times are GMT. The time now is 09:53.