[ale] OBS howto for your first project

Jim Lynch ale_nospam at fayettedigital.com
Fri Apr 17 17:18:20 EDT 2009


Greg Freemyer wrote:
> On Fri, Apr 17, 2009 at 2:11 PM, Michael B. Trausch <mbt at zest.trausch.us> wrote:
>   
>> On Fri, 17 Apr 2009 13:30:07 -0400
>> Greg Freemyer <greg.freemyer at gmail.com> wrote:
>>
>>     
>>> At least for now you still have to know how to package.  The build
>>> service just keeps you from having to have your own farm of different
>>> distros.  It also will build all the various versions automatically
>>> each time you update a file.
>>>       
>> Ahh.  Well, someone will have to probably come along and RPM-ize my
>> stuff later when it is ready, then, or I'll have to spend a lot of time
>> reading or something.  I only know how to work with Debian packages at
>> present; I think that the Debian system for building packages is
>> (mostly) intuitive, though I think it could be better...
>>     
>
> If you can get a debian.rules file to work. You can guess your way
> through a spec file pretty quickly.
>
> I did it the other way around.  ie. Spent several iterations going
> back and forth getting the spec file right, then simply copied the
> chunks from there into the right slots in the various debian control
> files.
>
> Basically they both need the same info. just different syntax.
>
>   
>>> If you look at my open2300 project you'll see about 6 files I think:
>>>
>>> ....tar.gz     tarball like you're used to
>>> ....dsc        simple debian description file
>>> debian.control   simple debian control file
>>> debian.changlog simple changelog file
>>> debian.rules     this is the complex file that really controls a
>>> debian build
>>>
>>> ...spec   the single control file for rpm based builds
>>>
>>> For my simple project, a single set of 4 debian control files allowed
>>> debs to be built for all the obs supported deb environments.
>>>       
>> So those files are in the root, or do you put them in the debian/
>> directory like you would in a Debian source package?
>>
>>     
>
> They get automatically popped into the build root I believe.  It sort
> of all happens magically.
>
> ie. When the obs build starts it creates a xen environment for debian
> lenny as an example and installs a basic set of packages.
>
> Then alltray.....tar.gz file gets expanded into a temp build directory
> for you.
>
> If you look at my debian.rules file you'll see:
>
> build: build-stamp
> build-stamp:
>     dh_testdir
>
>     # Add here commands to compile the package.
>     make
>     # --- end custom part for compiling
>
>     touch build-stamp
>
> The dh_testdir command I assume is causing the build dir to get
> created and the tarball to be extracted into it.
>
> My package is compiled by a simple make as shown above.  You will
> replace that with whatever your equivalent is.
>
>   
>>> Alternatively, my spec file is working for "most" of the rpm based
>>> environments.  The exception for now is the 64-bit version of fedora
>>> requires an extra flag that I have not tried to set yet.
>>>       
>> Would that be that silly -fPIC?
>>
>>     
>>> I have only really looked in any detail at the spec file for building
>>> rpms.  It allows if / then logic.  Thus if you need a slightly
>>> different setup for a fedora build than for a opensuse build, you
>>> still have a single spec file, but it contains logic to do slightly
>>> different things on different distros.
>>>       
>> I am guessing that it doesn't use a simple Makefile like Debian's
>> "rules" does, then?  Is it a DSL or shell type thing or something?
>>     
>
> Both use a Makefile.  That should be in your tarball which is used by
> all the distros.
>
> The issue that I found was the dependencies.  Different distros name
> their packages differently.
>
> Thus one distro may have mysqlclient-devel vs. mysql-devel for
> another.  I think debian calls this package libmysqlclient15-dev.  I
> need it installed prior to calling make because it provides mysql.h.
>
> If you have issues like that then, you have to have if / then logic
> based on the distro.
>
> Greg
>   
This may not be of any help, but checkinstall does a pretty good job of 
taking a normal "make install" and turning it into a .rpm or .deb.   You 
can stop it and inspect the .spec file and other intermediate files.  
I've used it to get a feel for how .spec files are created and I'm sure 
the same holds for deb equivalents.    I've used it to create .deb files 
too, but never had a need to inspect/modify the configuration file.

Jim.


More information about the Ale mailing list