maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Distributing Binary... (https://talk.maemo.org/showthread.php?t=43811)

jamiefuller 2010-02-08 21:57

Distributing Binary...
 
Hi All,

I've just finished my first game and want to "release" it, but how?

I've read some of the information on debian packages etc but they seem to be overkill for what I need. for example http://wiki.maemo.org/Documentation/...ebian_Packages

The instructions for creating a package are actually twice as long as my source code :)

I have a simple app written in C, its made up of one binary and one png file for gfx.

Is there no simpler way to do this?

Cheers
Jamie

Tomaszd 2010-02-08 22:03

Re: Distributing Binary...
 
Making a simple debian package really isn't that difficult. I can't program for ****, yet I'm able to package things up. How is a reverse situation even possible? :)

rambo 2010-02-08 22:05

Re: Distributing Binary...
 
Quote:

Originally Posted by jamiefuller (Post 516865)
Is there no simpler way to do this?

Sorry, the only way to get the the application installable via the application manager is to make debian package out of it.

Of course you could just release a tarball hosted "somewhere" and hope people bother with extracting it and running the program via terminal (or copying the .desktop etc files to correct places)

Also as stated the helper scripts make the packaging rather simple, just follow the instructions.

jamiefuller 2010-02-08 22:07

Re: Distributing Binary...
 
LOL, may seem strange but I come from a large programming background, but zero linux. and its all very strange :)

Perhaps you can detail how to do it?, I will be releasing my source code to help any programmers along.

Cheers

Tomaszd 2010-02-08 22:14

Re: Distributing Binary...
 
I would suggest getting MADDE and getting to know how it's done there, maybe it's a bit clearer.

mikkov 2010-02-08 22:39

Re: Distributing Binary...
 
Quote:

Originally Posted by jamiefuller (Post 516879)
LOL, may seem strange but I come from a large programming background, but zero linux. and its all very strange :)

Perhaps you can detail how to do it?, I will be releasing my source code to help any programmers along.

Cheers

You had the link for acceptable documentation with details. Here's another document to look things up http://www.debian.org/doc/maint-guide/

In short run dh_make, edit debian/rules to make your program compile/install, edit debian/control for build dependencies and other details, build with dpkg-buildpackage

jamiefuller 2010-02-09 00:37

Re: Distributing Binary...
 
grrrr...

Well I've spent the best part of my night trying to make sense of this but am failing miserably.

i've ran dh_make, i've changed my debian/control file (added icon etc)

I just cannot get it to compile my app in the debian/rules, my app was quite simple so didn't have a make file, so I created a simple makefile for the packager to use

so now it compiles my app but doesn't install it(add it to the deb file). its trying to run the makefile with the install target but what am I supposed to put in there? I presume some kind of copy command, but to where?

It looks like the rules file passes DESTDIR variable to "make" but how do implement that?

Please, any help?

rontti 2010-02-09 07:39

Re: Distributing Binary...
 
Quote:

Originally Posted by jamiefuller (Post 517047)
grrrr...

Well I've spent the best part of my night trying to make sense of this but am failing miserably.

i've ran dh_make, i've changed my debian/control file (added icon etc)

I just cannot get it to compile my app in the debian/rules, my app was quite simple so didn't have a make file, so I created a simple makefile for the packager to use

so now it compiles my app but doesn't install it(add it to the deb file). its trying to run the makefile with the install target but what am I supposed to put in there? I presume some kind of copy command, but to where?

It looks like the rules file passes DESTDIR variable to "make" but how do implement that?

Please, any help?

Please send more detailed information that we can help. Output of failed build might be helpful.

About DESTDIR case. You need 'install' target in you Makefile that uses DESTDIR. There is one example.

Code:

install:
      mkdir -p $(DESTDIR)/usr/bin
      cp you_program $(DESTDIR)/usr/bin


jamiefuller 2010-02-09 08:16

Re: Distributing Binary...
 
Thanks Rontti,

sorry my message didn't have more detail, I wrote it at 1am after 5 hours of trying and was too tired to make much sense :)

anyway, you're example for the makefile is brilliant and makes sense but the created .deb file still doesn't contain the binary.

Thanks again, and thanks in advance if you can help me out a bit more.

here is my makefile

Code:

all:
        gcc -g -Wall `sdl-config --cflags` `sdl-config --libs` -L /usr/include/SDL -lSDL_image delite.c -o de-lite

install:
        mkdir -p $(DESTDIR)/usr/bin
        cp de-lite $(DESTDIR)/usr/bin


and here is the results of the dpkg-package are:
Code:

dpkg-buildpackage: source package is de-lite
dpkg-buildpackage: source version is 1.0.0-1
dpkg-buildpackage: source changed by Jamie Fuller <me@jamiefuller.com>
dpkg-buildpackage: host architecture armel
dpkg-buildpackage: source version without epoch 1.0.0-1
: Using Scratchbox tools to satisfy builddeps
 fakeroot debian/rules clean
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp
# Add here commands to clean up after the build process.
/scratchbox/tools/bin/make clean
make[1]: Entering directory `/home/jamie/de-lite-1.0.0'
make[1]: *** No rule to make target `clean'.  Stop.
make[1]: Leaving directory `/home/jamie/de-lite-1.0.0'
make: [clean] Error 2 (ignored)
dh_clean
 dpkg-source -b de-lite-1.0.0
dpkg-source: building de-lite in de-lite_1.0.0-1.tar.gz
dpkg-source: building de-lite in de-lite_1.0.0-1.dsc
 debian/rules build
dh_testdir
# Add here commands to configure the package.
touch configure-stamp
dh_testdir
# Add here commands to compile the package.
dh_installdirs
##gcc -g -Wall `sdl-config --cflags` `sdl-config --libs` -L /usr/include/SDL -lSDL_image delite.c -o de-lite
/scratchbox/tools/bin/make
make[1]: Entering directory `/home/jamie/de-lite-1.0.0'
gcc -g -Wall `sdl-config --cflags` `sdl-config --libs` -L /usr/include/SDL -lSDL_image delite.c -o de-lite
delite.c: In function 'main':
delite.c:135: warning: implicit declaration of function 'IMG_Load'
delite.c:135: warning: assignment makes pointer from integer without a cast
make[1]: Leaving directory `/home/jamie/de-lite-1.0.0'
#docbook-to-man debian/de-lite.sgml > de-lite.1
touch build-stamp
 fakeroot debian/rules binary
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
# Add here commands to install the package into debian/de-lite.
/scratchbox/tools/bin/make DESTDIR=/home/jamie/de-lite-1.0.0/debian/de-lite install
make[1]: Entering directory `/home/jamie/de-lite-1.0.0'
mkdir -p /home/jamie/de-lite-1.0.0/debian/de-lite/usr/bin
cp de-lite /home/jamie/de-lite-1.0.0/debian/de-lite/usr/bin
make[1]: Leaving directory `/home/jamie/de-lite-1.0.0'
dh_testdir
dh_testroot
dh_installchangelogs
dh_installdocs
dh_installexamples
dh_installman
dh_link
dh_strip
dh_compress
dh_fixperms
dh_installdeb
dh_shlibdeps
dh_gencontrol
dpkg-gencontrol: warning: unknown substitution variable ${misc:Depends}
dh_md5sums
dh_builddeb
warning, `debian/de-lite/DEBIAN/control' contains user-defined field `Maemo-Icon-26'
dpkg-deb: building package `de-lite' in `../de-lite_1.0.0-1_armel.deb'.
dpkg-deb: ignoring 1 warnings about the control file(s)
 dpkg-genchanges
dpkg-genchanges: warning: unknown information field `Xb-Maemo-Icon-26' in input data in package's section of control info file
dpkg-genchanges: including full source code in upload
dpkg-buildpackage: full upload; Debian-native package (full source is included)


rontti 2010-02-09 08:43

Re: Distributing Binary...
 
You also need clean target.

Code:

all:
        gcc -g -Wall `sdl-config --cflags` `sdl-config --libs` -L /usr/include/SDL -lSDL_image delite.c -o de-lite

install:
        mkdir -p $(DESTDIR)/usr/bin
        cp de-lite $(DESTDIR)/usr/bin

clean:
      -rm de-lite

Note the '-' prefix for rm. Otherwise failure is returned when you have nothing to remove.

jamiefuller 2010-02-09 09:08

Re: Distributing Binary...
 
Hi Rontti,

Thanks again, i'll try that when I get home from work tonight. I did see the clean error but the system ignored it and so did I :)

I'll post my results later.

jamiefuller 2010-02-09 18:27

Re: Distributing Binary...
 
Hi Rontti, thanks so much,

I now have it cracked! you're help made it possible, but even after that it took a good few hours to figure out where things need to go properly (icons and such) its easy once you've done it once but first time out its very hard and the documents don't help much at all. so I really appreciate your help.

One more tiny question.

My game installs the binary to /usr/bin/ but I also have the games gfx in a .png file, currently i'm storing this in the same place, is this ok or should I be storing it elsewhere?

Thanks again.

Rob1n 2010-02-09 18:35

Re: Distributing Binary...
 
Quote:

Originally Posted by jamiefuller (Post 518070)
My game installs the binary to /usr/bin/ but I also have the games gfx in a .png file, currently i'm storing this in the same place, is this ok or should I be storing it elsewhere?

It certainly shouldn't go there anyway - either create a directory in /usr/share, or in /opt (depending on the size of the file).

jamiefuller 2010-02-09 18:40

Re: Distributing Binary...
 
Hi Rob1n,

Thanks, I just figured out about opt, so I've stuck it there. in a subfolder of course.

thanks guys

jamiefuller 2010-02-09 21:07

Re: Distributing Binary...
 
after some further problems with the autobuilder which I figured out myself I have finally managed to sucessfully submit my game to the extras-dev repo, if you're interested I started a new thread about it here:

http://talk.maemo.org/showthread.php?t=43927

Thanks all.


All times are GMT. The time now is 10:22.

vBulletin® Version 3.8.8