Ubuntu packaging and PPA

Ubuntu packaging and PPA

Postby svenskmand » 17 Nov 2010, 18:45

I am in the process of learning how to make a .deb package and make that into a PPA - which is a logistical (versioning, dependencies, changelogs, etc.) and legal (proper copyright forms, etc.) nightmare :S - so people can easily and hassle free install OD, but I will get there at some point. This thread is for updating you, the OD community, of the progress and ask you questions about stuff that I need.

I have made a script for clean compiling the game and all dependent libraries, thanks to some help from oln. The next thing I will need is a media pack to use, so: Skorpio could you make me a media pack, and preferably give me instructions on how you made it? It will be perfect if it can be made completely from the command line, so I can automate the process into a single-click and forget job, which I can then use in the .deb packaging job.
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Re: Ubuntu packaging and PPA

Postby Skorpio » 17 Nov 2010, 20:04

Um, why don't you take the models and materials from SVN and put them in your media folder? The textures are in the source folders.
User avatar
Skorpio
OD Moderator
 
Posts: 775
Joined: 05 Dec 2009, 18:28

Re: Ubuntu packaging and PPA

Postby svenskmand » 17 Nov 2010, 20:26

I plan on making a script that does something along the lines of that. But do I not need to make some conversion, say using Blender to get the final material for the media pack? What about the folders (and their content): DeferredShadingMedia, fonts, gui, levels, overlays, packs and particle, they are not in the SVN? What is for OD and what is for Ogre? What needs to be maintained?
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Re: Ubuntu packaging and PPA

Postby Skorpio » 17 Nov 2010, 20:43

Lately I uploaded the whole Ogre material and model files that you can find in your media folder as well. The pit demon and the wyvern have test normal map materials and they can only be loaded by the game if you also have the "Examples.program" file in your scripts folder. At least I hope that's all you need. If the game gives you an error message I'll have to upload simpler scripts for those two models.

svenskmand {l Wrote}:What about the folders (and their content): DeferredShadingMedia, fonts, gui, levels, overlays, packs and particle, they are not in the SVN? What is for OD and what is for Ogre? What needs to be maintained?


I'm not sure about these folders. Looks like default Ogre stuff, except levels.
User avatar
Skorpio
OD Moderator
 
Posts: 775
Joined: 05 Dec 2009, 18:28

Re: Ubuntu packaging and PPA

Postby svenskmand » 17 Nov 2010, 22:40

Andrew do you know about these other folders? Where can I get the newest level files, will they be in the git repo? Should we move the levels to the svn, given that they are really content and not source code?
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Re: Ubuntu packaging and PPA

Postby andrewbuck » 17 Nov 2010, 23:20

I generally keep at least the test level that loads by default under the git repository, since when the level reading/writing code changes the level file gets changed at exactly the same time. Also, the level files are text files which git does just fine with. We can put some or all of the level files into the SVN repository as well however be warned that the level file format is not carved in stone yet so files you make may need to be updated to work with new code. I maintain the file Media/levels/Test.level to be exactly in sync with the code so that file will always load properly in any version you check out from git.

As for the other files and folders some of those are not needed, some of them are. The file gui/OpenDungeons.layout specifies the cegui layout (buttons, mana, gold, etc). The fonts directory (or at least some of it is part of CEGUI and the overlays directory I think is for the little display that shows the framerate and polycount for the ogre scene. Packs and particle are part of ogre, I think particle could be gotten rid of and packs needs at least one of the files in their (something like ogrecore.zip if I remember) but probably does not need some of the other stuff. I went through and trimmed out most of the excess junk at one point but that directory got lost.

-Buck
andrewbuck
OD Moderator
 
Posts: 563
Joined: 20 Dec 2009, 01:42

Re: Ubuntu packaging and PPA

Postby svenskmand » 24 Nov 2010, 20:30

Andrew: is there a place where I can grap the version number of the game? E.g. in the git repo somewhere? I need it to make a tarball with the source. I now have a fully automated tarball generator script, to use to build the deb package, but I need to also name it with the current version number, whenever that changes.

Also should I upload the tar on the project page for people running other distros than Ubuntu/Debian so they can build nice and easy with "cmake .; make"?
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Re: Ubuntu packaging and PPA

Postby andrewbuck » 24 Nov 2010, 20:33

The version number is stored in include/Defines.h

uploading the .tar file to SF would be good.

-Buck
andrewbuck
OD Moderator
 
Posts: 563
Joined: 20 Dec 2009, 01:42

Re: Ubuntu packaging and PPA

Postby svenskmand » 24 Nov 2010, 22:03

What is the format of the version number? Is it e.g. always [0-9].[0-9].[0-9] like in '#define VERSION "0.4.5"' or can it be two digits?
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Re: Ubuntu packaging and PPA

Postby Bodsda » 24 Nov 2010, 22:50

svenskmand {l Wrote}:What is the format of the version number? Is it e.g. always [0-9].[0-9].[0-9] like in '#define VERSION "0.4.5"' or can it be two digits?


Not entirely sure what you need it for, but if you are attempting to script grabbing the version number, use a split like this

{l Code}: {l Select All Code}
>>> version = "0.4.5"
>>> major,minor,patch = version.split('.')
>>> major,minor,patch
('0', '4', '5')
>>>


Bodsda
User avatar
Bodsda
OD Moderator
 
Posts: 195
Joined: 18 Feb 2010, 08:19

Re: Ubuntu packaging and PPA

Postby svenskmand » 24 Nov 2010, 23:00

So I have this script which makes a tarball of the source by grabbing everything from svn and git:
{l Code}: {l Select All Code}
#!/bin/sh
# Making a source tar file for OpenDungeons
cd ~/Desktop
mkdir OpenDungeons
cd OpenDungeons
svn co https://opendungeons.svn.sourceforge.net/svnroot/opendungeons/Media Media
cd ~/Desktop
git clone git://opendungeons.git.sourceforge.net/gitroot/opendungeons/opendungeons OpenDungeonsCode
cd OpenDungeonsCode
git checkout -b development remotes/origin/development
cd ~/Desktop
cp -R OpenDungeonsCode/* OpenDungeons
rm -rf OpenDungeonsCode
find OpenDungeons -name ".svn" -exec rm -rf {} \;
find OpenDungeons -name ".git" -exec rm -rf {} \;
tar czf opendungeons-`grep VERSION OpenDungeons/include/Defines.h | sed 's:#define.*VERSION. *"::' | sed 's:".*::'`.tar.gz OpenDungeons
rm -rf OpenDungeons

and I need to name the tarball using the version number, so I found it in the Defines.h file, and I want to know the format of the number such that I do not get errors in my script when grabbing it.
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Re: Ubuntu packaging and PPA

Postby Bodsda » 24 Nov 2010, 23:50

svenskmand {l Wrote}:So I have this script which makes a tarball of the source by grabbing everything from svn and git:
{l Code}: {l Select All Code}
#!/bin/sh
# Making a source tar file for OpenDungeons
cd ~/Desktop
mkdir OpenDungeons
cd OpenDungeons
svn co https://opendungeons.svn.sourceforge.net/svnroot/opendungeons/Media Media
cd ~/Desktop
git clone git://opendungeons.git.sourceforge.net/gitroot/opendungeons/opendungeons OpenDungeonsCode
cd OpenDungeonsCode
git checkout -b development remotes/origin/development
cd ~/Desktop
cp -R OpenDungeonsCode/* OpenDungeons
rm -rf OpenDungeonsCode
find OpenDungeons -name ".svn" -exec rm -rf {} \;
find OpenDungeons -name ".git" -exec rm -rf {} \;
tar czf opendungeons-`grep VERSION OpenDungeons/include/Defines.h | sed 's:#define.*VERSION. *"::' | sed 's:".*::'`.tar.gz OpenDungeons
rm -rf OpenDungeons

and I need to name the tarball using the version number, so I found it in the Defines.h file, and I want to know the format of the number such that I do not get errors in my script when grabbing it.


This will get you the version number assuming your build dir is in ~/OpenDungeons
{l Code}: {l Select All Code}
grep -i version ~/OpenDungeons/include/Defines.h | awk '{print $3}'


Bodsda
User avatar
Bodsda
OD Moderator
 
Posts: 195
Joined: 18 Feb 2010, 08:19

Re: Ubuntu packaging and PPA

Postby oln » 01 Mar 2011, 13:39

I have set up a PPA at https://launchpad.net/opendungeons now. Will prioritise working on getting packages.
User avatar
oln
 
Posts: 1020
Joined: 26 Oct 2010, 22:16
Location: Norway

Re: Ubuntu packaging and PPA

Postby jawCross » 08 Mar 2011, 09:36

Hi I tried compile opendungeons on my own PPA, but it didn't success.

I compiled it first locally under Ubuntu, using andrewfenn/ogredev-PPA. No problem.
I set my PPA to depends on ogredev-PPA. It got needed packages installed, but cmake didn't found them. I have never make cmake-magic so I really do not understand how to start solve this.

Buildlog:
cmake:
-- checking for one of the modules 'CEGUI'
-- Could not find CEGUI
-- CEGUI not found
-- checking for one of the modules 'CEGUI-OGRE'
-- Could not find CEGUIOGRE
-- CEGUIOGRE not found

make
In file included from /build/buildd/opendungeons-0.4.7/include/Tile.h:20,
from /build/buildd/opendungeons-0.4.7/include/Globals.h:7,
from /build/buildd/opendungeons-0.4.7/src/AnimatedObject.cpp:1:
/build/buildd/opendungeons-0.4.7/include/SoundEffectsHelper.h:12: fatal error: CEGUIMouseCursor.h: No such file or directory
compilation terminated.


With these I can make locally deb-package, which works:

debian/control
{l Code}: {l Select All Code}
Source: opendungeons
Section: games
Priority: extra
Maintainer:
Build-Depends: debhelper (>= 5),  cmake, libois-dev, libfreeimage-dev, libsfml-dev, libopenal-dev, libogre-dev, libcegui-dev
Standards-Version: 3.7.2

Package: opendungeons
Architecture: any
Depends: ${shlibs:Depends}
Description: OpenDungeons http://opendungeons.sourceforge.net/



debian/rules
{l Code}: {l Select All Code}
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1


# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)


CFLAGS = -Wall -g

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
   CFLAGS += -O0
else
   CFLAGS += -O2
endif

configure:
   dh_testdir


build:
   dh_testdir
   cmake .
   $(MAKE)


clean:
   dh_testdir
   dh_testroot


   # Add here commands to clean up after the build process.
   -$(MAKE) distclean


   dh_clean

install: build
   dh_testdir
   dh_testroot
   dh_clean -k
   dh_installdirs

   # Folders
   install -d ${CURDIR}/debian/opendungeons/opt/opendungeons/

   #Binary
   install ${CURDIR}/OpenDungeons.bin ${CURDIR}/debian/opendungeons/opt/opendungeons/

   #Media
   cp -r ${CURDIR}/Media ${CURDIR}/debian/opendungeons/opt/opendungeons/Media


   touch ${CURDIR}/Ogre.log
   touch ${CURDIR}/CEGUI.log

   #config-files and empty log-files (with write access)
   install -m a+rw ${CURDIR}/ogre.cfg ${CURDIR}/debian/opendungeons/opt/opendungeons/
   install -m a+rw ${CURDIR}/plugins.cfg ${CURDIR}/debian/opendungeons/opt/opendungeons/
   install -m a+rw ${CURDIR}/resources_install.cfg ${CURDIR}/debian/opendungeons/opt/opendungeons/resources.cfg
   install -m a+rw ${CURDIR}/Ogre.log ${CURDIR}/debian/opendungeons/opt/opendungeons/
   install -m a+rw ${CURDIR}/CEGUI.log ${CURDIR}/debian/opendungeons/opt/opendungeons/


   #write acces for users
   chmod a+w ${CURDIR}/debian/opendungeons/opt/opendungeons/*.log
   chmod a+w ${CURDIR}/debian/opendungeons/opt/opendungeons/*.cfg

# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build install
   dh_testdir
   dh_testroot

   dh_installdocs
   dh_installexamples

   dh_installman
   dh_link
   dh_strip
   dh_compress

   dh_installdeb
   dh_shlibdeps
   dh_gencontrol
   dh_md5sums
   dh_builddeb

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
jawCross
 
Posts: 6
Joined: 22 Feb 2011, 14:02

Re: Ubuntu packaging and PPA

Postby oln » 09 Mar 2011, 01:36

Somehow i didn't see this post before now. If you want to maintain a PPA for this that would be awesome!
I haven't used launchpad for building before, so I don't know how the build environment there is set up, so I don't know where CMake should look, or if there are any other issues. I'll be happy to help you out to get this working. It would be nice if we could talk it through over IRC, skype, or another type of IM.
User avatar
oln
 
Posts: 1020
Joined: 26 Oct 2010, 22:16
Location: Norway

Re: Ubuntu packaging and PPA

Postby oln » 09 Mar 2011, 02:09

I think it is probably because the script for finding CEGUI only searches using pkg-config, which may not be installed by default.
I will have to update that script anyhow, since it's outdated, but as a temporary workaround you could try adding pkg-config to the build dependencies.

Is this your PPA?
User avatar
oln
 
Posts: 1020
Joined: 26 Oct 2010, 22:16
Location: Norway

Re: Ubuntu packaging and PPA

Postby svenskmand » 09 Mar 2011, 02:24

jawCross@ welcome to the forum :), I have been struggling with understanding how to make a PPA. I am new to Ubuntu/Debian packaging and making PPA's, but it would be great if you could help out with maintaining a PPA for OpenDungeons :)

oln: I have also not seen this post until now, it must be a glitch in the forum :S
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Re: Ubuntu packaging and PPA

Postby jawCross » 09 Mar 2011, 09:37

(First posts on forum are moderated by admins)

oln: Yes, that is my PPA with full buildlog.

I have experience with Ubuntu and PPA and I would like to see Opendungeons easily installable.

I'm testing with pkg-config as explicitly dependency. PPA build queue is often 3 to 12 hours.

I was not sure how OGRE's settings and log files should be handled. My first packeting attempt installs them on whole system visible folder with write access to everybody. (This is not best way at all)
jawCross
 
Posts: 6
Joined: 22 Feb 2011, 14:02

Re: Ubuntu packaging and PPA

Postby oln » 09 Mar 2011, 11:19

The logs and config files should ideally go in a folder under the user's home folder. Some of this we have to fix in the code.
Opendungeons also makes use of an env variable telling it where the data is, if it doesn't exist it will look in the folder where the binary is, so if it's to be installed in e.g /usr/games it should be started with a script telling it where it should look for data.

Also, if you haven't already, you should update to use the latest code from git, or the tag 0.4.7 if you want the latest "stable" release.
User avatar
oln
 
Posts: 1020
Joined: 26 Oct 2010, 22:16
Location: Norway

Re: Ubuntu packaging and PPA

Postby svenskmand » 09 Mar 2011, 11:26

jawCross {l Wrote}:(First posts on forum are moderated by admins)

But I am a mod in here so I should have seen it :S
jawCross {l Wrote}:I have experience with Ubuntu and PPA and I would like to see Opendungeons easily installable.

Nice, when the PPA is up and running (with all configs files and stuff as it is supposed to be) then I could learn how to make a PPA from you?

In any case I wish you welcome aboard :)
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Re: Ubuntu packaging and PPA

Postby jawCross » 09 Mar 2011, 11:42

svenskmand: I think it is best that PPA maintainer is close to development too. I'm not. I will happily share my knowledge.
jawCross
 
Posts: 6
Joined: 22 Feb 2011, 14:02

Re: Ubuntu packaging and PPA

Postby svenskmand » 09 Mar 2011, 11:46

Ok :), I have sent you a message with my email and skype name :)
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Re: Ubuntu packaging and PPA

Postby jawCross » 10 Mar 2011, 19:00

Ok, I success my first proof of concept: opendungeons 0.4.7 stable version with proper start-script installable from PPA. It is not still perfect.

Works on Ubuntu-Maverick 32bit/64bit (Other Ubuntu releases are easily supported too, as long as ogredev-PPA is supporting them.)

INSTALLING (feel free to use any Graphical manager)
{l Code}: {l Select All Code}
#PreRequirement1: universe-repository enabled (libois-1.2.0, libsfml-audio1.6 libsmfl-system1.6 needed for libogremain-1.7.2)
#PreRequirement2: multiverse-repository enabled (nvidia-cg-toolkit needed for libogremain-1.7.2)
sudo add-apt-repository ppa:andrewfenn/ogredev
sudo add-apt-repository ppa:aapo-rantalainen/games
sudo apt-get update
sudo apt-get install libfreeimage3 libzzip-0-13 opendungeons
#(Installation size to liveCD/Fresh-Installed-system is ~140MB)



STARTING from terminal:
{l Code}: {l Select All Code}
opendungeons


opendungeons is script on /usr/bin which change to /opt/opendungeons and execute ./OpenDungeons.bin on there.
Config files and log files are written then on /opt/opendungeons (This is not good on multiuser platform).


Known issues / TODO:
*Add libfreeimage3 and libzzip-0-13 to dependencies (trivial)
*No menu icons. (What is proper icon for menu?)
*Writing logs and configs to ~/.opendungeons. (How OpenDungeons should be started then?)
jawCross
 
Posts: 6
Joined: 22 Feb 2011, 14:02

Re: Ubuntu packaging and PPA

Postby oln » 10 Mar 2011, 19:42

jawCross {l Wrote}:*Writing logs and configs to ~/.opendungeons. (How OpenDungeons should be started then?)


This is something we have to fix in the code, it should be quite trivial.

As for the icon, you can use the OD logo: Image
(Someone here probably has the source files for it.

I put some of the instructions from your post on the wiki as well.
User avatar
oln
 
Posts: 1020
Joined: 26 Oct 2010, 22:16
Location: Norway

Re: Ubuntu packaging and PPA

Postby svenskmand » 10 Mar 2011, 20:30

The logo and banner are already available in the SVN, they can be found here.
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Who is online

Users browsing this forum: No registered users and 1 guest