Mega patch to improve how build dependencies are handled and

how packages are found.

First: I removed all these *-deps.db files and only a single file
is used now "build-depends.db"; it's smaller and will be easier
to handle in the future... when "run-depends.db" is added :-)

Second: there's no need to specify version of package anymore;
before you had to do:

	$ pkgfs.sh install git-1.6.0.2

now you only do:

	$ pkgfs.sh install git

This will read the variables located at PKGFS_TEMPLATESDIR/git.tmpl
and will the install the version that is there.

--HG--
extra : convert_revision : 9e3e5d70965a69c76f59e322b7c7b674d627af52
This commit is contained in:
Juan RP 2008-10-04 06:29:49 +02:00
parent 4cd4543c72
commit e9def74b60
175 changed files with 473 additions and 308 deletions

Binary file not shown.

Binary file not shown.

BIN
dependencies/build-depends.db vendored Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -18,7 +18,7 @@
: ${perl_cmd:=$PKGFS_MASTERDIR/bin/perl} : ${perl_cmd:=$PKGFS_MASTERDIR/bin/perl}
: ${PERL_DESTDIR:=$PKGFS_MASTERDIR} : ${PERL_DESTDIR:=$PKGFS_MASTERDIR}
: ${PERL_PREFIX:=$PERL_DESTDIR} : ${PERL_PREFIX:=$PERL_DESTDIR}
: ${PERL_DPREFIX:=$PKGFS_DESTDIR/$pkgname} : ${PERL_DPREFIX:=$PKGFS_DESTDIR/$pkgname-$version}
: ${PERL_VERSION:=5.10.0} : ${PERL_VERSION:=5.10.0}
: ${PERL_LDDLFLAGS:=--whole-archive -shared -L$PKGFS_MASTERDIR/lib} : ${PERL_LDDLFLAGS:=--whole-archive -shared -L$PKGFS_MASTERDIR/lib}
: ${PERL_SITELIBEXP:=$PERL_DPREFIX/lib/perl5/site_perl/$PERL_VERSION} : ${PERL_SITELIBEXP:=$PERL_DPREFIX/lib/perl5/site_perl/$PERL_VERSION}

View file

@ -5,11 +5,12 @@
pkgconfig_transform_file() pkgconfig_transform_file()
{ {
local file="$1" local file="$1"
local pkg="$pkgname-$version"
[ -z "$file" ] && return 1 [ -z "$file" ] && return 1
$sed_cmd \ $sed_cmd \
-e "s|^exec_prefix=$PKGFS_DESTDIR/$pkgname.*$|exec_prefix=\${prefix}|" \ -e "s|^exec_prefix=$PKGFS_DESTDIR/$pkg.*$|exec_prefix=\${prefix}|" \
-e "s|-L\${libdir}|-L\${libdir} -Wl,-R\${libdir}|" \ -e "s|-L\${libdir}|-L\${libdir} -Wl,-R\${libdir}|" \
$file > $file.in && \ $file > $file.in && \
$mv_cmd $file.in $file $mv_cmd $file.in $file

View file

@ -12,7 +12,7 @@ save_pkgname=$pkgname
check_installed_tmpl unzip-$unzip_version check_installed_tmpl unzip-$unzip_version
if [ "$?" -ne 0 ]; then if [ "$?" -ne 0 ]; then
echo "=> unzip not installed, will install it." echo "=> unzip not installed, will install it."
install_tmpl unzip-$unzip_version install_tmpl unzip
# #
# Continue with previous template that called us. # Continue with previous template that called us.
# #

264
pkgfs.sh
View file

@ -61,7 +61,6 @@
: ${db_cmd:=/usr/bin/db -q} : ${db_cmd:=/usr/bin/db -q}
: ${chmod_cmd:=/bin/chmod} : ${chmod_cmd:=/bin/chmod}
: ${xstow_version:=xstow-0.6.1-unstable}
: ${xstow_args:=-ap} : ${xstow_args:=-ap}
: ${xstow_ignore_files:=perllocal.pod} # XXX For now ignore them. : ${xstow_ignore_files:=perllocal.pod} # XXX For now ignore them.
@ -70,6 +69,7 @@ set_defvars()
# Directories # Directories
: ${PKGFS_TEMPLATESDIR:=$PKGFS_DISTRIBUTIONDIR/templates} : ${PKGFS_TEMPLATESDIR:=$PKGFS_DISTRIBUTIONDIR/templates}
: ${PKGFS_DEPSDIR:=$PKGFS_DISTRIBUTIONDIR/dependencies} : ${PKGFS_DEPSDIR:=$PKGFS_DISTRIBUTIONDIR/dependencies}
: ${PKGFS_BUILD_DEPS_DB:=$PKGFS_DEPSDIR/build-depends.db}
: ${PKGFS_TMPLHELPDIR:=$PKGFS_DISTRIBUTIONDIR/helper-templates} : ${PKGFS_TMPLHELPDIR:=$PKGFS_DISTRIBUTIONDIR/helper-templates}
local DDIRS="PKGFS_DEPSDIR PKGFS_TEMPLATESDIR PKGFS_TMPLHELPDIR" local DDIRS="PKGFS_DEPSDIR PKGFS_TEMPLATESDIR PKGFS_TMPLHELPDIR"
@ -160,6 +160,9 @@ merge_infodir_tmpl()
$PKGFS_MASTERDIR/share/info/dir $PKGFS_MASTERDIR/share/info/dir
} }
#
# Shows info about a template.
#
info_tmpl() info_tmpl()
{ {
local tmpl="$1" local tmpl="$1"
@ -169,7 +172,7 @@ info_tmpl()
exit 1 exit 1
fi fi
run_file ${PKGFS_TEMPLATESDIR}/${tmpl}.tmpl run_file $PKGFS_TEMPLATESDIR/$tmpl.tmpl
echo " pkgfs template definitions:" echo " pkgfs template definitions:"
echo echo
@ -184,17 +187,19 @@ info_tmpl()
echo " short_desc: $short_desc" echo " short_desc: $short_desc"
echo "$long_desc" echo "$long_desc"
echo echo
if [ -r "$PKGFS_DEPSDIR/$pkgname-deps.db" ]; then check_build_depends_tmpl $pkgname
pkgdepf="$PKGFS_DEPSDIR/$pkgname-deps.db" if [ "$?" -eq 0 ]; then
list="$($db_cmd btree $pkgdepf deps)" local list="$($db_cmd -V btree $PKGFS_BUILD_DEPS_DB $pkgname)"
echo " This package requires the following dependencies to be built:" echo " This package requires the following dependencies to be built:"
for i in ${list}; do for i in ${list}; do
[ "$i" = "deps" ] && continue
echo " $i" echo " $i"
done done
fi fi
} }
#
# Applies to the build directory the patches specified by a template.
#
apply_tmpl_patches() apply_tmpl_patches()
{ {
if [ -z "$PKGFS_TEMPLATESDIR" ]; then if [ -z "$PKGFS_TEMPLATESDIR" ]; then
@ -241,6 +246,10 @@ apply_tmpl_patches()
fi fi
} }
#
# Checks that all required variables specified in the configuration
# file are properly working.
#
check_config_vars() check_config_vars()
{ {
local cffound= local cffound=
@ -288,6 +297,9 @@ check_config_vars()
done done
} }
#
# Resets all vars used by a template.
#
reset_tmpl_vars() reset_tmpl_vars()
{ {
local TMPL_VARS="pkgname extract_sufx distfiles url configure_args \ local TMPL_VARS="pkgname extract_sufx distfiles url configure_args \
@ -298,13 +310,16 @@ reset_tmpl_vars()
run_stuff_before_configure_file run_stuff_before_build_file \ run_stuff_before_configure_file run_stuff_before_build_file \
run_stuff_before_install_file run_stuff_after_install \ run_stuff_before_install_file run_stuff_after_install \
make_build_target make_install_target \ make_build_target make_install_target \
postinstall_helpers" postinstall_helpers version"
for i in ${TMPL_VARS}; do for i in ${TMPL_VARS}; do
eval unset "$i" eval unset "$i"
done done
} }
#
# Checks some vars used in templates and sets $extract_cmd.
#
check_tmpl_vars() check_tmpl_vars()
{ {
local pkg="$1" local pkg="$1"
@ -312,7 +327,7 @@ check_tmpl_vars()
[ -z "$pkg" ] && return 1 [ -z "$pkg" ] && return 1
REQ_VARS="pkgname extract_sufx url build_style" REQ_VARS="pkgname version extract_sufx url build_style"
# Check if required vars weren't set. # Check if required vars weren't set.
for i in ${REQ_VARS}; do for i in ${REQ_VARS}; do
@ -325,7 +340,7 @@ check_tmpl_vars()
done done
if [ -z "$distfiles" ]; then if [ -z "$distfiles" ]; then
dfile="$pkgname$extract_sufx" dfile="$pkgname-$version$extract_sufx"
elif [ -n "${distfiles}" ]; then elif [ -n "${distfiles}" ]; then
dfile="$distfiles$extract_sufx" dfile="$distfiles$extract_sufx"
else else
@ -356,6 +371,9 @@ check_tmpl_vars()
esac esac
} }
#
# Verifies that a checksum of a distfile is correct.
#
check_rmd160_cksum() check_rmd160_cksum()
{ {
local file="$1" local file="$1"
@ -364,7 +382,7 @@ check_rmd160_cksum()
[ -z "$file" ] && return 1 [ -z "$file" ] && return 1
if [ -z "${distfiles}" ]; then if [ -z "${distfiles}" ]; then
dfile="$pkgname$extract_sufx" dfile="$pkgname-$version$extract_sufx"
elif [ -n "${distfiles}" ]; then elif [ -n "${distfiles}" ]; then
dfile="$distfiles$extract_sufx" dfile="$distfiles$extract_sufx"
else else
@ -385,6 +403,9 @@ check_rmd160_cksum()
fi fi
} }
#
# Downloads the distfiles for a template from $url.
#
fetch_tmpl_sources() fetch_tmpl_sources()
{ {
local file="" local file=""
@ -393,7 +414,7 @@ fetch_tmpl_sources()
[ -z "$pkgname" ] && return 1 [ -z "$pkgname" ] && return 1
if [ -z "$distfiles" ]; then if [ -z "$distfiles" ]; then
file="$pkgname" file="$pkgname-$version"
else else
file="$distfiles" file="$distfiles"
fi fi
@ -431,11 +452,15 @@ fetch_tmpl_sources()
done done
} }
#
# Extracts contents of a distfile specified in a template into
# the build directory.
#
extract_tmpl_sources() extract_tmpl_sources()
{ {
[ -z "$pkgname" ] && return 1 [ -z "$pkgname" ] && return 1
echo "==> Extracting \`$pkgname' into $PKGFS_BUILDDIR." echo "==> Extracting \`$pkgname-$version' into $PKGFS_BUILDDIR."
$extract_cmd $extract_cmd
if [ "$?" -ne 0 ]; then if [ "$?" -ne 0 ]; then
@ -468,14 +493,20 @@ fixup_tmpl_libtool()
fi fi
} }
#
# Configures, builds and installs a package into the destination
# directory.
#
build_tmpl_sources() build_tmpl_sources()
{ {
[ -z "$pkgname" ] && return 1 local pkg="$pkgname-$version"
[ -z "$pkgname" -o -z "$version" ] && return 1
if [ -n "$distfiles" -a -z "$wrksrc" ]; then if [ -n "$distfiles" -a -z "$wrksrc" ]; then
wrksrc=$PKGFS_BUILDDIR/$distfiles wrksrc=$PKGFS_BUILDDIR/$distfiles
elif [ -z "$wrksrc" ]; then elif [ -z "$wrksrc" ]; then
wrksrc=$PKGFS_BUILDDIR/$pkgname wrksrc=$PKGFS_BUILDDIR/$pkg
else else
wrksrc=$PKGFS_BUILDDIR/$wrksrc wrksrc=$PKGFS_BUILDDIR/$wrksrc
fi fi
@ -490,13 +521,13 @@ build_tmpl_sources()
# Apply patches if requested by template file # Apply patches if requested by template file
apply_tmpl_patches apply_tmpl_patches
echo "==> Building \`$pkgname' (be patient, may take a while)" echo "==> Building \`$pkg' (be patient, may take a while)"
# #
# For now, just set them through the environment. # For now, just set them through the environment.
# #
LDFLAGS="-L$PKGFS_MASTERDIR/lib -Wl,-R$PKGFS_MASTERDIR/lib $LDFLAGS" LDFLAGS="-L$PKGFS_MASTERDIR/lib -Wl,-R$PKGFS_MASTERDIR/lib $LDFLAGS"
export LDFLAGS="-L$PKGFS_DESTDIR/$pkgname/lib $LDFLAGS" export LDFLAGS="-L$PKGFS_DESTDIR/$pkg/lib $LDFLAGS"
export CFLAGS="$CFLAGS $PKGFS_CFLAGS" export CFLAGS="$CFLAGS $PKGFS_CFLAGS"
export CXXFLAGS="$CXXFLAGS $PKGFS_CXXFLAGS" export CXXFLAGS="$CXXFLAGS $PKGFS_CXXFLAGS"
export CPPFLAGS="-I$PKGFS_MASTERDIR/include $CPPFLAGS" export CPPFLAGS="-I$PKGFS_MASTERDIR/include $CPPFLAGS"
@ -523,8 +554,8 @@ build_tmpl_sources()
# surprises later. # surprises later.
# #
./configure --prefix="$PKGFS_MASTERDIR" \ ./configure --prefix="$PKGFS_MASTERDIR" \
--mandir="$PKGFS_DESTDIR/$pkgname/man" \ --mandir="$PKGFS_DESTDIR/$pkg/man" \
--infodir="$PKGFS_DESTDIR/$pkgname/share/info" \ --infodir="$PKGFS_DESTDIR/$pkg/share/info" \
--sysconfdir="$PKGFS_SYSCONFDIR" \ --sysconfdir="$PKGFS_SYSCONFDIR" \
${configure_args} ${configure_args}
@ -563,7 +594,7 @@ build_tmpl_sources()
fi fi
if [ "$build_style" != "perl_module" -a "$?" -ne 0 ]; then if [ "$build_style" != "perl_module" -a "$?" -ne 0 ]; then
echo "*** ERROR building (configure state) \`$pkgname' ***" echo "*** ERROR building (configure state) \`$pkg' ***"
exit 1 exit 1
fi fi
@ -594,7 +625,7 @@ build_tmpl_sources()
# #
${make_cmd} ${make_build_args} ${make_build_target} ${make_cmd} ${make_build_args} ${make_build_target}
if [ "$?" -ne 0 ]; then if [ "$?" -ne 0 ]; then
echo "*** ERROR building (make stage) \`$pkgname' ***" echo "*** ERROR building (make stage) \`$pkg' ***"
exit 1 exit 1
fi fi
@ -614,9 +645,9 @@ build_tmpl_sources()
# Install package via make. # Install package via make.
# #
${make_cmd} ${make_install_args} ${make_install_target} \ ${make_cmd} ${make_install_args} ${make_install_target} \
prefix="$PKGFS_DESTDIR/$pkgname" prefix="$PKGFS_DESTDIR/$pkg"
if [ "$?" -ne 0 ]; then if [ "$?" -ne 0 ]; then
echo "*** ERROR instaling \`$pkgname' ***" echo "*** ERROR instaling \`$pkg' ***"
exit 1 exit 1
fi fi
@ -634,7 +665,7 @@ build_tmpl_sources()
# Transform pkg-config files if requested by template. # Transform pkg-config files if requested by template.
# #
for i in ${pkgconfig_override}; do for i in ${pkgconfig_override}; do
local tmpf="$PKGFS_DESTDIR/$pkgname/lib/pkgconfig/$i" local tmpf="$PKGFS_DESTDIR/$pkg/lib/pkgconfig/$i"
[ -f "$tmpf" ] && \ [ -f "$tmpf" ] && \
[ -f $PKGFS_TMPLHELPDIR/pkg-config-transform.sh ] && \ [ -f $PKGFS_TMPLHELPDIR/pkg-config-transform.sh ] && \
. $PKGFS_TMPLHELPDIR/pkg-config-transform.sh . $PKGFS_TMPLHELPDIR/pkg-config-transform.sh
@ -642,7 +673,7 @@ build_tmpl_sources()
done done
echo "==> Installed \`$pkgname' into $PKGFS_DESTDIR/$pkgname." echo "==> Installed \`$pkg' into $PKGFS_DESTDIR/$pkg."
# #
# Once all work has been done, unset compilation vars. # Once all work has been done, unset compilation vars.
@ -655,12 +686,16 @@ build_tmpl_sources()
if [ -d "$wrksrc" -a -z "$dontrm_builddir" ]; then if [ -d "$wrksrc" -a -z "$dontrm_builddir" ]; then
$rm_cmd -rf $wrksrc $rm_cmd -rf $wrksrc
[ "$?" -eq 0 ] && \ [ "$?" -eq 0 ] && \
echo "=> Removed \`$pkgname' build directory." echo "=> Removed \`$pkg' build directory."
fi fi
cd $PKGFS_BUILDDIR cd $PKGFS_BUILDDIR
} }
#
# Stows a currently installed package, i.e creates the links
# on the master directory.
#
stow_tmpl() stow_tmpl()
{ {
local pkg="$1" local pkg="$1"
@ -670,11 +705,18 @@ stow_tmpl()
[ -z "$pkg" ] && return 2 [ -z "$pkg" ] && return 2
if [ -r "$PKGFS_DESTDIR/$pkg/$infodir_pkg" ]; then if [ -n "$stow_flag" ]; then
merge_infodir_tmpl ${pkg} pkg=$PKGFS_TEMPLATESDIR/$pkg.tmpl
run_file $pkg
pkg=$pkgname-$version
fi fi
if [ -r "$PKGFS_DESTDIR/$pkg/$infodir_pkg" -a -r "$infodir_master" ]; then if [ -r "$PKGFS_DESTDIR/$pkg/$infodir_pkg" ]; then
merge_infodir_tmpl $pkg
fi
if [ -r "$PKGFS_DESTDIR/$pkg/$infodir_pkg" \
-a -r "$infodir_master" ]; then
xstow_args="$xstow_args -i-file-in-dir $infodir_pkg" xstow_args="$xstow_args -i-file-in-dir $infodir_pkg"
fi fi
@ -696,8 +738,8 @@ stow_tmpl()
# #
# Run template postinstall helpers if requested. # Run template postinstall helpers if requested.
# #
if [ "$pkgname" != "$pkg" ]; then if [ "$pkgname" != "${pkg%%-$version}" ]; then
run_file $PKGFS_TEMPLATESDIR/$pkg.tmpl run_file $PKGFS_TEMPLATESDIR/${pkg%%-$version}.tmpl
fi fi
for i in ${postinstall_helpers}; do for i in ${postinstall_helpers}; do
@ -706,6 +748,10 @@ stow_tmpl()
done done
} }
#
# Unstows a currently stowned package, i.e removes its links
# from the master directory.
#
unstow_tmpl() unstow_tmpl()
{ {
local pkg="$1" local pkg="$1"
@ -715,39 +761,39 @@ unstow_tmpl()
exit 1 exit 1
fi fi
local tmppkg="${pkg%-[0-9]*}" if [ "$pkg" = "xstow" ]; then
if [ "$tmppkg" = "xstow" ]; then echo "*** INFO: You aren't allowed to unstow \`$pkg'."
echo "*** INFO: You aren't allowed to unstow \`$xstow_version'."
exit 1 exit 1
fi fi
run_file $PKGFS_TEMPLATESDIR/$pkg.tmpl
$PKGFS_XSTOW_CMD -dir $PKGFS_DESTDIR -target $PKGFS_MASTERDIR \ $PKGFS_XSTOW_CMD -dir $PKGFS_DESTDIR -target $PKGFS_MASTERDIR \
-D -i-file-in-dir share/info/dir -ignore ${xstow_ignore_files} \ -D -i-file-in-dir share/info/dir -ignore ${xstow_ignore_files} \
$PKGFS_DESTDIR/$pkg $PKGFS_DESTDIR/$pkgname-$version
if [ "$?" -ne 0 ]; then if [ "$?" -ne 0 ]; then
exit 1 exit 1
else else
$rm_cmd -f $PKGFS_DESTDIR/$pkg/share/info/dir $rm_cmd -f $PKGFS_DESTDIR/$pkgname-$version/share/info/dir
echo "==> Removed \`$pkg' symlinks from master directory." echo "==> Removed \`$pkg' symlinks from master directory."
fi fi
installed_tmpl_handler unregister $pkg installed_tmpl_handler unregister $pkgname-$version
} }
#
# Recursive function that founds dependencies in all required
# packages.
#
add_dependency_tolist() add_dependency_tolist()
{ {
local pkgdepf="$1" local curpkg="$1"
local reg_pkgdb="${PKGFS_DESTDIR}/${PKGFS_REGISTERED_PKG_DB}" local reg_pkgdb="$PKGFS_DESTDIR/$PKGFS_REGISTERED_PKG_DB"
[ -z "$pkgdepf" ] && return 1 [ -z "$curpkg" ] && return 1
[ -n "$prev_depf" ] && pkgdepf=${prev_depf} [ -n "$prev_pkg" ] && curpkg=$prev_pkg
for i in $($db_cmd btree $pkgdepf deps); do
#
# Skip key
#
[ "$i" = "deps" ] && continue
for i in $($db_cmd -V btree $PKGFS_BUILD_DEPS_DB ${curpkg%-[0-9]*}); do
# #
# origin_deps is used to only show the list of # origin_deps is used to only show the list of
# dependencies for the origin template once. # dependencies for the origin template once.
@ -769,85 +815,81 @@ add_dependency_tolist()
echo "not installed." echo "not installed."
deps_list="$i $deps_list" deps_list="$i $deps_list"
[ -n "$prev_depf" ] && unset prev_depf [ -n "$prev_pkg" ] && unset prev_pkg
# #
# Check if dependency needs more deps. # Check if dependency needs more deps.
# #
depdbf="$PKGFS_DEPSDIR/$i-deps.db" check_build_depends_tmpl $i
if [ -r "$PKGFS_DEPSDIR/$i-deps.db" ]; then if [ "$?" -eq 0 ]; then
unset origin_deps unset origin_deps
add_dependency_tolist ${depdbf} add_dependency_tolist $i
prev_depf="$depdbf" prev_pkg="$i"
fi fi
fi fi
done done
} }
#
# Installs all dependencies required by a package.
#
install_dependency_tmpl() install_dependency_tmpl()
{ {
local pkgdepf="$1" local pkg="$1"
local tmpdepf="$pkgdepf"
local tmppkgname=
deps_list= deps_list=
origin_deps=yes origin_deps=yes
[ -z "$pkgdepf" ] && return 1 [ -z "$pkg" ] && return 1
doing_deps=true doing_deps=true
tmp_pkgn=${pkgdepf%%-deps.db} echo "==> Required dependencies for $(basename $pkg):"
echo "==> Required dependencies for $(basename $tmp_pkgn):"
add_dependency_tolist $pkgdepf add_dependency_tolist $pkg
for i in ${deps_list}; do for i in ${deps_list}; do
# skip dup deps # skip dup deps
check_installed_tmpl $i check_installed_tmpl $i
[ "$?" -eq 0 ] && continue [ "$?" -eq 0 ] && continue
echo "=> Installing dependency: $i" echo "=> Installing dependency: $i"
install_tmpl $i install_tmpl ${i%-[0-9]*}
done done
unset deps_list unset deps_list
unset origin_deps unset origin_deps
} }
#
# Installs and stows the "xstow" package.
#
install_xstow_tmpl() install_xstow_tmpl()
{ {
[ -x "$PKGFS_XSTOW_CMD" ] && return 0 [ -x "$PKGFS_XSTOW_CMD" ] && return 0
reset_tmpl_vars reset_tmpl_vars
run_file "$PKGFS_TEMPLATESDIR/$xstow_version.tmpl" run_file "$PKGFS_TEMPLATESDIR/xstow.tmpl"
check_tmpl_vars ${xstow_version} check_tmpl_vars $pkgname-$version
fetch_tmpl_sources fetch_tmpl_sources
extract_tmpl_sources extract_tmpl_sources
build_tmpl_sources build_tmpl_sources
PKGFS_XSTOW_CMD="$PKGFS_DESTDIR/$xstow_version/bin/xstow" PKGFS_XSTOW_CMD="$PKGFS_DESTDIR/$pkgname-$version/bin/xstow"
stow_tmpl $xstow_version stow_tmpl $pkgname-$version
$sed_cmd -e "s|PKGFS_XSTOW_.*|PKGFS_XSTOW_CMD=$PKGFS_MASTERDIR/bin/xstow|" \
$path_fixed > $path_fixed.in && \
$mv_cmd $path_fixed.in $path_fixed
# #
# Continue with origin package that called us. # Continue with origin package that called us.
# #
run_file ${origin_tmpl} run_file $origin_tmpl
} }
#
# Registers or unregisters a package from the db file.
#
installed_tmpl_handler() installed_tmpl_handler()
{ {
local action="$1" local action="$1"
local pkg="$2" local pkg="$2"
[ -z "$action" -o -z "$pkg" ] && return 1 [ -z "$action" -o -z "$pkg" ] && return 1
#
# This function is called every time a package has been stowned
# or unstowned.
# There's a db(3) btree database file in
# PKGFS_DESTDIR/PKGFS_REGISTER_PKG_DB that stores which package
# is installed and stowned.
#
if [ "$action" = "register" ]; then if [ "$action" = "register" ]; then
$db_cmd -w btree ${PKGFS_DESTDIR}/${PKGFS_REGISTERED_PKG_DB} \ $db_cmd -w btree $PKGFS_DESTDIR/$PKGFS_REGISTERED_PKG_DB \
$pkg stowned $pkg stowned
if [ "$?" -ne 0 ]; then if [ "$?" -ne 0 ]; then
echo -n "*** ERROR: couldn't register stowned \`$pkg'" echo -n "*** ERROR: couldn't register stowned \`$pkg'"
@ -855,7 +897,7 @@ installed_tmpl_handler()
exit 1 exit 1
fi fi
elif [ "$action" = "unregister" ]; then elif [ "$action" = "unregister" ]; then
$db_cmd -d btree ${PKGFS_DESTDIR}/${PKGFS_REGISTERED_PKG_DB} $pkg $db_cmd -d btree $PKGFS_DESTDIR/$PKGFS_REGISTERED_PKG_DB $pkg
if [ "$?" -ne 0 ]; then if [ "$?" -ne 0 ]; then
echo -n "*** ERROR: \`$pkg' stowned not registered " echo -n "*** ERROR: \`$pkg' stowned not registered "
echo "in db file? ***" echo "in db file? ***"
@ -866,10 +908,14 @@ installed_tmpl_handler()
fi fi
} }
#
# Checks the registered pkgs db file and returns 0 if pkg is installed,
# otherwise returns 1.
#
check_installed_tmpl() check_installed_tmpl()
{ {
local pkg="$1" local pkg="$1"
local db_file="${PKGFS_DESTDIR}/${PKGFS_REGISTERED_PKG_DB}" local db_file="$PKGFS_DESTDIR/$PKGFS_REGISTERED_PKG_DB"
[ -z "$pkg" ] && return 1 [ -z "$pkg" ] && return 1
@ -877,8 +923,27 @@ check_installed_tmpl()
return $? return $?
} }
#
# Checks the build depends db file and returns 0 if pkg has dependencies,
# otherwise returns 1.
#
check_build_depends_tmpl()
{
local pkg="$1"
[ -z $pkg ] && return 1
[ ! -r $PKGFS_BUILD_DEPS_DB ] && return 1
$db_cmd -V btree $PKGFS_BUILD_DEPS_DB ${pkg%-[0-9]*} 2>&1 >/dev/null
return $?
}
#
# Installs a pkg by reading its build template file.
#
install_tmpl() install_tmpl()
{ {
local pkg=
cur_tmpl="$PKGFS_TEMPLATESDIR/$1.tmpl" cur_tmpl="$PKGFS_TEMPLATESDIR/$1.tmpl"
if [ -z "$cur_tmpl" -o ! -f "$cur_tmpl" ]; then if [ -z "$cur_tmpl" -o ! -f "$cur_tmpl" ]; then
echo -n "*** ERROR: invalid template file '$cur_tmpl'," echo -n "*** ERROR: invalid template file '$cur_tmpl',"
@ -887,14 +952,15 @@ install_tmpl()
fi fi
reset_tmpl_vars reset_tmpl_vars
run_file ${cur_tmpl} run_file $cur_tmpl
pkg="$1-$version"
# #
# If we are the originator package save the path this template in # If we are the originator package save the path this template in
# other var for future use. # other var for future use.
# #
if [ -z "$origin_tmpl" ]; then if [ -z "$origin_tmpl" ]; then
origin_tmpl=${path_fixed} origin_tmpl=$path_fixed
fi fi
# #
@ -905,23 +971,22 @@ install_tmpl()
# #
# Check vars for current template. # Check vars for current template.
# #
check_tmpl_vars ${pkgname} check_tmpl_vars $pkg
# #
# Handle required dependency for this template iff it # Install dependencies required by this package.
# is not installed and if we are being invoked by a dependency.
# #
local pkgdepf="$PKGFS_DEPSDIR/$pkgname-deps.db" check_build_depends_tmpl $pkg
if [ -r "$pkgdepf" -a -z "$doing_deps" ]; then if [ "$?" -eq 0 -a -z "$doing_deps" ]; then
install_dependency_tmpl ${pkgdepf} install_dependency_tmpl $pkg
# #
# At this point all required deps are installed, and # At this point all required deps are installed, and
# only remaining is the origin template; install it. # only remaining is the origin template; install it.
# #
unset doing_deps unset doing_deps
reset_tmpl_vars reset_tmpl_vars
run_file ${origin_tmpl} run_file $origin_tmpl
check_tmpl_vars ${pkgname} check_tmpl_vars $pkgname-$version
fi fi
if [ -n "$only_build" ]; then if [ -n "$only_build" ]; then
@ -939,10 +1004,12 @@ install_tmpl()
# #
# Do not stow the pkg if requested. # Do not stow the pkg if requested.
# #
[ -z "$only_install" ] && stow_tmpl ${pkgname} [ -z "$only_install" ] && stow_tmpl $pkg
} }
#
# Lists all currently installed packages.
#
list_tmpls() list_tmpls()
{ {
local reg_pkgdb="$PKGFS_DESTDIR/$PKGFS_REGISTERED_PKG_DB" local reg_pkgdb="$PKGFS_DESTDIR/$PKGFS_REGISTERED_PKG_DB"
@ -956,12 +1023,15 @@ list_tmpls()
# Skip stowned value # Skip stowned value
[ "$i" = "stowned" ] && continue [ "$i" = "stowned" ] && continue
# Run file to get short_desc and print something useful # Run file to get short_desc and print something useful
run_file ${PKGFS_TEMPLATESDIR}/$i.tmpl run_file ${PKGFS_TEMPLATESDIR}/${i%-[0-9]*}.tmpl
echo "$i $short_desc" echo "$i $short_desc"
reset_tmpl_vars reset_tmpl_vars
done done
} }
#
# Removes a currently installed package (unstow + removed from destdir).
#
remove_tmpl() remove_tmpl()
{ {
local pkg="$1" local pkg="$1"
@ -971,13 +1041,20 @@ remove_tmpl()
exit 1 exit 1
fi fi
if [ ! -d "$PKGFS_DESTDIR/$pkg" ]; then if [ ! -f "$PKGFS_TEMPLATESDIR/$pkg.tmpl" ]; then
echo "*** ERROR: cannot find template file ***"
exit 1
fi
run_file $PKGFS_TEMPLATESDIR/$pkg.tmpl
if [ ! -d "$PKGFS_DESTDIR/$pkg-$version" ]; then
echo "*** ERROR: cannot find package on $PKGFS_DESTDIR ***" echo "*** ERROR: cannot find package on $PKGFS_DESTDIR ***"
exit 1 exit 1
fi fi
unstow_tmpl ${pkg} unstow_tmpl $pkg-$version
$rm_cmd -rf $PKGFS_DESTDIR/$pkg $rm_cmd -rf $PKGFS_DESTDIR/$pkg-$version
return "$?" return "$?"
} }
@ -1047,6 +1124,7 @@ remove)
remove_tmpl "$2" remove_tmpl "$2"
;; ;;
stow) stow)
stow_flag=yes
stow_tmpl "$2" stow_tmpl "$2"
;; ;;
unstow) unstow)

View file

@ -1,7 +1,8 @@
# Template build file for 'MesaLib-7.2'. # Template build file for 'MesaLib'.
pkgname=MesaLib-7.2 pkgname=MesaLib
version=7.2
patch_files="$pkgname-fix-dri-build.diff" patch_files="$pkgname-fix-dri-build.diff"
wrksrc=Mesa-7.2 wrksrc=Mesa-$version
extract_sufx=".tar.bz2" extract_sufx=".tar.bz2"
url=http://kent.dl.sourceforge.net/sourceforge/mesa3d url=http://kent.dl.sourceforge.net/sourceforge/mesa3d
build_style=gnu_configure build_style=gnu_configure

View file

@ -1,5 +1,6 @@
# Template build file for 'atk-1.24.0'. # Template build file for 'atk'.
pkgname=atk-1.24.0 pkgname=atk
version=1.24.0
extract_sufx=".tar.bz2" extract_sufx=".tar.bz2"
url=http://ftp.gnome.org/pub/GNOME/sources/atk/1.24 url=http://ftp.gnome.org/pub/GNOME/sources/atk/1.24
build_style=gnu_configure build_style=gnu_configure

View file

@ -1,5 +1,6 @@
# Template file for 'bigreqsproto-1.0.2' # Template file for 'bigreqsproto'
pkgname=bigreqsproto-1.0.2 pkgname=bigreqsproto
version=1.0.2
extract_sufx=".tar.bz2" extract_sufx=".tar.bz2"
url=http://xorg.freedesktop.org/releases/individual/proto url=http://xorg.freedesktop.org/releases/individual/proto
build_style=gnu_configure build_style=gnu_configure

View file

@ -1,5 +1,6 @@
# Template build file for 'cairo-1.7.6'. # Template build file for 'cairo'.
pkgname=cairo-1.7.6 pkgname=cairo
version=1.7.6
patch_files="$pkgname-doc-public-Makefile-in.diff" patch_files="$pkgname-doc-public-Makefile-in.diff"
extract_sufx=".tar.gz" extract_sufx=".tar.gz"
url=http://cairographics.org/snapshots url=http://cairographics.org/snapshots

View file

@ -1,5 +1,6 @@
# Template build file for 'compositeproto-0.4'. # Template build file for 'compositeproto'.
pkgname=compositeproto-0.4 pkgname=compositeproto
version=0.4
extract_sufx=".tar.bz2" extract_sufx=".tar.bz2"
url=http://xorg.freedesktop.org/releases/individual/proto url=http://xorg.freedesktop.org/releases/individual/proto
build_style=gnu_configure build_style=gnu_configure

View file

@ -1,5 +1,6 @@
# Template file for 'curl-7.18.0' # Template file for 'curl'
pkgname=curl-7.18.0 pkgname=curl
version=7.18.0
extract_sufx=".tar.bz2" extract_sufx=".tar.bz2"
url=http://curl.haxx.se/download/ url=http://curl.haxx.se/download/
build_style=gnu_configure build_style=gnu_configure

View file

@ -1,5 +1,6 @@
# Template build file for 'damageproto-1.1.0'. # Template build file for 'damageproto'.
pkgname=damageproto-1.1.0 pkgname=damageproto
version=1.1.0
extract_sufx=".tar.bz2" extract_sufx=".tar.bz2"
url=http://xorg.freedesktop.org/releases/individual/proto url=http://xorg.freedesktop.org/releases/individual/proto
build_style=gnu_configure build_style=gnu_configure

View file

@ -1,5 +1,6 @@
# Template build file for 'dmxproto-2.2.2'. # Template build file for 'dmxproto'.
pkgname=dmxproto-2.2.2 pkgname=dmxproto
version=2.2.2
extract_sufx=".tar.bz2" extract_sufx=".tar.bz2"
url=http://xorg.freedesktop.org/releases/individual/proto url=http://xorg.freedesktop.org/releases/individual/proto
build_style=gnu_configure build_style=gnu_configure

View file

@ -1,5 +1,6 @@
# Template build file for 'evieext-1.0.2'. # Template build file for 'evieext'.
pkgname=evieext-1.0.2 pkgname=evieext
version=1.0.2
extract_sufx=".tar.bz2" extract_sufx=".tar.bz2"
url=http://xorg.freedesktop.org/releases/individual/proto url=http://xorg.freedesktop.org/releases/individual/proto
build_style=gnu_configure build_style=gnu_configure

View file

@ -1,5 +1,6 @@
# Template file for 'expat-2.0.1' # Template file for 'expat'
pkgname=expat-2.0.1 pkgname=expat
version=2.0.1
extract_sufx=".tar.gz" extract_sufx=".tar.gz"
url=http://kent.dl.sourceforge.net/sourceforge/expat url=http://kent.dl.sourceforge.net/sourceforge/expat
build_style=gnu_configure build_style=gnu_configure

View file

@ -1,5 +1,6 @@
# Template build file for 'fixesproto-4.0'. # Template build file for 'fixesproto'.
pkgname=fixesproto-4.0 pkgname=fixesproto
version=4.0
extract_sufx=".tar.bz2" extract_sufx=".tar.bz2"
url=http://xorg.freedesktop.org/releases/individual/proto url=http://xorg.freedesktop.org/releases/individual/proto
build_style=gnu_configure build_style=gnu_configure

View file

@ -1,5 +1,6 @@
# Template build file for 'fontcacheproto-0.1.2'. # Template build file for 'fontcacheproto'.
pkgname=fontcacheproto-0.1.2 pkgname=fontcacheproto
version=0.1.2
extract_sufx=".tar.bz2" extract_sufx=".tar.bz2"
url=http://xorg.freedesktop.org/releases/individual/proto url=http://xorg.freedesktop.org/releases/individual/proto
build_style=gnu_configure build_style=gnu_configure

View file

@ -1,5 +1,6 @@
# Template build file for 'fontconfig-2.6.0'. # Template build file for 'fontconfig'.
pkgname=fontconfig-2.6.0 pkgname=fontconfig
version=2.6.0
patch_files="$pkgname-Makefile-fc-cache.diff" patch_files="$pkgname-Makefile-fc-cache.diff"
extract_sufx=".tar.gz" extract_sufx=".tar.gz"
url=http://www.fontconfig.org/release url=http://www.fontconfig.org/release

View file

@ -1,5 +1,6 @@
# Template build file for 'fontsproto-2.0.2'. # Template build file for 'fontsproto'.
pkgname=fontsproto-2.0.2 pkgname=fontsproto
version=2.0.2
extract_sufx=".tar.bz2" extract_sufx=".tar.bz2"
url=http://xorg.freedesktop.org/releases/individual/proto url=http://xorg.freedesktop.org/releases/individual/proto
build_style=gnu_configure build_style=gnu_configure

View file

@ -1,9 +1,8 @@
# Template build file for 'freetype2-2.3.7'. # Template build file for 'freetype2'.
freetype2_version="2.3.7" pkgname=freetype2
version=2.3.7
pkgname=freetype2-$freetype2_version
extract_sufx=".tar.bz2" extract_sufx=".tar.bz2"
distfiles="freetype-$freetype2_version" distfiles="freetype-$version"
url=http://download.savannah.gnu.org/releases/freetype url=http://download.savannah.gnu.org/releases/freetype
build_style=gnu_configure build_style=gnu_configure
make_cmd="$PKGFS_MASTERDIR/bin/gmake" make_cmd="$PKGFS_MASTERDIR/bin/gmake"

View file

@ -1,5 +1,6 @@
# Template build file for 'git-1.6.0.2". # Template build file for 'git".
pkgname=git-1.6.0.2 pkgname=git
version=1.6.0.2
extract_sufx=".tar.bz2" extract_sufx=".tar.bz2"
url=http://www.kernel.org/pub/software/scm/git url=http://www.kernel.org/pub/software/scm/git
build_style=gnu_configure build_style=gnu_configure

View file

@ -1,7 +1,8 @@
# Template build file for 'glib-2.18.1' # Template build file for 'glib'
pkgname=glib-2.18.1 pkgname=glib
version=2.18.1
extract_sufx=".tar.bz2" extract_sufx=".tar.bz2"
patch_files="glib-2.18.1-fix-statfs-netbsd.diff" patch_files="glib-fix-statfs-netbsd.diff"
url=http://ftp.gnome.org/pub/gnome/sources/glib/2.18 url=http://ftp.gnome.org/pub/gnome/sources/glib/2.18
make_cmd="$PKGFS_MASTERDIR/bin/gmake" make_cmd="$PKGFS_MASTERDIR/bin/gmake"
# Disable FAM for now and use the installed pcre package instead # Disable FAM for now and use the installed pcre package instead

View file

@ -1,5 +1,6 @@
# Template build file for 'glitz-0.5.6'. # Template build file for 'glitz'.
pkgname=glitz-0.5.6 pkgname=glitz
version=0.5.6
extract_sufx=".tar.gz" extract_sufx=".tar.gz"
url=http://cairographics.org/snapshots url=http://cairographics.org/snapshots
build_style=gnu_configure build_style=gnu_configure

View file

@ -1,5 +1,6 @@
# Template build file for 'glproto-1.4.9'. # Template build file for 'glproto'.
pkgname=glproto-1.4.9 pkgname=glproto
version=1.4.9
extract_sufx=".tar.bz2" extract_sufx=".tar.bz2"
url=http://xorg.freedesktop.org/releases/individual/proto url=http://xorg.freedesktop.org/releases/individual/proto
build_style=gnu_configure build_style=gnu_configure

View file

@ -1,7 +1,8 @@
# Template build file for 'gmake-3.81' # Template build file for 'gmake'
pkgname=gmake-3.81 pkgname=gmake
version=3.81
extract_sufx=".tar.bz2" extract_sufx=".tar.bz2"
distfiles="make-3.81" distfiles="make-$version"
url=http://ftp.gnu.org/pub/gnu/make url=http://ftp.gnu.org/pub/gnu/make
configure_args="--program-prefix=g" configure_args="--program-prefix=g"
build_style=gnu_configure build_style=gnu_configure

View file

@ -1,5 +1,6 @@
# Template build file for 'gtk+-2.14.3'. # Template build file for 'gtk+'.
pkgname=gtk+-2.14.3 pkgname=gtk+
version=2.14.3
patch_files="$pkgname-tests-Makefile-in.diff" patch_files="$pkgname-tests-Makefile-in.diff"
extract_sufx=".tar.bz2" extract_sufx=".tar.bz2"
url=http://ftp.gnome.org/pub/GNOME/sources/gtk+/2.14 url=http://ftp.gnome.org/pub/GNOME/sources/gtk+/2.14

View file

@ -1,5 +1,6 @@
# Template file for 'inputproto-1.4.4' # Template file for 'inputproto'
pkgname=inputproto-1.4.4 pkgname=inputproto
version=1.4.4
extract_sufx=".tar.bz2" extract_sufx=".tar.bz2"
url=http://xorg.freedesktop.org/releases/individual/proto url=http://xorg.freedesktop.org/releases/individual/proto
build_style=gnu_configure build_style=gnu_configure

View file

@ -1,5 +1,6 @@
# Template build file for 'intltool-0.40.4'. # Template build file for 'intltool'.
pkgname=intltool-0.40.4 pkgname=intltool
version=0.40.4
extract_sufx=".tar.bz2" extract_sufx=".tar.bz2"
url=http://ftp.gnome.org/pub/GNOME/sources/intltool/0.40 url=http://ftp.gnome.org/pub/GNOME/sources/intltool/0.40
build_style=gnu_configure build_style=gnu_configure

View file

@ -1,5 +1,6 @@
# Template build file for 'irssi-0.8.12' # Template build file for 'irssi'
pkgname=irssi-0.8.12 pkgname=irssi
version=0.8.12
extract_sufx=".tar.bz2" extract_sufx=".tar.bz2"
url=http://www.irssi.org/files url=http://www.irssi.org/files
# We need this to get some perl paths. # We need this to get some perl paths.

View file

@ -1,5 +1,6 @@
# Template build file for 'jasper-1.900.1'. # Template build file for 'jasper'.
pkgname=jasper-1.900.1 pkgname=jasper
version=1.900.1
extract_sufx=".zip" extract_sufx=".zip"
url=http://www.ece.uvic.ca/~mdadams/jasper/software url=http://www.ece.uvic.ca/~mdadams/jasper/software
build_style=gnu_configure build_style=gnu_configure

View file

@ -1,7 +1,8 @@
# Template build file for 'jpeg-6b'. # Template build file for 'jpeg'.
pkgname=jpeg-6b pkgname=jpeg
version=6b
wrksrc=$pkgname-$version
patch_files="$pkgname-makefile-cfg.diff" patch_files="$pkgname-makefile-cfg.diff"
wrksrc="$pkgname"
distfiles="jpegsrc.v6b" distfiles="jpegsrc.v6b"
extract_sufx=".tar.gz" extract_sufx=".tar.gz"
url=ftp://ftp.fu-berlin.de/unix/graphics/jpeg url=ftp://ftp.fu-berlin.de/unix/graphics/jpeg

View file

@ -1,5 +1,6 @@
# Template file for 'kbproto-1.0.3' # Template file for 'kbproto'
pkgname=kbproto-1.0.3 pkgname=kbproto
version=1.0.3
extract_sufx=".tar.bz2" extract_sufx=".tar.bz2"
url=http://xorg.freedesktop.org/releases/individual/proto url=http://xorg.freedesktop.org/releases/individual/proto
build_style=gnu_configure build_style=gnu_configure

View file

@ -1,5 +1,6 @@
# Template build file for 'libICE-1.0.4'. # Template build file for 'libICE'.
pkgname=libICE-1.0.4 pkgname=libICE
version=1.0.4
extract_sufx=".tar.bz2" extract_sufx=".tar.bz2"
url=http://xorg.freedesktop.org/releases/individual/lib url=http://xorg.freedesktop.org/releases/individual/lib
build_style=gnu_configure build_style=gnu_configure

View file

@ -1,5 +1,6 @@
# Template build file for 'libSM-1.1.0'. # Template build file for 'libSM'.
pkgname=libSM-1.1.0 pkgname=libSM
version=1.1.0
extract_sufx=".tar.bz2" extract_sufx=".tar.bz2"
url=http://xorg.freedesktop.org/releases/individual/lib url=http://xorg.freedesktop.org/releases/individual/lib
build_style=gnu_configure build_style=gnu_configure

View file

@ -1,5 +1,6 @@
# Template file for 'libX11-1.1.5' # Template file for 'libX11'
pkgname=libX11-1.1.5 pkgname=libX11
version=1.1.5
extract_sufx=".tar.bz2" extract_sufx=".tar.bz2"
url=http://xorg.freedesktop.org/releases/individual/lib url=http://xorg.freedesktop.org/releases/individual/lib
build_style=gnu_configure build_style=gnu_configure

Some files were not shown because too many files have changed in this diff Show more