Sisyphus repositório
Última atualização: 1 outubro 2023 | SRPMs: 18631 | Visitas: 37516757
en ru br
ALT Linux repositórios
S:1.4.2-alt1
5.0: 1.1.1-alt1
4.1: 1.1.1-alt1

Group :: Desenvolvimento/ML
RPM: rpm-build-ocaml

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs e FR  Repocop 

scripts-1.1.1/000075500000000000000000000000001077671227100132115ustar00rootroot00000000000000scripts-1.1.1/ocaml-functions000075500000000000000000000012631077671227100162420ustar00rootroot00000000000000#!/bin/sh -efu

OcamlRun()
{
local PATH="${PATH:-/bin:/usr/bin}:/usr/lib/rpm"
if [ -n "${RPM_BUILD_ROOT-}" ]; then
PATH="$RPM_BUILD_ROOT/usr/bin:$RPM_BUILD_ROOT/usr/lib/rpm:$PATH"
fi
# Stop shell.req from resolving ocamlrun depedency --
# we use explicit dependency on /usr/bin/ocamlrun in specfile.
local ocamlrun=ocamlrun
"$ocamlrun" "$@"
}

OcamlVersion()
{
local version
version=$(OcamlRun -version)
# The output is: "The Objective Caml runtime, version 3.10.2".
# However, bare "3.10.2" should still work.
set -- $version
shift $(($#-1))
# Now extract $MAJOR.$MINOR which is 3.10.
local IFS=.
set -- $1
echo "$1.$2"
}

OcamlReqProv()
{
OcamlRun ocaml-reqprov "$@"
}
scripts-1.1.1/ocaml.prov000075500000000000000000000016271077671227100152250ustar00rootroot00000000000000#!/bin/sh -efu

. /usr/lib/rpm/functions
. "$(dirname "$0")"/ocaml-functions
V=$(OcamlVersion)

OcamlProv1()
{
local f="$1"; shift
local reqprov
reqprov=$(OcamlReqProv "$f")
echo "$reqprov" |awk -v V="$V" '
$1=="cmi_name" {
cmi_name = $2
}
$1=="cmi_requires" && $3 == cmi_name {
md5 = $2; name = $3
rel = toupper(substr(md5, 1, 8))
printf "ocaml-cmi(%s) = %s-%s\n", name, V, rel
}
$1=="cmx_provides" {
md5 = $2; name = $3
if (md5~/^0+$/)
next
rel = toupper(substr(md5, 1, 8))
printf "ocaml-cmx(%s) = %s-%s\n", name, V, rel
}'
}

OcamlDllProv()
{
local f="$1"; shift
dll=$(basename "$f" .so)
case "$dll" in
dll?*)
dll=${dll#dll}
printf 'ocaml-dll(%s)\n' "$dll"
;;
esac
}

OcamlProv()
{
local f="$1"; shift
case "$f" in
*/lib*/ocaml*/dll*.so)
OcamlDllProv "$f"
;;
*.cm[ioax] | *.cmxa )
OcamlProv1 "$f"
;;
esac
}

ArgvFileAction OcamlProv "$@"
scripts-1.1.1/ocaml.prov.files000075500000000000000000000004661077671227100163260ustar00rootroot00000000000000#!/bin/sh -efu
while IFS=$'\t' read -r f t; do
case "$f" in
*/lib*/ocaml*/dll*.so)
echo "$f"
continue ;;
esac
case "$f" in
*/ocaml*/*.cm[ioax] | */ocaml*/*.cmxa )
;;
*)
continue ;;
esac
case "$t" in
*"Objective caml"*)
echo "$f" ;;
*)
echo "${0##*/}: $f: $t" >&2 ;;
esac
done
scripts-1.1.1/ocaml.req000075500000000000000000000070671077671227100150320ustar00rootroot00000000000000#!/bin/sh -efu

. /usr/lib/rpm/functions
. /usr/lib/rpm/find-package
. "$(dirname "$0")"/ocaml-functions
V=$(OcamlVersion)

OcamlReq1()
{
local f="$1"; shift
local reqprov
reqprov=$(OcamlReqProv "$f")
echo "$reqprov" |awk -v V="$V" '
$1=="cmi_requires" {
md5 = $2; name = $3
rel = toupper(substr(md5, 1, 8))
printf "ocaml-cmi(%s) = %s-%s\n", name, V, rel
}
$1=="cmx_requires" {
md5 = $2; name = $3
if (md5~/^0+$/)
next
rel = toupper(substr(md5, 1, 8))
printf "ocaml-cmx(%s) = %s-%s\n", name, V, rel
}
$1~/^DLL/ && $2~/^dll./ {
dll = $2
sub(/^dll/, "", dll)
printf "ocaml-dll(%s)\n", dll
}
$1~/^dllib/ && $2~/^-l./ {
dll = $2
sub(/^-l/, "", dll)
printf "ocaml-dll(%s)\n", dll
}
$1~/^dllib/ && $2~/^dll.+[.]so$/ {
dll = $2
sub(/^dll/, "", dll)
sub(/[.]so$/, "", dll)
printf "ocaml-dll(%s)\n", dll
}'
local libs lib libdirs
libs=$(echo "$reqprov" |
awk '$1~/^ccobj/ && $2~/^-l./ {sub(/^-l/,"",$2); print $2}')
[ -n "$libs" ] || return 0
Debug "libs=$(echo $libs)"
libdirs=$(echo "$reqprov" |
awk '$1~/^ccopt/ && $2~"^-Wl,-rpath,/" {sub(/^-Wl,-rpath,/,"",$2); print $2}
$1~/^ccopt/ && $2~"^-L/" {sub(/^-L/,"",$2); print $2}')
[ -z "$libdirs" ] || Debug "libdirs=$(echo $libdirs)"
local mydir="${f%/*}"; mydir=${mydir#${RPM_BUILD_ROOT-}}
[ -n "${RPM_LIBDIR-}" ] || RPM_LIBDIR=`rpm --eval %_libdir`
# based on /usr/lib/rpm/pkgconfiglib.req
for lib in $libs; do
local rep libdir
if [ -n "${RPM_BUILD_ROOT-}" ]; then
for libdir in \
"$RPM_BUILD_ROOT$mydir" \
$(for d in $libdirs; do echo "$RPM_BUILD_ROOT$d"; done) \
"$RPM_BUILD_ROOT$RPM_LIBDIR"/ocaml \
$(set +f; echo "$RPM_BUILD_ROOT$RPM_LIBDIR"/ocaml/{*/,*/*/}) \
"$RPM_BUILD_ROOT$RPM_LIBDIR"; do
rep=${libdir%/}/lib$lib
if [ -f "$rep.so" -o -L "$rep.so" ]; then
rep=$rep.so
elif [ -f "$rep.a" -o -L "$rep.a" ]; then
rep=$rep.a
else
continue
fi
# The library is under RPM_BUILD_ROOT.
# FindPackage will emit file-level dependency.
rep=${rep#$RPM_BUILD_ROOT}
Verbose "$f: -l$lib -> \$RPM_BUILD_ROOT$rep"
FindPackage "$f" "$rep"
# Do next lib.
continue 2
done
fi
for libdir in \
"$mydir" \
$libdirs \
"$RPM_LIBDIR"/ocaml \
$(set +f; echo "$RPM_LIBDIR"/ocaml/{*/,*/*/}) \
"$RPM_LIBDIR"; do
rep=${libdir%/}/lib$lib
if [ -f "$rep.so" ]; then
rep=$rep.so
elif [ -f "$rep.a" ]; then
rep=$rep.a
else
continue
fi
# The library is found in the host system.
# Generate rpm dependency and do next lib.
rep=$(CanonPath "$rep")
local pkg n
pkg=$(rpmquery --whatprovides --queryformat='%{NAME}\n' "$rep" |sort -u)
n=$(set -- $pkg; echo $#)
if [ "$pkg" = glibc-devel ]; then
Verbose "$f: -l$lib -> $rep -> $pkg (skip)"
elif [ $n -eq 1 ]; then
Verbose "$f: -l$lib -> $rep -> $pkg"
printf '%s\n' "$pkg"
elif [ $n -gt 1 ]; then
Info "$f: $rep provided by:$(echo '' $pkg)"
Info "$f: -l$lib -> $rep (raw, ambiguous)"
printf '%s\n' "$rep"
else
Warning "$f: cannot map $rep to rpm dependency (skip)"
fi
continue 2
done
Warning "$f: cannot find -l$lib library path (skip)"
done
}

OcamlReq()
{
local f="$1"; shift
case "$f" in
*/lib*/ocaml*/dll*.so)
echo "ocaml-runtime = $V"
return ;;
*.cmxa)
local a="${f%.cmxa}.a"
echo "${a#${RPM_BUILD_ROOT-}}"
;;
esac
local t
t=$(file -bL "$f") ||
Fatal "${t:-$f: file type not available}"
case "$t" in
*"ocamlrun script"*)
echo "ocaml-runtime = $V"
;;
esac
OcamlReq1 "$f"
}

ArgvFileAction OcamlReq "$@"
scripts-1.1.1/ocaml.req.files000075500000000000000000000006341077671227100161240ustar00rootroot00000000000000#!/bin/sh -efu
while IFS=$'\t' read -r f t; do
case "$t" in
*"ocamlrun script"*)
if [ -x "$f" ]; then
echo "$f"
fi
continue ;;
esac
case "$f" in
*/lib*/ocaml*/dll*.so)
echo "$f"
continue ;;
esac
case "$f" in
*/ocaml*/*.cm[ioax] | */ocaml*/*.cmxa )
;;
*)
continue ;;
esac
case "$t" in
*"Objective caml"*)
echo "$f" ;;
*)
echo "${0##*/}: $f: $t" >&2 ;;
esac
done
 
projeto & código: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
mantenedor atual: Michael Shigorin
mantenedor da tradução: Fernando Martini aka fmartini © 2009