[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

cross-packaging with rpm



Welcome to insanity....

I'm working on packaging ARM software on an x86 box.
I'm not done yet, but I'd like to get comments on what I've done so far to see if I'm missing something...


Currently using rpm 4.1.
I built a cross-toolchain and installed it into $TOOLCHAIN; built rpm 4.1 and installed it into $TOOLCHAIN; created the RPMS,SOURCE, etc. directories under $topdir.
$TOOLCHAIN/bin and $TOOLCHAIN/usr/bin prepended to $PATH.


Command used to build the individual rpms is (simplified for clarity):
cd $topdir && rpmbuild -ba --clean --target armv4l \
--define=\"_topdir $topdir\" \
--define=\"buildroot $topdir/buildroots/${package}-root \
SPECS/$package.spec
($package is the name of the package. This prevents packages from stepping on one another to some extent.)


Modified the macrofiles line in $TOOLCHAIN/usr/lib/rpm/rpmrc to eliminate all the macro files that were not in a subdirectory of $TOOLCHAIN.

Modified $TOOLCHAIN/usr/lib/rpm/macros:
I didn't want %_tmppath pointing into the $TOOLCHAIN tree, so changed that to point to %{_topdir}/tmp and made the appropriate directory.
The %_prefix has the $TOOLCHAIN path in it, so I removed that portion, leaving just /usr
The %__cc et al need to point to my arm-linux-gcc etc, but I put them on the path, so the change there is:
%__ar arm-linux-ar
%__as arm-linux-as
%__cc arm-linux-gcc
%__cpp arm-linux-gcc -E
%__cxx arm-linux-g++
%__ld arm-linux-ld
%__nm arm-linux-nm
%__objcopy arm-linux-objcopy
%__objdump arm-linux-objdump
%__ranlib arm-linux-ranlib
%__strip arm-linux-strip
%__size arm-linux-size


For the %configure macro, I added
CC="%{__cc}" ; export CC ; \
RANLIB="%{__ranlib}" ; export RANLIB ; \
NM="%{__nm}" ; export NM ; \
STRIP="%{__strip}" ; export STRIP ; \
SIZE="%{__size}" ; export SIZE ; \
CONFIG_SITE="$RPM_BUILD_DIR/../config.site config.site" ; export CONFIG_SITE


For %_usr and %_var, removed the $TOOLCHAIN part of the path, otherwise %doc files wind up getting installed under $TOOLCHAIN on the target.
(Hmm... now I'm not sure about %_var... I changed it back and we'll see...)


I'm not yet convinced all of the above is right, but I believe it to be headed in the right direction. If you think otherwise (Jeff?), I'd like to hear why... (I'm pretty sure it isn't quite complete...)

My TODO list looks vaguely like:
deal with find_provides and find_requires.
test against more packages.
CONFIG_SITE should use %topdir?
I added __gcc for backward compat, but need to fix that in the various packages instead.
For experimental purposes, set:
%_unpackaged_files_terminate_build 0 #FIXME: change this back.
%_missing_doc_files_terminate_build 0 #FIXME: change this back.
Try lots of packages. :)


Any input is appreciated.

TIA,

Eli
--------------------. "If it ain't broke now,
Eli Carter           \                  it will be soon." -- crypto-gram
eli.carter(a)inet.com `-------------------------------------------------





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []