automake
[Top][All Lists]
Advanced

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

Re: System configuration during install


From: Bjoern Pedersen
Subject: Re: System configuration during install
Date: Fri, 6 Jul 2001 10:41:22 +0200 (MEST)

On 5 Jul 2001, Tom Tromey wrote:

> >>>>> "David" == Lawrence, David (STEI) <address@hidden> writes:
>
> David> I am already building using an rpm tree under by home
> David> directory.  But it would appear that RPM wants me to place the
> David> files into their install location before the binary RPM is
> David> built.  Is this a hard requirement or is there a work-around?
>
> I haven't made many RPMs.  I thought all this stuff worked by
> installing into a clean tree, say via DESTDIR, and then packaging that
> new tree.
>
> David> If I've moved too far off the context for the automake
> David> distribution list, where would you recommend I post these RPM
> David> related questions?
>
> I imagine there is an RPM list somewhere.  Or maybe someone else here
> definitely knows the answer.

take a look at the autoconf macro archive at:
http://wwwbbs.dei.unipd.it/mirror/m1/www.gnu.org/software/ac-archive/
look for am_rpm_init

and have .spec.in file with some like the following:

[usual spec header snipped]
...

%build
export DSHOME=/usr/local/dshome2
./configure --enable-greta --enable-xdevmenu
--with-motif=/usr/X11R6/LessTif/Mot
if1.2 --prefix=$DSHOME
make

%install
# To make things work with BUILDROOT
if [ "$RPM_BUILD_ROOT" != "/usr/tmp/@address@hidden" ]
then
 echo  RPM_BUILD_ROOT is not what I expected.  Please clean it yourself.
else
 echo Cleaning RPM_BUILD_ROOT: "$RPM_BUILD_ROOT"
 rm -rf "$RPM_BUILD_ROOT"
fi

export DSHOME=/usr/local/dshome2
make install DESTDIR="$RPM_BUILD_ROOT"

find ${RPM_BUILD_ROOT}${DSHOME}/lib -type f -follow -fprintf
@address@hidden "
$DSHOME/lib/%%P\n"
find ${RPM_BUILD_ROOT}${DSHOME}/include -type f -follow -fprintf
@address@hidden
st "$DSHOME/include/%%P\n"
cat @address@hidden @address@hidden > @address@hidden

%clean
if [ "$RPM_BUILD_ROOT" != "/usr/tmp/@address@hidden" ]
then
 echo  RPM_BUILD_ROOT is not what I expected.  Please clean it yourself.
else
 echo Cleaning RPM_BUILD_ROOT: "$RPM_BUILD_ROOT"
 rm -rf "$RPM_BUILD_ROOT"
fi

%post
export DSHOME=$RPM_INSTALL_PREFIX
mkdir -p $DSHOME/dbase/dbm
cd $DSHOME/etc
mv .taco_env tmp.sed
cat tmp.sed | sed -e "s+/usr/local/dshome2+$DSHOME+" > .taco_env
mv .taco.csh tmp.sed
cat tmp.sed | sed -e "s+/usr/local/dshome2+$DSHOME+" > .taco.csh
mv taco.startup tmp.sed
cat tmp.sed | sed -e "s+/usr/local/dshome2+$DSHOME+" > taco.startup
mv taco.startup.sec tmp.sed
cat tmp.sed | sed -e "s+/usr/local/dshome2+$DSHOME+" > taco.startup.sec
mv taco.shutdown tmp.sed
cat tmp.sed | sed -e "s+/usr/local/dshome2+$DSHOME+" > taco.shutdown
rm tmp.sed
cd $DSHOME/lib/linux/x86
/sbin/ldconfig -n
if [ -d /sbin/init.d ] ; then
  install -b $DSHOME/sbin/init.d/taco /sbin/init.d/taco
elif [ -d /etc/rc.d ] ; then
 install -b $DSHOME/sbin/init.d/taco /etc/rc.d/taco
fi

%files -f @address@hidden
%defattr(-,root,root)
%config /usr/local/dshome2/sbin/init.d/taco
%config(noreplace) /usr/local/dshome2/etc/.taco_env
 ....
[file list snipped]

this will install everything into DESTDIR first ( no systemfiles will be
overwritten, and the postinstall rules of the rpm do the runlevel install.

Bjoern


-- 
Bjoern Pedersen                         Lichtenbergstr.1
Technische Universitaet Muenchen        D-85747 Garching
ZBE Instrumentierung FRM-II
 Tel. + 49 89 289-14707 Fax -14666




reply via email to

[Prev in Thread] Current Thread [Next in Thread]