Mega-commit removing deps in xbps-base-chroot.

xbps-src:
  * ALWAYS use the static bins, to avoid breakage in the chroot.
  * Remove XBPS_FETCH_CMD. Use xbps-fetch (static) now that it's
    useful to download all distfiles in xbps-base-system.
  * Use busybox in the chroot and create links in /usr/local/bin
    at creation time. This helps to remove many packages that
    had problems with host/target libs (acl, attr, libarchive, etc).

build templates:
  * Add explicit gettext and texinfo build dependencies in all
    packages that need them, because they aren't built anymore
    by xbps-base-chroot.
  * Fixed some packages using build_style=gnu_makefile, that were
    broken because pre/post_configure() is not executed for a while,
    they should use pre/post_build() instead.

--HG--
extra : convert_revision : 0eaaf4917fd824710d0895e0c984bbc236b0cdf8
This commit is contained in:
Juan RP 2009-10-30 22:14:09 +01:00
parent ab0de77616
commit 1ebe5e6b5e
54 changed files with 148 additions and 199 deletions

19
README
View File

@ -5,23 +5,24 @@
The following software is required in the host system to build XBPS
binary packages:
* GNU GCC C++
* GNU Make
* GNU Bison
* GNU awk
* GNU bash
* GNU bison
* GNU gcc c++ (development package)
* GNU gettext (development package)
* GNU make
* GNU patch
* GNU texinfo
* fakeroot
* wget OR curl OR fetch (statically linked or no additional deps)
* perl
* sudo
Please note that wget/curl or any program used to fetch distfiles,
must be statically linked or if shared, it should be only linked to libc.
This is required to not depend in external libs while building packages
in the chroot.
Run "make install clean" at the top level directory, xbps-src and
its shell utilities will be installed into /usr/local by default (can be
changed by setting PREFIX and DESTDIR).
DONT FORGET TO EDIT "$PREFIX/etc/xbps-src.conf" BEFORE USING IT!
------------------------------------------------------------------------------
HOW TO BUILD/HANDLE PACKAGES FROM SOURCE
------------------------------------------------------------------------------

View File

@ -1,36 +0,0 @@
--- include/builddefs.in.orig 2009-04-24 02:26:13.747541261 +0200
+++ include/builddefs.in 2009-04-24 02:26:54.954519524 +0200
@@ -27,14 +27,14 @@ PKG_RELEASE = @pkg_release@
PKG_VERSION = @pkg_version@
PKG_PLATFORM = @pkg_platform@
PKG_DISTRIBUTION= @pkg_distribution@
-PKG_BIN_DIR = @bindir@
-PKG_SBIN_DIR = @sbindir@
-PKG_LIB_DIR = @libdir@@libdirsuffix@
-PKG_DEVLIB_DIR = @libexecdir@@libdirsuffix@
-PKG_INC_DIR = @includedir@
-PKG_MAN_DIR = @mandir@
-PKG_DOC_DIR = @datadir@/doc/@pkg_name@
-PKG_LOCALE_DIR = @datadir@/locale
+PKG_BIN_DIR = $(DESTDIR)@bindir@
+PKG_SBIN_DIR = $(DESTDIR)@sbindir@
+PKG_LIB_DIR = $(DESTDIR)@libdir@@libdirsuffix@
+PKG_DEVLIB_DIR = $(DESTDIR)@libexecdir@@libdirsuffix@
+PKG_INC_DIR = $(DESTDIR)@includedir@
+PKG_MAN_DIR = $(DESTDIR)@mandir@
+PKG_DOC_DIR = $(DESTDIR)@datadir@/doc/@pkg_name@
+PKG_LOCALE_DIR = $(DESTDIR)@datadir@/locale
CC = @cc@
AWK = @awk@
--- include/buildmacros.orig 2009-10-25 09:35:28.000000000 +0100
+++ include/buildmacros 2009-10-25 09:35:42.000000000 +0100
@@ -40,7 +40,7 @@ OBJECTS = $(ASFILES:.s=.o) \
$(LFILES:.l=.o) \
$(YFILES:%.y=%.tab.o)
-INSTALL = $(TOPDIR)/include/install-sh -o $(PKG_USER) -g $(PKG_GROUP)
+INSTALL = $(TOPDIR)/include/install-sh
SHELL = /bin/sh
IMAGES_DIR = $(TOPDIR)/all-images

View File

@ -3,11 +3,9 @@ pkgname=acl
version=2.2.48
distfiles="ftp://oss.sgi.com/projects/xfs/cmd_tars/acl-${version}.src.tar.gz"
build_style=gnu_configure
configure_env="ac_cv_path_LIBTOOL=${XBPS_MASTERDIR}/usr/bin/libtool
ac_cv_path_MSGFMT=${XBPS_MASTERDIR}/usr/bin/msgfmt
ac_cv_path_MSGMERGE=${XBPS_MASTERDIR}/usr/bin/msgmerge
ac_cv_path_XGETTEXT=${XBPS_MASTERDIR}/usr/bin/xgettext"
make_install_args="install-lib install-dev"
make_install_target="prefix=$XBPS_DESTDIR/$pkgname-$version/usr
PKG_MAN_DIR=$XBPS_DESTDIR/$pkgname-$version/usr/share/man install
install-lib install-dev"
short_desc="Access Control List filesystem support"
maintainer="Juan RP <xtraeme@gmail.com>"
checksum=b45e21549c9752ad9b99862cce79d7ec5ef4b32c3e95a39f79f0a8442b86476e
@ -15,11 +13,8 @@ long_desc="
This package includes support for Access Control Lists support for supported
filesystems."
base_chroot=yes
keep_libtool_archives=yes
subpackages="devel progs"
Add_dependency build libtool
Add_dependency build gettext
Add_dependency run glibc
Add_dependency full attr

View File

@ -24,7 +24,7 @@ Add_dependency full glibc
Add_dependency full bash
Add_dependency full run-parts
pre_configure()
pre_build()
{
sed -i 's/const int isleap;/int isleap;/' $wrksrc/gregor.c
}

View File

@ -1,36 +0,0 @@
--- include/builddefs.in.orig 2009-04-24 01:39:53.424180873 +0200
+++ include/builddefs.in 2009-04-24 01:41:04.518498094 +0200
@@ -27,14 +27,14 @@ PKG_RELEASE = @pkg_release@
PKG_VERSION = @pkg_version@
PKG_PLATFORM = @pkg_platform@
PKG_DISTRIBUTION= @pkg_distribution@
-PKG_BIN_DIR = @bindir@
-PKG_SBIN_DIR = @sbindir@
-PKG_LIB_DIR = @libdir@@libdirsuffix@
-PKG_DEVLIB_DIR = @libexecdir@@libdirsuffix@
-PKG_INC_DIR = @includedir@/attr
-PKG_MAN_DIR = @mandir@
-PKG_DOC_DIR = @datadir@/doc/@pkg_name@
-PKG_LOCALE_DIR = @datadir@/locale
+PKG_BIN_DIR = $(DESTDIR)@bindir@
+PKG_SBIN_DIR = $(DESTDIR)@sbindir@
+PKG_LIB_DIR = $(DESTDIR)@libdir@@libdirsuffix@
+PKG_DEVLIB_DIR = $(DESTDIR)@libexecdir@@libdirsuffix@
+PKG_INC_DIR = $(DESTDIR)@includedir@/attr
+PKG_MAN_DIR = $(DESTDIR)@mandir@
+PKG_DOC_DIR = $(DESTDIR)@datadir@/doc/@pkg_name@
+PKG_LOCALE_DIR = $(DESTDIR)@datadir@/locale
CC = @cc@
AWK = @awk@
--- include/buildmacros.orig 2009-10-25 09:35:28.000000000 +0100
+++ include/buildmacros 2009-10-25 09:35:42.000000000 +0100
@@ -40,7 +40,7 @@ OBJECTS = $(ASFILES:.s=.o) \
$(LFILES:.l=.o) \
$(YFILES:%.y=%.tab.o)
-INSTALL = $(TOPDIR)/include/install-sh -o $(PKG_USER) -g $(PKG_GROUP)
+INSTALL = $(TOPDIR)/include/install-sh
SHELL = /bin/sh
IMAGES_DIR = $(TOPDIR)/all-images

View File

@ -3,22 +3,17 @@ pkgname=attr
version=2.4.44
distfiles="ftp://oss.sgi.com/projects/xfs/cmd_tars/attr-${version}.src.tar.gz"
build_style=gnu_configure
configure_env="ac_cv_path_LIBTOOL=${XBPS_MASTERDIR}/usr/bin/libtool
ac_cv_path_MSGFMT=${XBPS_MASTERDIR}/usr/bin/msgfmt
ac_cv_path_MSGMERGE=${XBPS_MASTERDIR}/usr/bin/msgmerge
ac_cv_path_XGETTEXT=${XBPS_MASTERDIR}/usr/bin/xgettext"
make_install_args="install-lib install-dev"
make_install_target="prefix=$XBPS_DESTDIR/$pkgname-$version/usr
PKG_MAN_DIR=$XBPS_DESTDIR/$pkgname-$version/usr/share/man install
install-lib install-dev"
short_desc="Extended attribute support library for ACL support"
maintainer="Juan RP <xtraeme@gmail.com>"
checksum=e01fa00686072a02dddf994e6217be950f51c1dc0852ad2e210c48b6e8de793a
long_desc="
This package includes Extended attribute support library for ACL support."
base_chroot=yes
keep_libtool_archives=yes
subpackages="devel progs"
Add_dependency build libtool
Add_dependency build gettext
Add_dependency run glibc

View File

@ -20,3 +20,4 @@ Add_dependency full gawk
Add_dependency full diffutils
Add_dependency full m4
Add_dependency full perl
Add_dependency build texinfo

View File

@ -17,3 +17,4 @@ long_desc="
noarch=yes
Add_dependency full autoconf 2.60
Add_dependency full libtool
Add_dependency build texinfo

View File

@ -31,12 +31,13 @@ long_desc="
modification."
essential=yes
base_chroot=yes
register_shell="/bin/bash"
Add_dependency full glibc
Add_dependency build ncurses
Add_dependency build texinfo
Add_dependency build gettext
Add_dependency build bison
Add_dependency run ncurses-libs
Add_dependency run coreutils

View File

@ -12,3 +12,4 @@ long_desc="
Add_dependency full glibc
Add_dependency full m4
Add_dependency build gettext

View File

@ -150,7 +150,7 @@ CONFIG_CHMOD=y
CONFIG_CHOWN=y
CONFIG_CHROOT=y
# CONFIG_CKSUM is not set
# CONFIG_COMM is not set
CONFIG_COMM=y
CONFIG_CP=y
CONFIG_CUT=y
CONFIG_DATE=y

View File

@ -3,11 +3,7 @@ pkgname=coreutils
version=7.6
distfiles="http://ftp.gnu.org/gnu/coreutils/$pkgname-$version.tar.gz"
build_style=gnu_configure
configure_args="--enable-install-program=hostname --bindir=/bin
ac_cv_header_selinux_flask_h=no ac_cv_header_selinux_selinux_h=no
ac_cv_header_selinux_context_h=no ac_cv_search_setfilecon=no
ac_cv_header_sys_capability_h=no"
configure_env="PERL=/usr/bin/perl"
configure_args="--enable-install-program=hostname --bindir=/bin"
short_desc="The GNU core utilities"
maintainer="Juan RP <xtraeme@gmail.com>"
checksum=1d9bfe8b427ca5f8cffa0b462f861e4157c946fbeaf0884d273bbd6cab1c25d4
@ -17,11 +13,11 @@ long_desc="
which are expected to exist on every operating system."
essential=yes
base_chroot=yes
Add_dependency run glibc
Add_dependency full gmp
Add_dependency full attr
Add_dependency full acl
Add_dependency build perl
post_install()
{

View File

@ -13,6 +13,8 @@ long_desc="
on tapes."
Add_dependency run glibc
Add_dependency build gettext
Add_dependency build texinfo
post_install()
{

View File

@ -12,6 +12,7 @@ long_desc="
against a dictionary file to find weak passwords (vulnerable to
dictionary attacks)."
Add_dependency build gettext
Add_dependency full glibc
Add_dependency full zlib

View File

@ -18,7 +18,6 @@ long_desc="
dash in 2002."
essential=yes
base_chroot=yes
register_shell="/bin/sh"
Add_dependency run glibc
Add_dependency full glibc
Add_dependency run coreutils

View File

@ -18,6 +18,7 @@ subpackages="devel libs"
conf_files="/etc/mke2fs.conf"
Add_dependency run glibc
Add_dependency run e2fsprogs-libs
Add_dependency build gettext
post_install()
{

View File

@ -24,3 +24,4 @@ long_desc="
Add_dependency full glibc
Add_dependency full bison
Add_dependency full m4
Add_dependency build gettext

View File

@ -10,6 +10,4 @@ checksum=f2a2f3b3053837c56fd42d801419e6a2aa89326c72308a87737da44191713a4d
long_desc="
The GNU AWK utility, a pattern scanning and processing tool."
base_chroot=yes
Add_dependency run glibc

View File

@ -13,7 +13,6 @@ long_desc="
messages in different languages, as one of the steps to
internationalisation (or i18n) of a utility."
base_chroot=yes
subpackages="devel libs"
Add_dependency run glibc
Add_dependency build ncurses

View File

@ -15,7 +15,6 @@ do_install()
mv ${SRCPKGDESTDIR}/usr/bin ${DESTDIR}/usr
mv ${SRCPKGDESTDIR}/usr/include ${DESTDIR}/usr
mv ${SRCPKGDESTDIR}/usr/lib/glib-2.0 ${DESTDIR}/usr/lib
mv ${SRCPKGDESTDIR}/usr/lib/*.*a ${DESTDIR}/usr/lib
mv ${SRCPKGDESTDIR}/usr/lib/*.so ${DESTDIR}/usr/lib
mv ${SRCPKGDESTDIR}/usr/lib/pkgconfig ${DESTDIR}/usr/lib
for f in man gtk-doc aclocal glib-2.0 gdb; do

View File

@ -27,7 +27,6 @@ conf_files="/etc/rpc /etc/ld.so.conf /etc/nsswitch.conf"
subpackages="devel locales"
Add_dependency build gcc
Add_dependency build gawk
Add_dependency build kernel-libc-headers
Add_dependency run xbps-base-files
Add_dependency run gcc-libgcc

View File

@ -31,3 +31,5 @@ Add_dependency full readline
Add_dependency full libtasn1
Add_dependency full libgcrypt
Add_dependency full lzo
Add_dependency build gettext
Add_dependency build texinfo

View File

@ -19,6 +19,7 @@ long_desc="
Add_dependency full glibc
Add_dependency run gcc-libstdc++
Add_dependency build texinfo
post_install()
{

View File

@ -14,7 +14,6 @@ long_desc="
full regexp matcher without necessarily having to look at every character.
The result is typically many times faster than Unix grep or egrep."
base_chroot=yes
Add_dependency build texinfo
Add_dependency build gettext
Add_dependency run glibc

View File

@ -21,3 +21,5 @@ Add_dependency full gcc-libstdc++
Add_dependency full bash
Add_dependency full zlib
Add_dependency full sed
Add_dependency build bison
Add_dependency build texinfo

View File

@ -15,13 +15,13 @@ long_desc="
subpackages="devel utils"
Add_dependency build kernel-headers
Add_dependency build kernel
Add_dependency build bison
Add_dependency build perl
pre_configure()
pre_build()
{
local kver="$(xbps-pkgdb -r / version kernel-headers)"
local kver="$(xbps-pkgdb version kernel-headers)"
cd $wrksrc || return 1
ln -s /usr/src/kernel-headers-$kver linux

View File

@ -17,3 +17,4 @@ long_desc="
subpackages="devel"
Add_dependency full glibc
Add_dependency full libgpg-error
Add_dependency build texinfo

View File

@ -13,6 +13,7 @@ long_desc="
subpackages="devel"
Add_dependency full glibc
Add_dependency build gettext
post_install()
{

View File

@ -20,3 +20,4 @@ long_desc="
subpackages="devel tools"
Add_dependency full glibc
Add_dependency build texinfo

View File

@ -12,6 +12,5 @@ long_desc="
the complexity of generating special library types (such as shared
libraries) befind a consistent interface."
base_chroot=yes
subpackages="ltdl"
Add_dependency run glibc

View File

@ -26,6 +26,7 @@ Add_dependency full less
Add_dependency full gdbm
Add_dependency full groff
Add_dependency full grep
Add_dependency build gettext
post_install()
{

View File

@ -16,9 +16,7 @@ long_desc="
ecompiler infocmp, clear, tput, tset, and a termcap conversion tool captoinfo.
Full manual pages are provided for the library and tools."
base_chroot=yes
subpackages="base devel libs term"
Add_dependency run glibc
Add_dependency run ncurses-libs

View File

@ -24,6 +24,7 @@ subpackages="devel"
Add_dependency full glibc
Add_dependency full cracklib
Add_dependency build flex
Add_dependency build gettext
post_install()
{

View File

@ -43,4 +43,6 @@ pre_configure()
-Dsitelib=${p5_base}/site_perl/${p5_apiver} \
-Dvendorlib=${p5_base}/vendor_perl/${p5_apiver}"
export configure_args="${args}"
sed -i -e "s|'/bin/pwd'|'/usr/local/bin/pwd'|" lib/Cwd.pm
}

View File

@ -1,8 +1,7 @@
# Template build file for 'pkg-config'
pkgname=pkg-config
version=0.23
distfiles="
http://pkgconfig.freedesktop.org/releases/$pkgname-$version.tar.gz"
distfiles="http://pkgconfig.freedesktop.org/releases/$pkgname-$version.tar.gz"
build_style=gnu_configure
configure_args="--disable-threads"
short_desc="System for managing library compile/link flags"

View File

@ -22,7 +22,5 @@ long_desc="
with the exception that NetBSD specific code has been removed and it has
been converted to be built through the GNU autotools."
base_chroot=yes
subpackages="devel"
Add_dependency run glibc

View File

@ -11,4 +11,5 @@ long_desc="
the proc filesystem. We're not about changing the world, but providing
the system administratror with some help in common tasks."
Add_dependency build gettext
Add_dependency run glibc

View File

@ -24,6 +24,7 @@ subpackages="devel"
Add_dependency full glibc
Add_dependency build ncurses
Add_dependency run ncurses-libs
Add_dependency build texinfo
pre_configure()
{

View File

@ -3,9 +3,7 @@ pkgname=sed
version=4.2.1
distfiles="http://ftp.gnu.org/gnu/$pkgname/$pkgname-$version.tar.gz"
build_style=gnu_configure
configure_args="--bindir=/bin
ac_cv_header_selinux_flask_h=no ac_cv_header_selinux_selinux_h=no
ac_cv_header_selinux_context_h=no ac_cv_search_setfilecon=no"
configure_args="--bindir=/bin"
short_desc="The GNU stream editor"
maintainer="Juan RP <xtraeme@gmail.com>"
checksum=8773541ce097fdc4c5b9e7da12a82dffbb30cd91f7bc169f52f05f93b7fc3060
@ -13,6 +11,5 @@ long_desc="
Sed, the GNU Stream Editor, copies the named files (standard input default)
to the standard output, edited according to a script of commands."
base_chroot=yes
Add_dependency run glibc
Add_dependency full acl

View File

@ -21,6 +21,7 @@ conf_files="/etc/pam.d/usermod /etc/pam.d/userdel /etc/pam.d/useradd
Add_dependency full glibc
Add_dependency full pam
Add_dependency build gettext
pre_build()
{

View File

@ -14,7 +14,7 @@ long_desc="
on Brian Reid's Scribe and other formatting languages of the time. It is
used by many non-GNU projects as well."
base_chroot=yes
Add_dependency build gettext
Add_dependency run glibc
Add_dependency run ncurses-libs
Add_dependency run findutils

View File

@ -22,6 +22,7 @@ Add_dependency full zlib
Add_dependency full libblkid
Add_dependency run ncurses-libs
Add_dependency build pkg-config
Add_dependency build gettext
post_configure()
{

View File

@ -32,6 +32,8 @@ long_desc="
conf_files="/etc/wgetrc"
Add_dependency run glibc
Add_dependency full openssl
Add_dependency build gettext
Add_dependency build texinfo
post_build()
{

View File

@ -12,3 +12,4 @@ long_desc="
Add_dependency full glibc
Add_dependency full bash
Add_dependency build texinfo

View File

@ -1,6 +1,6 @@
# Template file for 'xbps-base-chroot'
pkgname=xbps-base-chroot
version=0.10
version=0.11
build_style=meta-template
short_desc="xbps base packages for the chroot target"
maintainer="Juan RP <xtraeme@gmail.com>"
@ -12,26 +12,15 @@ noarch=yes
base_chroot=yes
Add_dependency full xbps-base-files
Add_dependency full ncurses
Add_dependency full gettext
Add_dependency full texinfo
Add_dependency full gcc
Add_dependency full glibc
Add_dependency full dash
Add_dependency full patch
Add_dependency full gawk
Add_dependency full bash
Add_dependency full coreutils
Add_dependency full tar
Add_dependency full grep
Add_dependency full findutils
Add_dependency full sed
Add_dependency full make
Add_dependency full diffutils
Add_dependency full file
Add_dependency run zlib-devel
Add_dependency run bzip2-devel
Add_dependency run ncurses-devel
Add_dependency full tar
Add_dependency full findutils
Add_dependency full gcc
Add_dependency full glibc
Add_dependency full busybox-initramfs
Add_dependency run gcc-c++
Add_dependency run gcc-libstdc++-devel
Add_dependency run glibc-devel

View File

@ -1,6 +1,6 @@
# Template file for 'xbps-base-chroot'
pkgname=xbps-base-system
version=0.20
version=0.21
build_style=meta-template
short_desc="xbps base system packages"
maintainer="Juan RP <xtraeme@gmail.com>"
@ -11,6 +11,12 @@ long_desc="
noarch=yes
Add_dependency full xbps-base-files
Add_dependency full dash
Add_dependency full bash
Add_dependency full coreutils
Add_dependency full grep
Add_dependency full findutils
Add_dependency full sed
Add_dependency full texinfo
Add_dependency full coreutils
Add_dependency full OpenRC

View File

@ -51,11 +51,6 @@ XBPS_CXXFLAGS="$XBPS_CFLAGS"
#
#XBPS_MAKEJOBS=4
#
# Fetch command to download files.
#
XBPS_FETCH_CMD=wget
#
# Compression program used to build the binary packages.
# Possible values: gzip, bzip2 or xz. Default xz.

View File

@ -32,15 +32,15 @@
install_pkg_deps()
{
local curpkg="$1"
local curpkgname=$(xbps-pkgdb getpkgname $1)
local saved_prevpkg=$(xbps-pkgdb getpkgname $2)
local curpkgname=$(${XBPS_PKGDB_CMD} getpkgname $1)
local saved_prevpkg=$(${XBPS_PKGDB_CMD} getpkgname $2)
local j jver jname reqver
[ -z "$curpkg" ] && return 1
if [ -n "$prev_pkg" ]; then
curpkg=$prev_pkg
curpkgname=$(xbps-pkgdb getpkgname ${curpkg})
curpkgname=$(${XBPS_PKGDB_CMD} getpkgname ${curpkg})
fi
msg_normal "Installing $saved_prevpkg dependency: $curpkgname."
@ -50,9 +50,9 @@ install_pkg_deps()
if [ $? -eq 0 ]; then
msg_normal "Dependency $curpkgname requires:"
for j in ${build_depends}; do
jname=$(xbps-pkgdb getpkgname ${j})
jver=$($XBPS_REGPKGDB_CMD version ${jname})
reqver=$(xbps-pkgdb getpkgversion ${j})
jname=$(${XBPS_PKGDB_CMD} getpkgname ${j})
jver=$($XBPS_PKGDB_CMD version ${jname})
reqver=$(${XBPS_PKGDB_CMD} getpkgversion ${j})
check_installed_pkg $j
if [ $? -eq 0 ]; then
echo " $jname >= $reqver: found $jname-$jver."
@ -88,7 +88,7 @@ install_pkg_deps()
install_dependencies_pkg()
{
local pkg="$1"
local lpkgname=$(xbps-pkgdb getpkgname ${pkg})
local lpkgname=$(${XBPS_PKGDB_CMD} getpkgname ${pkg})
local i ipkgname iversion reqvers notinstalled_deps lver
[ -z "$pkg" ] && return 1
@ -103,9 +103,9 @@ install_dependencies_pkg()
msg_normal "Required build dependencies for $pkgname-$lver... "
for i in ${build_depends}; do
ipkgname=$(xbps-pkgdb getpkgname ${i})
iversion=$($XBPS_REGPKGDB_CMD version $ipkgname)
reqvers=$(xbps-pkgdb getpkgversion ${i})
ipkgname=$(${XBPS_PKGDB_CMD} getpkgname ${i})
iversion=$($XBPS_PKGDB_CMD version $ipkgname)
reqvers=$(${XBPS_PKGDB_CMD} getpkgversion ${i})
check_installed_pkg $i
if [ $? -eq 0 ]; then
echo " $ipkgname >= $reqvers: found $ipkgname-$iversion."
@ -122,7 +122,7 @@ install_dependencies_pkg()
check_installed_pkg $i
[ $? -eq 0 ] && continue
ipkgname=$(xbps-pkgdb getpkgname ${i})
ipkgname=$(${XBPS_PKGDB_CMD} getpkgname ${i})
run_template $ipkgname
check_build_depends_pkg
if [ $? -eq 1 ]; then
@ -137,7 +137,7 @@ install_dependencies_pkg()
install_builddeps_required_pkg()
{
local pkg="$1"
local pkgname=$(xbps-pkgdb getpkgname ${pkg})
local pkgname=$(${XBPS_PKGDB_CMD} getpkgname ${pkg})
local dep depname
[ -z "$pkg" ] && return 1
@ -148,7 +148,7 @@ install_builddeps_required_pkg()
check_installed_pkg $dep
if [ $? -ne 0 ]; then
msg_normal "Installing $pkgname dependency: $dep."
depname=$(xbps-pkgdb getpkgname ${dep})
depname=$(${XBPS_PKGDB_CMD} getpkgname ${dep})
install_pkg $depname
fi
done
@ -165,11 +165,11 @@ check_installed_pkg()
[ -z "$pkg" ] && return 2
pkgname=$(xbps-pkgdb getpkgname $pkg)
reqver=$(xbps-pkgdb getpkgversion $pkg)
pkgname=$(${XBPS_PKGDB_CMD} getpkgname $pkg)
reqver=$(${XBPS_PKGDB_CMD} getpkgversion $pkg)
run_template $pkgname
iver="$($XBPS_REGPKGDB_CMD version $pkgname)"
iver="$($XBPS_PKGDB_CMD version $pkgname)"
if [ -n "$iver" ]; then
xbps-cmpver $pkgname-$iver $pkgname-$reqver
[ $? -eq 0 -o $? -eq 1 ] && return 0

View File

@ -86,12 +86,18 @@ ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
_EOF
# Use OpenDNS servers.
cat > $XBPS_MASTERDIR/etc/resolv.conf <<_EOF
nameserver 208.67.222.222
nameserver 208.67.220.220
_EOF
cp -f /etc/resolv.conf $XBPS_MASTERDIR/etc
#
# Copy host shell, bash is prefered to avoid breakage in
# GNU autoconf scripts!
#
mkdir -p $XBPS_MASTERDIR/bin
if [ -x /bin/bash ]; then
cp -f /bin/bash $XBPS_MASTERDIR/bin/sh
elif [ -x /bin/sh ]; then
cp -f /bin/sh $XBPS_MASTERDIR/bin/sh
fi
touch $XBPS_MASTERDIR/.xbps_perms_done
}
@ -104,19 +110,37 @@ rebuild_ldso_cache()
echo " done."
}
create_busybox_links()
{
local busyboxdir=$XBPS_MASTERDIR/usr/lib/busybox-initramfs
local lbindir=$XBPS_MASTERDIR/usr/local/bin
[ -f $XBPS_MASTERDIR/.busybox_done ] && return 0
[ ! -d ${lbindir} ] && mkdir -p ${lbindir}
# Create other symlinks in /usr/local/bin
for f in $(find ${busyboxdir} -type l); do
cd ${lbindir} || return 1
[ "$(basename $f)" = "sh" ] && continue
ln -s ../../lib/busybox-initramfs/bin/busybox $(basename $f)
done
touch -f $XBPS_MASTERDIR/.busybox_done
}
install_xbps_utils()
{
local needed fetch_cmd
local xbps_prefix=$XBPS_MASTERDIR/usr/local
for f in bin cmpver digest pkgdb; do
if [ ! -x $xbps_prefix/sbin/xbps-${f} ]; then
if [ ! -x $xbps_prefix/sbin/xbps-${f}.static ]; then
needed=yes
fi
done
if [ -n "$needed" ]; then
cd ${XBPS_MASTERDIR}/bin && ln -s dash sh
echo "=> Installing the required XBPS utils."
chroot $XBPS_MASTERDIR sh -c \
"echo /usr/local/lib > /etc/ld.so.conf"
@ -128,7 +152,7 @@ install_xbps_utils()
cp -f $fetch_cmd $xbps_prefix/sbin
for f in bin cmpver digest pkgdb repo; do
cp -f $XBPS_INSTALLDIR/sbin/xbps-$f.static \
$xbps_prefix/sbin/xbps-$f
$xbps_prefix/sbin/
done
cp -f $XBPS_INSTALLDIR/sbin/xbps-src $xbps_prefix/sbin
if [ -z $XBPS_INSTALLDIR ]; then
@ -146,7 +170,7 @@ xbps_chroot_handler()
local action="$1"
local pkg="$2"
local only_destdir="$3"
local path="/usr/local/sbin:/bin::/sbin:/usr/bin:/usr/sbin:/usr/local/bin"
[ -z "$action" -o -z "$pkg" ] && return 1
[ "$action" != "configure" -a "$action" != "build" -a \
@ -154,6 +178,7 @@ xbps_chroot_handler()
mount_chroot_fs
install_xbps_utils
create_busybox_links
if [ ! -f $XBPS_MASTERDIR/.xbps_perms_done ]; then
echo -n "==> Preparing chroot on $XBPS_MASTERDIR... "
@ -162,12 +187,14 @@ xbps_chroot_handler()
fi
if [ "$action" = "chroot" ]; then
env in_chroot=yes LANG=C chroot $XBPS_MASTERDIR /bin/bash
env in_chroot=yes LANG=C PATH=$path \
chroot $XBPS_MASTERDIR /bin/sh
else
[ -n "$only_destdir" ] && \
local lenv="install_destdir_target=yes"
env in_chroot=yes LANG=C ${lenv} chroot $XBPS_MASTERDIR \
xbps-src $action $pkg
env in_chroot=yes LANG=C PATH=$path \
${lenv} chroot $XBPS_MASTERDIR \
/usr/local/sbin/xbps-src $action $pkg
fi
msg_normal "Exiting from the chroot on $XBPS_MASTERDIR."
umount_chroot_fs
@ -250,10 +277,10 @@ umount_chroot_fs()
[ -n "$base_chroot" ] && return 0
. $XBPS_SHUTILSDIR/builddep_funcs.sh
check_installed_pkg xbps-base-chroot-0.1
check_installed_pkg xbps-base-chroot-0.11
if [ $? -ne 0 ]; then
echo "The '$pkgname' package requires to be installed in a chroot."
echo "Please install the 'xbps-base-chroot' package and try again."
echo "Please install 'xbps-base-chroot>=0.11' and try again."
exit 1
fi

View File

@ -34,7 +34,7 @@ verify_sha256_cksum()
[ -z "$file" -o -z "$cksum" ] && return 1
filesum=$(xbps-digest.static $XBPS_SRCDISTDIR/$file)
filesum=$(${XBPS_DIGEST_CMD} $XBPS_SRCDISTDIR/$file)
if [ "$origsum" != "$filesum" ]; then
msg_error "SHA256 checksum doesn't match for $file."
fi
@ -47,7 +47,7 @@ fetch_update_cksum()
local tmpl="$XBPS_TEMPLATESDIR/$pkgname/template"
local upcmd=$(basename $XBPS_SRCDISTDIR/$1)
sed -i -e "s|checksum.*|checksum=$(xbps-digest.static ${upcmd})|" $tmpl
sed -i -e "s|checksum.*|checksum=$(${XBPS_DIGEST_CMD} ${upcmd})|" $tmpl
return $?
}

View File

@ -213,7 +213,7 @@ xbps_write_metadata_pkg_real()
echo "<key>file</key>" >> $TMPFPLIST
echo "<string>$j</string>" >> $TMPFPLIST
echo "<key>sha256</key>" >> $TMPFPLIST
echo "<string>$(xbps-digest.static $f)</string>" \
echo "<string>$(${XBPS_DIGEST_CMD} $f)</string>" \
>> $TMPFPLIST
echo "</dict>" >> $TMPFPLIST
done
@ -244,7 +244,7 @@ xbps_write_metadata_pkg_real()
echo "<key>file</key>" >> $TMPFPLIST
echo "<string>$f</string>" >> $TMPFPLIST
echo "<key>sha256</key>" >> $TMPFPLIST
echo "<string>$(xbps-digest.static ${i})</string>" \
echo "<string>$(${XBPS_DIGEST_CMD} ${i})</string>" \
>> $TMPFPLIST
echo "</dict>" >> $TMPFPLIST
done
@ -258,6 +258,8 @@ xbps_write_metadata_pkg_real()
# Write the props.plist file.
local TMPFPROPS=$(mktemp -t fprops.XXXXXXXXXX) || exit 1
local instsize=$(du -sk ${DESTDIR}|awk '{print $1}')
cat > $TMPFPROPS <<_EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
@ -270,7 +272,7 @@ xbps_write_metadata_pkg_real()
<key>architecture</key>
<string>$arch</string>
<key>installed_size</key>
<integer>$(du -sb ${DESTDIR}|awk '{print $1}')</integer>
<integer>$(($instsize * 1024))</integer>
<key>maintainer</key>
<string>$(echo $maintainer|sed -e 's|<|[|g;s|>|]|g')</string>
<key>short_desc</key>
@ -345,8 +347,8 @@ _EOF
mv -f $TMPFPLIST ${DESTDIR}/files.plist
mv -f $TMPFPROPS ${DESTDIR}/props.plist
$XBPS_REGPKGDB_CMD sanitize-plist ${DESTDIR}/files.plist
$XBPS_REGPKGDB_CMD sanitize-plist ${DESTDIR}/props.plist
$XBPS_PKGDB_CMD sanitize-plist ${DESTDIR}/files.plist
$XBPS_PKGDB_CMD sanitize-plist ${DESTDIR}/props.plist
chmod 644 ${DESTDIR}/files.plist ${DESTDIR}/props.plist
[ -f $metadir/flist ] && chmod 644 $metadir/flist

View File

@ -133,7 +133,7 @@ list_pkg_files()
[ -z $pkg ] && msg_error "unexistent package, aborting."
ver=$($XBPS_REGPKGDB_CMD version $pkg)
ver=$($XBPS_PKGDB_CMD version $pkg)
[ -z "$ver" ] && msg_error "$pkg is not installed."
cat $XBPS_PKGMETADIR/$pkg/flist
@ -160,7 +160,7 @@ remove_pkg()
fi
done
ver=$($XBPS_REGPKGDB_CMD version $pkg)
ver=$($XBPS_PKGDB_CMD version $pkg)
[ -z "$ver" ] && msg_error "$pkg is not installed."
. $XBPS_SHUTILSDIR/stow_funcs.sh

View File

@ -106,7 +106,7 @@ stow_pkg_real()
else
lver="${version}"
fi
$XBPS_REGPKGDB_CMD register $pkg $lver "$short_desc" || exit 1
$XBPS_PKGDB_CMD register $pkg $lver "$short_desc" || exit 1
return $?
}
@ -127,7 +127,7 @@ unstow_pkg()
run_template $pkg
ver=$($XBPS_REGPKGDB_CMD version $pkg)
ver=$($XBPS_PKGDB_CMD version $pkg)
if [ -z "$ver" ]; then
msg_error "$pkg is not installed."
fi
@ -165,6 +165,6 @@ unstow_pkg()
rm -rf $XBPS_PKGMETADIR/$pkg
# Unregister pkg from plist file.
$XBPS_REGPKGDB_CMD unregister $pkg $ver
$XBPS_PKGDB_CMD unregister $pkg $ver
return $?
}

View File

@ -107,8 +107,11 @@ set_defvars()
[ ! -d "$val" ] && msg_error "cannot find $i, aborting."
done
XBPS_REGPKGDB_CMD="xbps-pkgdb -r $XBPS_MASTERDIR"
XBPS_BIN_CMD="xbps-bin -r $XBPS_MASTERDIR"
export XBPS_PKGDB_CMD="xbps-pkgdb.static -r $XBPS_MASTERDIR"
export XBPS_BIN_CMD="xbps-bin.static -r $XBPS_MASTERDIR"
export XBPS_DIGEST_CMD="xbps-digest.static"
export XBPS_CMPVER_CMD="xbps-cmpver.static"
export XBPS_FETCH_CMD="xbps-fetch.static"
}
#
@ -148,7 +151,7 @@ check_config_vars()
fi
done
export PATH="$PATH:@@XBPS_INSTALL_PREFIX@@/sbin"
export PATH="@@XBPS_INSTALL_PREFIX@@/sbin:$PATH"
}
#
@ -217,7 +220,7 @@ build-pkg)
. $XBPS_SHUTILSDIR/tmpl_funcs.sh
if [ "$2" = "all" ]; then
for f in $($XBPS_BIN_CMD list|awk '{print $1}'); do
pkg=$(xbps-pkgdb getpkgname $f)
pkg=$(${XBPS_PKGDB_CMD} getpkgname $f)
setup_tmpl ${pkg}
if [ "$pkg" = "$sourcepkg" ]; then
xbps_make_binpkg ${pkg}