[Gelistirici] gentoo ebuild make_wrapper script nedir?
Burak Sezer
bburaksezer at gmail.com
12 Haz 2010 Cmt 17:26:30 EEST
Selam,
make_wrapper eutils eclass'ı içinde tanımlanmış bir fonksiyon. Aşağıdaki
gibi bir kodu var.
# @FUNCTION: make_wrapper
# @USAGE: <wrapper> <target> [chdir] [libpaths] [installpath]
# @DESCRIPTION:
# Create a shell wrapper script named wrapper in installpath
# (defaults to the bindir) to execute target (default of wrapper) by
# first optionally setting LD_LIBRARY_PATH to the colon-delimited
# libpaths followed by optionally changing directory to chdir.
make_wrapper() {
local wrapper=$1 bin=$2 chdir=$3 libdir=$4 path=$5
local tmpwrapper=$(emktemp)
# We don't want to quote ${bin} so that people can pass complex
# things as $bin ... "./someprog --args"
cat << EOF > "${tmpwrapper}"
#!/bin/sh
cd "${chdir:-.}"
if [ -n "${libdir}" ] ; then
if [ "\${LD_LIBRARY_PATH+set}" = "set" ] ; then
export LD_LIBRARY_PATH="\${LD_LIBRARY_PATH}:${libdir}"
else
export LD_LIBRARY_PATH="${libdir}"
fi
fi
exec ${bin} "\$@"
EOF
chmod go+rx "${tmpwrapper}"
if [[ -n ${path} ]] ; then
(
exeinto "${path}"
newexe "${tmpwrapper}" "${wrapper}"
) || die
else
newbin "${tmpwrapper}" "${wrapper}" || die
fi
}
eutils'in tüm koduna Portage'ın SVN deposunu kurcalayarak ya da doğuran
Portage ağacını edinerek erişebilirsiniz.
Not: eclass'lar Portage ağacı içindeki eclass dizini içinde bulunan,
Python'daki kitaplıklara benzer kitaplıklardır.
12 Haziran 2010 15:15 tarihinde Emre Erenoglu <erenoglu at gmail.com> yazdı:
> Merhaba,
>
> NX kutuphaneleri icin paket yapmaya calisiyorum. Sonra da neatx veya x2go
> falan paketlenebilir. setup ve build kisimlari tamam, ama install kisminda
> takildim.
>
>
> http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/net-misc/nx/nx-3.4.0.ebuild?view=markup
>
> adresindeki ebuild'i kullaniyorum ornek olarak ve ordakileri takip
> ediyorum. Install kisminda make_wrapper diye bir script var ama neden
> kullanildigini ve ne yaptigini anlayamadim. Bu konuda sizden yardim istemek
> istedim,
>
> Gentoo ebuild'daki kisim su:
>
> src_install() {
> NX_ROOT=/usr/$(get_libdir)/NX
>
> for x in nxagent nxauth nxproxy; do
> make_wrapper $x ./$x ${NX_ROOT}/bin ${NX_ROOT}/$(get_libdir) ||
> die " $x wrapper creation failed"
> done
>
>
> Yorumlariniz icin tesekkurler,
> --
> Emre
>
> _______________________________________________
> Gelistirici mailing list
> Gelistirici at pardus.org.tr
> http://liste.pardus.org.tr/mailman/listinfo/gelistirici
>
--
Burak Sezer
-------------- sonraki bölüm --------------
Bir HTML eklentisi temizlendi...
URL: <http://liste.pardus.org.tr/gelistirici/attachments/20100612/edf677a5/attachment-0002.htm>
Gelistirici mesaj listesiyle ilgili
daha fazla bilgi