As I do not understand now much about RPM build, I'm trying to adjust the
existing .spec file, mixing stuff from Bill's port of courier-imap-1.5.3.

I also do not understand suficient about compiling/linking flags so I ask help
for the following seting I found in .spec x Bill's.spec

>From courier-dev:
  %define configure CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; 
  CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; 
  FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; 
  ./configure --host=%{_host} --build=%{_build} --target=%{_target_platform} 
  --program-prefix=%{?_program_prefix} --prefix=%{_prefix} 
  --exec-prefix=%{_exec_prefix} --bindir=%{_bindir} --sbindir=%{_sbindir} 
  --sysconfdir=%{_sysconfdir} --datadir=%{_datadir} --includedir=%{_includedir}
  --libdir=%{_libdir} --libexecdir=%{_libexecdir} 
  --localstatedir=%{_localstatedir} --sharedstatedir=%{_sharedstatedir} 
  --mandir=%{_mandir} --infodir=%{_infodir}

>From Bill's port:
        CFLAGS="%{l_cppflags} %{optflags}"; export CFLAGS
        CXXFLAGS="%{l_cppflags} %{optflags}"; export CXXFLAGS
        LDFLAGS="-L%{l_prefix}/lib"; export LDFLAGS


So first, are all %{l_xxx} OpenPKG stuff ? And if so, where are they
defined (by rpm perhaps?) ?

I do not understand the syntax like CXXFLAGS="${CXXFLAGS:-%optflags}"
Does this consider some default ? How to change this for OpenPKG ?


And as I'm testing and probaly making lots off errors, How do I tell rpm to just
build the binary from .src.rpm with installing it ?

Unfortunatly I do not have the time to learn all about rpm build (that would be
nice) and thats why I'm trying to adapt the existing .spec to get just
courier-imap build (The only package I realy miss in OpenPKG).

Thanks again for all help and tips


Cópia Michael Schloh von Bennewitz <[EMAIL PROTECTED]>:

> On Thu, Dec 11, 2003, [EMAIL PROTECTED] wrote:
> > It expands to a tree under courier-imap-2.2.1, bup instaling source
> rpms
> > normaly seams to install under a directory just for the main name, as
> also
> > does courier-imap-1.5.3 from Bill Campbell. Is this done by the rpm
> tool
> > or do I need to repackage or specify something in .spec ?
> >
> A tarball (like courier-imap-2.2.1.tar.bz2) is unpackad by RPM using
> the
> %setup macros that you should put in the %prep section of the .spec
> file.
> Something like:
> 
> %prep
>     %setup -q
> 
> should do the job, although you might need to use:
> 
>     %setup -q -n courier-imap-%{version}
> 
> or some variation with '-c' to create a directory, etcetera. They are
> all
> native RPM features that you can read about in the Maximum RPM book or
> some
> other RPM documentation.
> 
> > Reading the developer on-line Install instructions I think that I
> should
> > modify the .spec file and then issue rpm -bb courier-imap.spec
> >
> Yes that sounds reasonable. And 'rpm -bb' builds the package from just
> a
> .spec file. It is very similar to 'rpm --rebuild', except your source is
> a
> .spec file rather than a full source package. The command 'rpm -bs'
> will
> create a source package (ending with .src.rpm), but does not compile
> or
> build anything. That's what you'll use later to finally make your
> package.
> 
> > This .spec has no Prefix: entry, but has %define _prefix
> /usr/lib/courier-imap
> > Should I change do %define _prefix %{l_prefix}/usr/lib/courier-imap or
> Just add
> > Prefix: %{l_prefix} ?
> >
> > Also the .spec has
> > BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
> >
> > Should I prefix this definition or substitute it with the 
> %{l_buildroot} ?
> >
> Prefix, Buildroot and the other things that I put in the template sent
> to
> you should remain exact. Don't change them or use other non-OpenPKG
> constructs like the ones you found in the .spec file distributed with
> the
> Courier sources.
> 
> In some cases those non-OpenPKG constructs are simply unconformant to
> style
> or organization rules that we've chosen to enforce (at least in the
> official
> package repository). In other cases, those non-OpenPKG constructs will
> cause
> your build to completely fail.
> 
> > Also I think I should set the --with-shellpath configuration option to
> include
> > OpenPKG path. For this I whant to confirm that %{l_prefix} represents
> the base
> > directory where I installed OpenPKG.
> >
> Yes, %{l_prefix} will always expand to the path name you gave when
> bootstrapping OpenPKG like this:
> 
>   $ sh openpkg...-src.sh --prefix=/myprefix
> 
> If you didn't give a prefix explicitly, then it will be '/cw' by
> default.
> 
> > And now what should I worry about or search in the .spec file to
> changes
> > for use with OpenPKG ?
> >
> First build the software without even thinking about OpenPKG. Keep notes
> of
> everything you do (./configure, make all, rm unwanted files, make
> install...). Then put these steps exactly like that in the .spec file
> template I sent you. Compare your final .spec file with the on
> distributed
> with the Courier software. Change a few things that seem necessary.
> Lastly,
> try building with 'rpm -bb courier.spec'.
> 
> > PS.: The rpm tree I used to see from RedHat has BUILD RPMS SOURCES
> SPECS 
> > SRPMS, but in OpenPKG ther is only DB PKG SRC TMP. Should I put the
> > courier-imap-2.2.1.tar.bz2 file just into SRC or does I need to
> mkdir
> > courier-imap first ?
> >
> Probably easiest ist to use:
> 
>   $ rpm --fetch courier.spec
> 
> If you don't like that, then make the directory and copy the tarball:
> 
>   $ mkdir /cw/RPM/SRC/courier
>   $ cp /someplace/courier-imap-2.2.1.tar.bz2 /cw/RPM/SRC/courier
> 
> This directory (which I assume is 'courier') must match exactly the name
> you
> use for your package, as stated in the .spec file after 'Name:'.
> 
> Good luck,
> Michael
> 
> -- 
> [EMAIL PROTECTED]
> Development Team, Operations Northern Europe
> Cable & Wireless Telecommunications Services GmbH
> 
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
User Communication List                      [EMAIL PROTECTED]

Reply via email to