In message <[EMAIL PROTECTED]>,
David Lee writes:
>But the "big picture" is to be able to produce something along the lines of:
>
> # Directories...
> $prefix=/usr
>[...]
>
> # Installables
> %system all
> f 0555 root sys ${libdir}/libgdbm.so.2.0.0 .libs/libgdbm.so.2.0.0
> l 0555 root sys ${libdir}/libgdbm.so.2 libgdbm.so.2.0.0
>[...]
>
>(which particular case happens to be suitable for ESP's "epm" generic
>package manager). "libtool" would need to be responsible for the lines
>containing "libgdbm".
The simplest approach seems to be to install to a scratch directory, then
build the package from there. So unpack a tarball from `make dist' and
then do this:
./configure --prefix=/usr
make
make install-strip 'prefix=$SCRATCH_DIR/usr'
For one of my projects I added a rule to build rpms to Makefile.am using
this approach. I've attached a slightly simplified version (the full
version build sub-rpms). A similar approach will probably work for any
package manager which can make a package without having to install it.
One wrinkle to consider is that human made packages often have scripts to
run before and after both install and uninstall. I suspect it's going to be
hard to do this in a package-manager independent way.
Cheers,
Olly
===
spec = ${PACKAGE}-${VERSION}.spec
extra_text = BUGS AUTHORS COPYING NEWS TODO ChangeLog
# this is the "RPM release" - if you repackage the same VERSION, you need to
# increment this
RPM_RELEASE = 1
rpm : dist
echo Summary: ${SUMMARY} > ${spec}
echo Name: ${PACKAGE} >> ${spec}
echo Vendor: ${VENDOR} >> ${spec}
echo Version: ${VERSION} >> ${spec}
echo Release: ${RPM_RELEASE} >> ${spec}
echo Copyright: GPL >> ${spec}
echo Group: ${GROUP} >> ${spec}
echo Source: ${DOWNLOAD_URL}/${PACKAGE}-${VERSION}.tar.gz >> ${spec}
echo URL: ${HOME_URL} >> ${spec}
echo Packager: ${PACKAGER} >> ${spec}
echo BuildRoot: /var/tmp/%{name}-buildroot >> ${spec}
echo "" >> ${spec}
echo %description >> ${spec}
cat desc.txt >> ${spec}
echo "" >> ${spec}
echo %prep >> ${spec}
echo %setup >> ${spec}
echo "" >> ${spec}
echo %build >> ${spec}
echo ./configure --prefix=/usr >> ${spec}
echo make >> ${spec}
echo "" >> ${spec}
echo %install >> ${spec}
echo rm -rf '$$RPM_BUILD_ROOT' >> ${spec}
echo mkdir '$$RPM_BUILD_ROOT' >> ${spec}
echo make install-strip 'prefix=$$RPM_BUILD_ROOT/usr' >> ${spec}
echo "" >> ${spec}
echo %clean >> ${spec}
echo rm -rf '$$RPM_BUILD_ROOT' >> ${spec}
echo "" >> ${spec}
echo %files >> ${spec}
echo "%defattr(-,root,root)" >> ${spec}
echo %doc ${extra_text} >> ${spec}
echo %doc /usr/doc/${PACKAGE} >> ${spec}
echo %doc /usr/man >> ${spec}
echo /usr/bin >> ${spec}
echo /usr/share/${PACKAGE} >> ${spec}
#
echo %_topdir `pwd` > rpmmacros
echo %_rpmdir `pwd` >> rpmmacros
echo %_sourcedir `pwd` >> rpmmacros
echo %_specdir `pwd` >> rpmmacros
echo %_srcrpmdir `pwd` >> rpmmacros
echo %_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm >> rpmmacros
#
echo macrofiles : `rpm --showrc | sed 's/^macrofiles\> *:
//p;d'`:`pwd`/rpmmacros > rpmrc
#
rpm -ba --clean --rcfile /usr/lib/rpm/rpmrc:`pwd`/rpmrc ${spec}
_______________________________________________
Libtool mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/libtool