xbps-src: infrastructure changes required for "nonfree" keyword in tmpls.

- The chroot target now execs masterdir/bin/xbps-shell to set up correct envvars.
- 2 pkgs are now in nonfree repo: adobe-flash-plugin and jre.
- Renamed some vars in xbps-src to be in uppercase, notably XBPS_MACHINE.
- make-repoidx target now creates the index for all "known" directories specified
  via XBPS_PACKAGESDIR: XBPS_MACHINE, noarch, and nonfree/XBPS_MACHINE.
This commit is contained in:
Juan RP 2011-11-08 11:56:17 +01:00
parent e5afc541f2
commit 5a2cc5b5bd
35 changed files with 173 additions and 146 deletions

View file

@ -52,7 +52,7 @@ do_build()
do_install() do_install()
{ {
if [ "$xbps_machine" = "x86_64" ]; then if [ "$XBPS_MACHINE" = "x86_64" ]; then
vmkdir usr/lib vmkdir usr/lib
cd ${DESTDIR}/usr && ln -s lib lib64 cd ${DESTDIR}/usr && ln -s lib lib64
cd ${wrksrc} cd ${wrksrc}

View file

@ -5,7 +5,7 @@ revision=1
# The EULA file # The EULA file
_eula="http://www.adobe.com/products/eulas/pdfs/PlatformClients_PC_WWEULA_Combined_20100108_1657.pdf" _eula="http://www.adobe.com/products/eulas/pdfs/PlatformClients_PC_WWEULA_Combined_20100108_1657.pdf"
_eulacksum=3cb0a5f4576be735abcff7189ed18eda17c70b762c3a78a3379b6f44395fbc10 _eulacksum=3cb0a5f4576be735abcff7189ed18eda17c70b762c3a78a3379b6f44395fbc10
if [ "$xbps_machine" = "x86_64" ]; then if [ "$XBPS_MACHINE" = "x86_64" ]; then
# There is no x86_64 version for 10.1beta yet. # There is no x86_64 version for 10.1beta yet.
_disttarball="http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_11_linux.x86_64.tar.gz" _disttarball="http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_11_linux.x86_64.tar.gz"
_distcksum=5756a4ac9811e0362da2b0c208a458b417883e9f9c3773c70e61c935609b64dc _distcksum=5756a4ac9811e0362da2b0c208a458b417883e9f9c3773c70e61c935609b64dc
@ -21,6 +21,7 @@ maintainer="Juan RP <xtraeme@gmail.com>"
long_desc=" long_desc="
This is the Adobe Flash Player plugin for Netscape compatible browsers." This is the Adobe Flash Player plugin for Netscape compatible browsers."
nonfree=yes # restricted use
gtk_iconcache_dirs="/usr/share/icons/hicolor" gtk_iconcache_dirs="/usr/share/icons/hicolor"
Add_dependency run libgcc Add_dependency run libgcc

View file

@ -42,7 +42,7 @@ do_build()
do_install() do_install()
{ {
if [ "$xbps_machine" = "x86_64" ]; then if [ "$XBPS_MACHINE" = "x86_64" ]; then
mkdir -p ${SRCPKGDESTDIR}/usr/lib mkdir -p ${SRCPKGDESTDIR}/usr/lib
cd ${SRCPKGDESTDIR}/usr && ln -s lib lib64 && cd ${wrksrc} cd ${SRCPKGDESTDIR}/usr && ln -s lib lib64 && cd ${wrksrc}
fi fi

View file

@ -35,7 +35,7 @@ do_install()
{ {
# Install bjam # Install bjam
_bindir="bin.linuxx86" _bindir="bin.linuxx86"
[ "${xbps_machine}" = "x86_64" ] && _bindir="bin.linuxx86_64" [ "${XBPS_MACHINE}" = "x86_64" ] && _bindir="bin.linuxx86_64"
install -m755 -d ${DESTDIR}/usr/bin install -m755 -d ${DESTDIR}/usr/bin
install -m755 ${wrksrc}/tools/jam/src/${_bindir}/bjam \ install -m755 ${wrksrc}/tools/jam/src/${_bindir}/bjam \
${DESTDIR}/usr/bin || return 1 ${DESTDIR}/usr/bin || return 1

View file

@ -56,10 +56,10 @@ if [ -n "$BOOTSTRAP_PKG_REBUILD" ]; then
Add_dependency build flex Add_dependency build flex
fi fi
if [ "${xbps_machine}" = "x86_64" ]; then if [ "${XBPS_MACHINE}" = "x86_64" ]; then
_triplet="${xbps_machine}-unknown-linux-gnu" _triplet="${XBPS_MACHINE}-unknown-linux-gnu"
else else
_triplet="${xbps_machine}-pc-linux-gnu" _triplet="${XBPS_MACHINE}-pc-linux-gnu"
fi fi
do_configure() do_configure()
@ -96,7 +96,7 @@ do_build()
do_install() do_install()
{ {
if [ "$xbps_machine" = "x86_64" ]; then if [ "$XBPS_MACHINE" = "x86_64" ]; then
vmkdir usr/lib vmkdir usr/lib
cd ${DESTDIR}/usr && ln -sf lib lib64 && cd ${wrksrc} cd ${DESTDIR}/usr && ln -sf lib lib64 && cd ${wrksrc}
fi fi

View file

@ -45,8 +45,8 @@ do_build()
# Build with -mno-tls-direct-seg-refs to avoid performance problems # Build with -mno-tls-direct-seg-refs to avoid performance problems
# with Xen on x86 32bit. # with Xen on x86 32bit.
if [ "${xbps_machine}" = "i686" ]; then if [ "${XBPS_MACHINE}" = "i686" ]; then
cflags="-mno-tls-direct-seg-refs -march=${xbps_machine%%-*}" cflags="-mno-tls-direct-seg-refs -march=${XBPS_MACHINE%%-*}"
cflags="$cflags -mtune=generic" cflags="$cflags -mtune=generic"
fi fi
cflags="$XBPS_CFLAGS $cflags" cflags="$XBPS_CFLAGS $cflags"
@ -85,7 +85,7 @@ do_install()
replace_interpreter bash ${DESTDIR}/usr/bin/ldd replace_interpreter bash ${DESTDIR}/usr/bin/ldd
# On x86_64, add dynamic linker's 32bit version to ldd. # On x86_64, add dynamic linker's 32bit version to ldd.
if [ "$xbps_machine" = "x86_64" ]; then if [ "$XBPS_MACHINE" = "x86_64" ]; then
rtldlist="/lib/ld-linux.so.2 /lib/ld-linux-x86-64.so.2" rtldlist="/lib/ld-linux.so.2 /lib/ld-linux-x86-64.so.2"
sed -i "s|^RTLDLIST.*$|RTLDLIST=\"$rtldlist\"|" \ sed -i "s|^RTLDLIST.*$|RTLDLIST=\"$rtldlist\"|" \
${DESTDIR}/usr/bin/ldd ${DESTDIR}/usr/bin/ldd

View file

@ -5,11 +5,11 @@ distfiles="ftp://ftp.gnu.org/gnu/gmp/gmp-${version}.tar.bz2"
build_style=gnu-configure build_style=gnu-configure
# Build with -fexceptions as suggested by ppl. # Build with -fexceptions as suggested by ppl.
CPPFLAGS="-fexceptions" CPPFLAGS="-fexceptions"
if [ "${xbps_machine}" = "i686" ]; then if [ "${XBPS_MACHINE}" = "i686" ]; then
configure_args="ABI=32" configure_args="ABI=32"
fi fi
configure_args="${configure_args} --enable-cxx --enable-mpbsd configure_args="${configure_args} --enable-cxx --enable-mpbsd
--build=${xbps_machine}-unknown-linux-gnu" --build=${XBPS_MACHINE}-unknown-linux-gnu"
short_desc="Library for arbitrary precision arithmetic" short_desc="Library for arbitrary precision arithmetic"
maintainer="Juan RP <xtraeme@gmail.com>" maintainer="Juan RP <xtraeme@gmail.com>"
checksum=a2a610f01fd3298dc08c87bf30498c2402590e1bcb227fc40b15ee6d280939fb checksum=a2a610f01fd3298dc08c87bf30498c2402590e1bcb227fc40b15ee6d280939fb

View file

@ -1,10 +1,11 @@
# Template file for 'oracle-jre' # Template file for 'oracle-jre'
pkgname=jre pkgname=jre
nonfree=yes
_extraversion=1.7.0 _extraversion=1.7.0
version=7 version=7
revision=4 revision=4
if [ "${xbps_machine}" = "x86_64" ]; then if [ "${XBPS_MACHINE}" = "x86_64" ]; then
distfiles="http://download.oracle.com/otn-pub/java/jdk/${version}/jre-${version}-linux-x64.tar.gz" distfiles="http://download.oracle.com/otn-pub/java/jdk/${version}/jre-${version}-linux-x64.tar.gz"
checksum=d829890d46295ab0cbfcbeb5c68ac7c90a5021689f7503c00b8bcf4bf9ea2f8d checksum=d829890d46295ab0cbfcbeb5c68ac7c90a5021689f7503c00b8bcf4bf9ea2f8d
else else
@ -89,7 +90,7 @@ do_install()
vmkdir usr/lib/mozilla/plugins vmkdir usr/lib/mozilla/plugins
if [ "${xbps_machine}" = "x86_64" ]; then if [ "${XBPS_MACHINE}" = "x86_64" ]; then
_arch=amd64 _arch=amd64
else else
_arch=i386 _arch=i386

View file

@ -39,7 +39,7 @@ do_configure()
# as modules (defconfig+allmodconfig). # as modules (defconfig+allmodconfig).
local arch local arch
if [ "$xbps_machine" != "x86_64" ]; then if [ "$XBPS_MACHINE" != "x86_64" ]; then
arch=i386 arch=i386
else else
arch=x86_64 arch=x86_64
@ -68,7 +68,7 @@ do_install()
{ {
local arch hdrdest local arch hdrdest
if [ "$xbps_machine" != "x86_64" ]; then if [ "$XBPS_MACHINE" != "x86_64" ]; then
arch=i386 arch=i386
else else
arch=x86_64 arch=x86_64

View file

@ -30,7 +30,7 @@ do_install()
{ {
vmkdir lib vmkdir lib
vmkdir usr/lib vmkdir usr/lib
if [ "$xbps_machine" = "x86_64" ]; then if [ "$XBPS_MACHINE" = "x86_64" ]; then
ln -sf lib ${DESTDIR}/lib64 ln -sf lib ${DESTDIR}/lib64
fi fi
make DESTDIR=${DESTDIR} RAISE_SETFCAP=no install make DESTDIR=${DESTDIR} RAISE_SETFCAP=no install

View file

@ -18,7 +18,7 @@ long_desc="
nostrip=yes nostrip=yes
noverifyrdeps=yes noverifyrdeps=yes
if [ "${xbps_machine}" = "x86_64" ]; then if [ "${XBPS_MACHINE}" = "x86_64" ]; then
Add_dependency build gcc-multilib Add_dependency build gcc-multilib
fi fi

View file

@ -37,12 +37,12 @@ _mingwprefix=/opt
do_build() do_build()
{ {
if [ "${xbps_machine}" = "x86_64" ]; then if [ "${XBPS_MACHINE}" = "x86_64" ]; then
_mingwtriplet="${xbps_machine}-w64-mingw32" _mingwtriplet="${XBPS_MACHINE}-w64-mingw32"
_target_args="--enable-targets=${_mingwtriplet},i686-w64-mingw32" _target_args="--enable-targets=${_mingwtriplet},i686-w64-mingw32"
_multilib_args="--enable-multilib --enable-64-bit-bfd" _multilib_args="--enable-multilib --enable-64-bit-bfd"
else else
_mingwtriplet="${xbps_machine}-w64-mingw32" _mingwtriplet="${XBPS_MACHINE}-w64-mingw32"
_target_args="--enable-targets=${_mingwtriplet}" _target_args="--enable-targets=${_mingwtriplet}"
_multilib_args="--disable-multilib" _multilib_args="--disable-multilib"
fi fi
@ -67,14 +67,14 @@ do_install()
[ -d ${DESTDIR}/${_mingwprefix}/lib64 ] && \ [ -d ${DESTDIR}/${_mingwprefix}/lib64 ] && \
rm -rf ${DESTDIR}/${_mingwprefix}/lib64 rm -rf ${DESTDIR}/${_mingwprefix}/lib64
if [ "${xbps_machine}" = "x86_64" ]; then if [ "${XBPS_MACHINE}" = "x86_64" ]; then
_mingwtriplet="${xbps_machine}-w64-mingw32" _mingwtriplet="${XBPS_MACHINE}-w64-mingw32"
else else
_mingwtriplet="${xbps_machine}-w64-mingw32" _mingwtriplet="${XBPS_MACHINE}-w64-mingw32"
fi fi
# The mingw-w64 faq advises to create a symlink here # The mingw-w64 faq advises to create a symlink here
if [ "${xbps_machine}" = "x86_64" ]; then if [ "${XBPS_MACHINE}" = "x86_64" ]; then
cd ${DESTDIR}/${_mingwprefix}/${_mingwtriplet} && \ cd ${DESTDIR}/${_mingwprefix}/${_mingwtriplet} && \
ln -sf lib lib64 ln -sf lib lib64
fi fi

View file

@ -18,7 +18,7 @@ long_desc="
This is the mingw-64 cross-compiler, which supports building code for Win32 This is the mingw-64 cross-compiler, which supports building code for Win32
or Win64 (multilib). For the i686 platform, only 32bit is available." or Win64 (multilib). For the i686 platform, only 32bit is available."
if [ "${xbps_machine}" = "x86_64" ]; then if [ "${XBPS_MACHINE}" = "x86_64" ]; then
Add_dependency build gcc-multilib Add_dependency build gcc-multilib
fi fi
Add_dependency build flex Add_dependency build flex
@ -30,11 +30,11 @@ Add_dependency full mingw-w64-gcc
_mingwprefix=/opt _mingwprefix=/opt
if [ "${xbps_machine}" = "x86_64" ]; then if [ "${XBPS_MACHINE}" = "x86_64" ]; then
_mingwtriplet="${xbps_machine}-w64-mingw32" _mingwtriplet="${XBPS_MACHINE}-w64-mingw32"
_multilib_args="--enable-lib32 --enable-lib64" _multilib_args="--enable-lib32 --enable-lib64"
else else
_mingwtriplet="${xbps_machine}-w64-mingw32" _mingwtriplet="${XBPS_MACHINE}-w64-mingw32"
_multilib_args="--enable-lib32 --disable-lib64" _multilib_args="--enable-lib32 --disable-lib64"
fi fi

View file

@ -24,7 +24,7 @@ Add_dependency run mpc
Add_dependency run mpfr Add_dependency run mpfr
Add_dependency run zlib Add_dependency run zlib
if [ "${xbps_machine}" = "x86_64" ]; then if [ "${XBPS_MACHINE}" = "x86_64" ]; then
Add_dependency build gcc-multilib Add_dependency build gcc-multilib
fi fi
@ -36,14 +36,14 @@ Add_dependency full mingw-w64-headers
_mingwprefix=/opt _mingwprefix=/opt
if [ "${xbps_machine}" = "x86_64" ]; then if [ "${XBPS_MACHINE}" = "x86_64" ]; then
_triplet="${xbps_machine}-unknown-linux-gnu" _triplet="${XBPS_MACHINE}-unknown-linux-gnu"
_mingwtriplet="${xbps_machine}-w64-mingw32" _mingwtriplet="${XBPS_MACHINE}-w64-mingw32"
_multilib_args="--enable-targets=all --enable-multilib" _multilib_args="--enable-targets=all --enable-multilib"
_multilib_args="${_multilib_args} --enable-64bit --enable-32bit" _multilib_args="${_multilib_args} --enable-64bit --enable-32bit"
else else
_triplet="${xbps_machine}-pc-linux-gnu" _triplet="${XBPS_MACHINE}-pc-linux-gnu"
_mingwtriplet="${xbps_machine}-w64-mingw32" _mingwtriplet="${XBPS_MACHINE}-w64-mingw32"
_multilib_args="--disable-multilib --disable-64bit --enable-32bit" _multilib_args="--disable-multilib --disable-64bit --enable-32bit"
fi fi

View file

@ -33,12 +33,12 @@ build_wrksrc=${pkgname}
do_build() do_build()
{ {
if [ "${xbps_machine}" = "x86_64" ]; then if [ "${XBPS_MACHINE}" = "x86_64" ]; then
_mingwtriplet="${xbps_machine}-w64-mingw32" _mingwtriplet="${XBPS_MACHINE}-w64-mingw32"
_build_args="--build=${xbps_machine}-unknown-linux-gnu" _build_args="--build=${XBPS_MACHINE}-unknown-linux-gnu"
else else
_mingwtriplet="${xbps_machine}-w64-mingw32" _mingwtriplet="${XBPS_MACHINE}-w64-mingw32"
_build_args="--build=${xbps_machine}-pc-linux-gnu" _build_args="--build=${XBPS_MACHINE}-pc-linux-gnu"
fi fi
./configure --prefix=${_mingwprefix} --bindir=${_mingwprefix}/bin \ ./configure --prefix=${_mingwprefix} --bindir=${_mingwprefix}/bin \

View file

@ -24,7 +24,7 @@ Add_dependency run mpc
Add_dependency run mpfr Add_dependency run mpfr
Add_dependency run zlib Add_dependency run zlib
if [ "${xbps_machine}" = "x86_64" ]; then if [ "${XBPS_MACHINE}" = "x86_64" ]; then
Add_dependency build gcc-multilib Add_dependency build gcc-multilib
fi fi
Add_dependency build flex Add_dependency build flex
@ -37,14 +37,14 @@ Add_dependency full mingw-w64-crt
_mingwprefix=/opt _mingwprefix=/opt
if [ "${xbps_machine}" = "x86_64" ]; then if [ "${XBPS_MACHINE}" = "x86_64" ]; then
_triplet="${xbps_machine}-unknown-linux-gnu" _triplet="${XBPS_MACHINE}-unknown-linux-gnu"
_mingwtriplet="${xbps_machine}-w64-mingw32" _mingwtriplet="${XBPS_MACHINE}-w64-mingw32"
_multilib_args="--enable-targets=all --enable-multilib" _multilib_args="--enable-targets=all --enable-multilib"
_multilib_args="${_multilib_args} --enable-64bit --enable-32bit" _multilib_args="${_multilib_args} --enable-64bit --enable-32bit"
else else
_triplet="${xbps_machine}-pc-linux-gnu" _triplet="${XBPS_MACHINE}-pc-linux-gnu"
_mingwtriplet="${xbps_machine}-w64-mingw32" _mingwtriplet="${XBPS_MACHINE}-w64-mingw32"
_multilib_args="--disable-multilib --disable-64bit --enable-32bit" _multilib_args="--disable-multilib --disable-64bit --enable-32bit"
fi fi

View file

@ -4,7 +4,7 @@ version=4.8.9
distfiles="${MOZILLA_SITE}/nspr/releases/v${version}/src/${pkgname}-${version}.tar.gz" distfiles="${MOZILLA_SITE}/nspr/releases/v${version}/src/${pkgname}-${version}.tar.gz"
build_style=gnu-configure build_style=gnu-configure
configure_script="./mozilla/nsprpub/configure" configure_script="./mozilla/nsprpub/configure"
if [ "$xbps_machine" = "x86_64" ]; then if [ "$XBPS_MACHINE" = "x86_64" ]; then
_for64="--enable-64bit" _for64="--enable-64bit"
fi fi
configure_args="--libdir=/usr/lib --includedir=/usr/include/nspr configure_args="--libdir=/usr/lib --includedir=/usr/include/nspr

View file

@ -28,7 +28,7 @@ Add_dependency build sqlite-devel
do_build() do_build()
{ {
if [ "$xbps_machine" = "x86_64" ]; then if [ "$XBPS_MACHINE" = "x86_64" ]; then
_use64="USE_64=1" _use64="USE_64=1"
fi fi
for dir in coreconf dbm nss; do for dir in coreconf dbm nss; do

View file

@ -25,7 +25,7 @@ do_install()
{ {
local ARCH local ARCH
case "${xbps_machine}" in case "${XBPS_MACHINE}" in
i[56]86|x86_64) ARCH=x86;; i[56]86|x86_64) ARCH=x86;;
esac esac

View file

@ -18,7 +18,7 @@ Add_dependency build nasm
do_build() do_build()
{ {
if [ "$xbps_machine" = "x86_64" ]; then if [ "$XBPS_MACHINE" = "x86_64" ]; then
cp makefile.linux_amd64_asm makefile.machine cp makefile.linux_amd64_asm makefile.machine
else else
cp makefile.linux_x86_asm_gcc_4.X makefile.machine cp makefile.linux_x86_asm_gcc_4.X makefile.machine

View file

@ -20,7 +20,7 @@ long_desc="
one machine (e.g. an ARM board) on a different machine (e.g. your own PC). one machine (e.g. an ARM board) on a different machine (e.g. your own PC).
By using dynamic translation, it achieves very good performances." By using dynamic translation, it achieves very good performances."
conf_files="/etc/qemu/target-${xbps_machine}.conf" conf_files="/etc/qemu/target-${XBPS_MACHINE}.conf"
nostrip=yes nostrip=yes
Add_dependency run glibc Add_dependency run glibc

View file

@ -72,7 +72,7 @@ do_build() {
sed -i 's/-Werror//' makefile sed -i 's/-Werror//' makefile
sed -i 's/\(LDFLAGS = -Wl,--warn-common\)/\1 -Wl,-zmuldefs/' makefile sed -i 's/\(LDFLAGS = -Wl,--warn-common\)/\1 -Wl,-zmuldefs/' makefile
if [ "$xbps_machine" = "x86_64" ]; then if [ "$XBPS_MACHINE" = "x86_64" ]; then
makeargs="AMD64=1 PTR64=1" makeargs="AMD64=1 PTR64=1"
else else
makeargs="I686=1" makeargs="I686=1"

View file

@ -19,7 +19,7 @@ Add_dependency run glibc
do_build() do_build()
{ {
if [ "${xbps_machine}" = "x86_64" ]; then if [ "${XBPS_MACHINE}" = "x86_64" ]; then
local args="${configure_args} --enable-64bits" local args="${configure_args} --enable-64bits"
fi fi

View file

@ -68,7 +68,7 @@ Add_dependency build acpica-utils
Add_dependency build kernel-headers Add_dependency build kernel-headers
Add_dependency build dev86 Add_dependency build dev86
Add_dependency build yasm Add_dependency build yasm
if [ "${xbps_machine}" = "x86_64" ]; then if [ "${XBPS_MACHINE}" = "x86_64" ]; then
Add_dependency build gcc-c++-multilib Add_dependency build gcc-c++-multilib
fi fi

View file

@ -72,7 +72,7 @@ Add_dependency build acpica-utils
Add_dependency build wget Add_dependency build wget
Add_dependency build git Add_dependency build git
if [ "${xbps_machine}" = "x86_64" ]; then if [ "${XBPS_MACHINE}" = "x86_64" ]; then
Add_dependency build gcc-multilib Add_dependency build gcc-multilib
fi fi
@ -80,7 +80,7 @@ do_build()
{ {
install -d ${DESTDIR} install -d ${DESTDIR}
cd ${DESTDIR} && ln -sf . install cd ${DESTDIR} && ln -sf . install
if [ "${xbps_machine}" = "x86_64" ]; then if [ "${XBPS_MACHINE}" = "x86_64" ]; then
install -d ${DESTDIR}/usr/lib install -d ${DESTDIR}/usr/lib
cd ${DESTDIR}/usr && ln -s lib lib64 && cd ${wrksrc} cd ${DESTDIR}/usr && ln -s lib lib64 && cd ${wrksrc}
fi fi
@ -89,7 +89,7 @@ do_build()
do_install() do_install()
{ {
if [ "${xbps_machine}" = "x86_64" ]; then if [ "${XBPS_MACHINE}" = "x86_64" ]; then
install -d ${DESTDIR}/usr/lib install -d ${DESTDIR}/usr/lib
cd ${DESTDIR}/usr && ln -s lib lib64 && cd ${wrksrc} cd ${DESTDIR}/usr && ln -s lib lib64 && cd ${wrksrc}
fi fi

View file

@ -21,7 +21,7 @@ Add_dependency full xf86-video-ati ">=6.12.4"
#Add_dependency full xf86-video-chips ">=1.2.2" #Add_dependency full xf86-video-chips ">=1.2.2"
Add_dependency full xf86-video-cirrus ">=1.3.2" Add_dependency full xf86-video-cirrus ">=1.3.2"
Add_dependency full xf86-video-fbdev ">=0.4.1" Add_dependency full xf86-video-fbdev ">=0.4.1"
#if [ "${xbps_machine}" != "x86_64" ]; then #if [ "${XBPS_MACHINE}" != "x86_64" ]; then
# Add_dependency full xf86-video-geode ">=2.11.6" # Add_dependency full xf86-video-geode ">=2.11.6"
#fi #fi
#Add_dependency full xf86-video-glint ">=1.2.4" #Add_dependency full xf86-video-glint ">=1.2.4"

View file

@ -5,7 +5,7 @@ revision=4
distfiles="http://www.zlib.net/$pkgname-$version.tar.bz2" distfiles="http://www.zlib.net/$pkgname-$version.tar.bz2"
build_style=configure build_style=configure
configure_args="--prefix=/usr --shared" configure_args="--prefix=/usr --shared"
if [ "${xbps_machine}" = "x86_64" ]; then if [ "${XBPS_MACHINE}" = "x86_64" ]; then
configure_args="${configure_args} --64" configure_args="${configure_args} --64"
fi fi
make_build_args="CFLAGS=-fPIC" make_build_args="CFLAGS=-fPIC"

View file

@ -30,12 +30,11 @@
# #
install_pkg_from_repos() install_pkg_from_repos()
{ {
local cmd rval tmplogf tmpdepf xver local cmd rval tmplogf tmpdepf
msg_normal "$pkgver: installing '$1'... " msg_normal "$pkgver: installing '$1'... "
xver=$($XBPS_BIN_CMD -V|awk '{print $2}') case "${XBPS_VERSION}" in
case "$xver" in
0.1[1-9].[0-9]*) 0.1[1-9].[0-9]*)
_pkgdepname=$($XBPS_PKGDB_CMD getpkgdepname "$1") _pkgdepname=$($XBPS_PKGDB_CMD getpkgdepname "$1")
$XBPS_REPO_CMD -oversion show ${_pkgdepname} >/dev/null 2>&1 $XBPS_REPO_CMD -oversion show ${_pkgdepname} >/dev/null 2>&1
@ -50,7 +49,7 @@ install_pkg_from_repos()
*) msg_normal_append "\n";; *) msg_normal_append "\n";;
esac esac
cmd="${fakeroot_cmd} ${fakeroot_cmd_args} ${XBPS_BIN_CMD} -Ay install" cmd="${FAKEROOT_CMD} ${FAKEROOT_CMD_ARGS} ${XBPS_BIN_CMD} -Ay install"
tmplogf=$(mktemp) tmplogf=$(mktemp)
tmpdepf=$(mktemp) tmpdepf=$(mktemp)
echo "'${1}'" > $tmpdepf echo "'${1}'" > $tmpdepf
@ -82,7 +81,7 @@ autoremove_pkg_dependencies()
[ -n "$1" ] && return 0 [ -n "$1" ] && return 0
cmd="${fakeroot_cmd} ${fakeroot_cmd_args} ${XBPS_BIN_CMD}" cmd="${FAKEROOT_CMD} ${FAKEROOT_CMD_ARGS} ${XBPS_BIN_CMD}"
# If XBPS_PREFER_BINPKG_DEPS is set, we should remove those # If XBPS_PREFER_BINPKG_DEPS is set, we should remove those
# package dependencies installed by the target package, do it. # package dependencies installed by the target package, do it.
@ -105,9 +104,9 @@ autoremove_pkg_dependencies()
install_pkg_deps() install_pkg_deps()
{ {
local curpkg="$1" local curpkg="$1"
local curpkgname="$(${XBPS_PKGDB_CMD} getpkgdepname $1)" local curpkgname=$(${XBPS_PKGDB_CMD} getpkgdepname "$1")
local saved_prevpkg="$(${XBPS_PKGDB_CMD} getpkgdepname $2)" local saved_prevpkg=$(${XBPS_PKGDB_CMD} getpkgdepname "$2")
local j jver jname reqver missing_deps local j jver jname reqver
[ -z "$curpkg" -o -z "$curpkgname" ] && return 2 [ -z "$curpkg" -o -z "$curpkgname" ] && return 2
@ -137,16 +136,11 @@ install_pkg_deps()
echo " ${j}: found '$jname-$jver'." echo " ${j}: found '$jname-$jver'."
else else
echo " ${j}: not found." echo " ${j}: not found."
if [ -z "$missing_deps" ]; then
missing_deps="${j}"
else
missing_deps="${missing_deps} ${j}"
fi
fi fi
done done
fi fi
for j in ${missing_deps}; do for j in ${build_depends}; do
prev_pkg="$j" prev_pkg="$j"
if [ -n "$XBPS_PREFER_BINPKG_DEPS" -a -z "$bootstrap" ]; then if [ -n "$XBPS_PREFER_BINPKG_DEPS" -a -z "$bootstrap" ]; then
install_pkg_from_repos "${j}" install_pkg_from_repos "${j}"

View file

@ -26,7 +26,7 @@
_mount() _mount()
{ {
MASTERDIR="${XBPS_MASTERDIR}" DISTRIBUTIONDIR="${XBPS_DISTRIBUTIONDIR}" \ MASTERDIR="${XBPS_MASTERDIR}" DISTRIBUTIONDIR="${XBPS_DISTRIBUTIONDIR}" \
HOSTDIR="${XBPS_HOSTDIR}" ${sudo_cmd} \ HOSTDIR="${XBPS_HOSTDIR}" ${SUDO_CMD} \
@@XBPS_INSTALL_LIBEXECDIR@@/chroot-helper mount @@XBPS_INSTALL_LIBEXECDIR@@/chroot-helper mount
return $? return $?
} }
@ -34,7 +34,7 @@ _mount()
_umount() _umount()
{ {
MASTERDIR="${XBPS_MASTERDIR}" DISTRIBUTIONDIR="${XBPS_DISTRIBUTIONDIR}" \ MASTERDIR="${XBPS_MASTERDIR}" DISTRIBUTIONDIR="${XBPS_DISTRIBUTIONDIR}" \
HOSTDIR="${XBPS_HOSTDIR}" ${sudo_cmd} \ HOSTDIR="${XBPS_HOSTDIR}" ${SUDO_CMD} \
@@XBPS_INSTALL_LIBEXECDIR@@/chroot-helper umount @@XBPS_INSTALL_LIBEXECDIR@@/chroot-helper umount
return $? return $?
} }
@ -45,7 +45,7 @@ chroot_init()
[ -n "$bootstrap" ] && return 0 [ -n "$bootstrap" ] && return 0
if [ "${chroot_cmd}" = "chroot" ]; then if [ "${CHROOT_CMD}" = "chroot" ]; then
if [ "$(id -u)" -ne 0 ]; then if [ "$(id -u)" -ne 0 ]; then
msg_error "Root permissions are required for the chroot, try again." msg_error "Root permissions are required for the chroot, try again."
fi fi
@ -100,6 +100,20 @@ _EOF
[ -h ${XBPS_MASTERDIR}/tmp ] || rm -rf $XBPS_MASTERDIR/tmp/* [ -h ${XBPS_MASTERDIR}/tmp ] || rm -rf $XBPS_MASTERDIR/tmp/*
fi fi
fi fi
[ -s $XBPS_MASTERDIR/bin/xbps-shell ] && return 0
# Create custom script to start the chroot bash shell.
cat > $XBPS_MASTERDIR/bin/xbps-shell <<_EOF
#!/bin/sh
. /usr/local/etc/xbps-src.conf
. /usr/local/share/xbps-src/shutils/init_funcs.sh
set_defvars
exec env PS1="[\u@masterdir-chroot \W]$ " /bin/bash "$@"
_EOF
chmod 755 $XBPS_MASTERDIR/bin/xbps-shell
} }
prepare_chroot() prepare_chroot()
@ -198,10 +212,9 @@ create_binsh_symlink()
prepare_binpkg_repos() prepare_binpkg_repos()
{ {
local repo xver CONF_FILE local repo CONF_FILE
xver=$($XBPS_PKGDB_CMD -V|awk '{print $2}') case "${XBPS_VERSION}" in
case "$xver" in
0.1[0-9].[0-9]*) 0.1[0-9].[0-9]*)
mkdir -p ${XBPS_MASTERDIR}/usr/local/etc/xbps mkdir -p ${XBPS_MASTERDIR}/usr/local/etc/xbps
for f in /etc /usr/local/etc; do for f in /etc /usr/local/etc; do
@ -310,19 +323,18 @@ xbps_chroot_handler()
# Reinstall xbps-src in the chroot # Reinstall xbps-src in the chroot
msg_normal "Installing xbps-src in the masterdir...\n" msg_normal "Installing xbps-src in the masterdir...\n"
env IN_CHROOT=yes LANG=C PATH=$PATH:/usr/local/bin \ env IN_CHROOT=yes LANG=C \
${chroot_cmd} $XBPS_MASTERDIR sh -c \ ${CHROOT_CMD} $XBPS_MASTERDIR sh -c \
"cd /xbps/xbps-src && make IN_CHROOT=1 install clean" \ "cd /xbps/xbps-src && make IN_CHROOT=1 install clean" \
2>&1 >/dev/null || return $? 2>&1 >/dev/null || return $?
# Update ld.so(8) cache # Update ld.so(8) cache
msg_normal "Updating ld.so(8) cache...\n" msg_normal "Updating ld.so(8) cache...\n"
env PATH=$PATH:/usr/local/bin \ ${CHROOT_CMD} $XBPS_MASTERDIR sh -c "ldconfig" || return $?
${chroot_cmd} $XBPS_MASTERDIR sh -c "ldconfig" || return $?
if [ "$action" = "chroot" ]; then if [ "$action" = "chroot" ]; then
env IN_CHROOT=1 LANG=C PATH=$PATH:/usr/local/bin \ env IN_CHROOT=1 LANG=C \
${chroot_cmd} $XBPS_MASTERDIR /bin/sh || rv=$? ${CHROOT_CMD} $XBPS_MASTERDIR /bin/xbps-shell || rv=$?
else else
[ -n "$KEEP_WRKSRC" ] && arg="$arg -C" [ -n "$KEEP_WRKSRC" ] && arg="$arg -C"
[ -n "$KEEP_AUTODEPS" ] && arg="$arg -K" [ -n "$KEEP_AUTODEPS" ] && arg="$arg -K"
@ -331,8 +343,7 @@ xbps_chroot_handler()
action="$arg $action" action="$arg $action"
env in_chroot=1 IN_CHROOT=1 LANG=C _ORIGINPKG="$pkg" \ env in_chroot=1 IN_CHROOT=1 LANG=C _ORIGINPKG="$pkg" \
PATH=$PATH:/usr/local/bin \ ${CHROOT_CMD} $XBPS_MASTERDIR sh -c \
${chroot_cmd} $XBPS_MASTERDIR sh -c \
"xbps-src $action $pkg" || rv=$? "xbps-src $action $pkg" || rv=$?
fi fi

View file

@ -25,13 +25,11 @@
set_defvars() set_defvars()
{ {
local DDIRS i instsharedir local DDIRS i
instsharedir=@@XBPS_INSTALL_SHAREDIR@@ XBPS_HELPERSDIR=@@XBPS_INSTALL_SHAREDIR@@/helpers
XBPS_SHUTILSDIR=@@XBPS_INSTALL_SHAREDIR@@/shutils
XBPS_HELPERSDIR=$instsharedir/helpers XBPS_COMMONVARSDIR=@@XBPS_INSTALL_SHAREDIR@@/common
XBPS_SHUTILSDIR=$instsharedir/shutils
XBPS_COMMONVARSDIR=$instsharedir/common
XBPS_META_PATH=$XBPS_MASTERDIR/var/db/xbps XBPS_META_PATH=$XBPS_MASTERDIR/var/db/xbps
XBPS_PKGMETADIR=$XBPS_META_PATH/metadata XBPS_PKGMETADIR=$XBPS_META_PATH/metadata
XBPS_SRCPKGDIR=$XBPS_DISTRIBUTIONDIR/srcpkgs XBPS_SRCPKGDIR=$XBPS_DISTRIBUTIONDIR/srcpkgs
@ -70,8 +68,8 @@ set_defvars()
fi fi
done done
xver=$(xbps-bin.static -V|awk '{print $2}') export XBPS_VERSION=$(xbps-bin.static -V|awk '{print $2}')
case "${xver}" in case "${XBPS_VERSION}" in
0.1[0-9].[0-9]*) 0.1[0-9].[0-9]*)
xbps_conf="-C $XBPS_MASTERDIR/usr/local/etc/xbps" xbps_conf="-C $XBPS_MASTERDIR/usr/local/etc/xbps"
;; ;;

View file

@ -30,7 +30,7 @@ xbps_make_binpkg()
[ -z "$pkgname" ] && return 1 [ -z "$pkgname" ] && return 1
for subpkg in ${subpackages}; do for subpkg in ${subpackages}; do
unset revision noarch unset revision noarch nonfree
. $XBPS_SRCPKGDIR/$pkgname/$subpkg.template . $XBPS_SRCPKGDIR/$pkgname/$subpkg.template
pkgname=${subpkg} pkgname=${subpkg}
set_tmpl_common_vars set_tmpl_common_vars
@ -70,10 +70,14 @@ xbps_make_binpkg_real()
if [ -n "$noarch" ]; then if [ -n "$noarch" ]; then
arch=noarch arch=noarch
else else
arch=$xbps_machine arch=$XBPS_MACHINE
fi fi
binpkg=$pkgver.$arch.xbps binpkg=$pkgver.$arch.xbps
pkgdir=$XBPS_PACKAGESDIR/$arch if [ -n "$nonfree" ]; then
pkgdir=$XBPS_PACKAGESDIR/nonfree/$arch
else
pkgdir=$XBPS_PACKAGESDIR/$arch
fi
# #
# Don't overwrite existing binpkgs by default, skip them. # Don't overwrite existing binpkgs by default, skip them.
# #
@ -107,7 +111,7 @@ xbps_make_binpkg_real()
# Remove binpkg if interrupted... # Remove binpkg if interrupted...
trap "binpkg_cleanup $pkgdir $binpkg" INT trap "binpkg_cleanup $pkgdir $binpkg" INT
msg_normal "Building $binpkg... " msg_normal "Building $binpkg... "
${fakeroot_cmd} ${fakeroot_cmd_args} \ ${FAKEROOT_CMD} ${FAKEROOT_CMD_ARGS} \
tar --exclude "var/db/xbps/metadata/*/flist" \ tar --exclude "var/db/xbps/metadata/*/flist" \
-cpf - ${mfiles} ${dirs} | \ -cpf - ${mfiles} ${dirs} | \
$XBPS_COMPRESS_CMD ${clevel} -qf > $pkgdir/$binpkg $XBPS_COMPRESS_CMD ${clevel} -qf > $pkgdir/$binpkg

View file

@ -89,7 +89,7 @@ xbps_write_metadata_pkg_real()
if [ -n "$noarch" ]; then if [ -n "$noarch" ]; then
arch=noarch arch=noarch
else else
arch=$xbps_machine arch=$XBPS_MACHINE
fi fi
if [ -n "$revision" ]; then if [ -n "$revision" ]; then

View file

@ -26,6 +26,43 @@
# #
# Installs a pkg by reading its build template file. # Installs a pkg by reading its build template file.
# #
make_repoidx()
{
local f
case "${XBPS_VERSION}" in
# >= 0.11.0
[0-9].[1-9][1-9].[0-9])
for f in ${XBPS_MACHINE} noarch nonfree/${XBPS_MACHINE}; do
msg_normal "Updating pkg-index for local repository at:\n"
msg_normal " $XBPS_PACKAGESDIR/$f\n"
${XBPS_REPO_CMD} genindex ${XBPS_PACKAGESDIR}/${f} 2>/dev/null
done
;;
*)
msg_normal "Updating pkg-index for local repository at:\n"
msg_normal " $XBPS_PACKAGESDIR\n"
${XBPS_REPO_CMD} genindex ${XBPS_PACKAGESDIR} 2>/dev/null
;;
esac
}
_build_pkg_and_update_repos()
{
local rval f
[ -z "$BUILD_BINPKG" ] && return 0
# Build binary package and update local repo index if -B is set.
xbps_make_binpkg
if [ $? -ne 0 -a $? -ne 6 ]; then
return $?
fi
make_repoidx
return 0
}
install_pkg() install_pkg()
{ {
local curpkgn="$1" fullpkg pkg cdestdir local curpkgn="$1" fullpkg pkg cdestdir
@ -87,12 +124,12 @@ install_pkg()
fi fi
# Install pkg into destdir. # Install pkg into destdir.
env xbps_machine=${xbps_machine} MASTERDIR=${_MASTERDIR} \ env XBPS_MACHINE=${XBPS_MACHINE} wrksrc=${wrksrc} \
wrksrc=${wrksrc} \ MASTERDIR="${XBPS_MASTERDIR}" \
BOOTSTRAP_PKG_REBUILD=$BOOTSTRAP_PKG_REBUILD \ BOOTSTRAP_PKG_REBUILD=$BOOTSTRAP_PKG_REBUILD \
CONFIG_FILE=${XBPS_CONFIG_FILE} \ CONFIG_FILE=${XBPS_CONFIG_FILE} \
${fakeroot_cmd} ${fakeroot_cmd_args} \ ${FAKEROOT_CMD} ${FAKEROOT_CMD_ARGS} \
@@XBPS_INSTALL_LIBEXECDIR@@/doinst-helper \ @@XBPS_INSTALL_LIBEXECDIR@@/doinst-helper \
${curpkgn} || return $? ${curpkgn} || return $?
# Strip binaries/libraries. # Strip binaries/libraries.
@ -114,24 +151,8 @@ install_pkg()
remove_tmpl_wrksrc $wrksrc remove_tmpl_wrksrc $wrksrc
fi fi
autoremove_pkg_dependencies $KEEP_AUTODEPS autoremove_pkg_dependencies $KEEP_AUTODEPS
# Build binary package and update local repo index if _build_pkg_and_update_repos
# -B is set. return $?
if [ -n "$BUILD_BINPKG" ]; then
xbps_make_binpkg
rval=$?
if [ $rval -ne 0 -a $rval -ne 6 ]; then
return $?
elif [ $rval -eq 6 ]; then
# binpkg exists, no need to update
# repo pkg-index.
:
else
msg_normal "Updating pkg-index for local repository at:\n"
msg_normal " $XBPS_PACKAGESDIR\n"
${XBPS_REPO_CMD} genindex ${XBPS_PACKAGESDIR} 2>/dev/null
fi
fi
return 0
fi fi
# Stow package into masterdir. # Stow package into masterdir.

View file

@ -92,7 +92,7 @@ reset_tmpl_vars()
short_desc maintainer long_desc checksum wrksrc \ short_desc maintainer long_desc checksum wrksrc \
make_cmd bootstrap register_shell keep_empty_dirs \ make_cmd bootstrap register_shell keep_empty_dirs \
make_build_target configure_script noextract nofetch \ make_build_target configure_script noextract nofetch \
build_depends nostrip \ build_depends nostrip nonfree \
make_install_target version revision patch_args \ make_install_target version revision patch_args \
sgml_catalogs xml_catalogs xml_entries sgml_entries \ sgml_catalogs xml_catalogs xml_entries sgml_entries \
disable_parallel_build run_depends font_dirs preserve \ disable_parallel_build run_depends font_dirs preserve \
@ -263,7 +263,7 @@ prepare_tmpl()
done done
for i in ${only_for_archs}; do for i in ${only_for_archs}; do
[ "$i" = "$xbps_machine" ] && found=si && break [ "$i" = "$XBPS_MACHINE" ] && found=si && break
done done
if [ -n "${only_for_archs}" -a -z "$found" ]; then if [ -n "${only_for_archs}" -a -z "$found" ]; then
msg_error "this package is only for: ${only_for_archs}.\n" msg_error "this package is only for: ${only_for_archs}.\n"

View file

@ -26,12 +26,12 @@
XBPS_CONFIG_FILE=@@XBPS_INSTALL_ETCDIR@@/xbps-src.conf XBPS_CONFIG_FILE=@@XBPS_INSTALL_ETCDIR@@/xbps-src.conf
progname=$(basename $0) PROGNAME=$(basename $0)
fakeroot_cmd=/usr/bin/fakeroot FAKEROOT_CMD=/usr/bin/fakeroot
fakeroot_cmd_args="--" FAKEROOT_CMD_ARGS="--"
sudo_cmd=sudo SUDO_CMD=sudo
chroot_cmd=chroot CHROOT_CMD=chroot
xbps_machine=$(uname -m) XBPS_MACHINE=$(uname -m)
# Required utilities in host system. # Required utilities in host system.
REQHOST_UTILS="awk bash bison sed gcc msgfmt patch makeinfo \ REQHOST_UTILS="awk bash bison sed gcc msgfmt patch makeinfo \
@ -57,7 +57,7 @@ check_reqhost_utils()
usage() usage()
{ {
cat << _EOF cat << _EOF
$progname: [-BCDhKS] [-c file] [-m dir] [-p dir] [-s dir] [target] [pkgname] $PROGNAME: [-BCDhKS] [-c file] [-m dir] [-p dir] [-s dir] [target] [pkgname]
Targets: Targets:
bootstrap bootstrap
@ -222,7 +222,6 @@ check_config_vars()
echo "ERROR: not enough perms for masterdir $XBPS_MASTERDIR.\n" echo "ERROR: not enough perms for masterdir $XBPS_MASTERDIR.\n"
exit 1 exit 1
fi fi
[ -z "${_MASTERDIR_FLAG}" ] && export _MASTERDIR="$XBPS_MASTERDIR"
} }
# #
@ -246,7 +245,7 @@ while getopts "CBc:DhKm:p:Ss:" opt; do
p) p)
_PACKAGEDIR="$OPTARG" _PACKAGEDIR="$OPTARG"
if [ ! -d ${_PACKAGEDIR} ]; then if [ ! -d ${_PACKAGEDIR} ]; then
mkdir -p ${_PACKAGEDIR}/${xbps_machine} mkdir -p ${_PACKAGEDIR}/${XBPS_MACHINE}
mkdir -p ${_PACKAGEDIR}/noarch mkdir -p ${_PACKAGEDIR}/noarch
fi fi
;; ;;
@ -296,17 +295,17 @@ check_reqhost_utils
# Fix up some vars when XBPS_USE_CAPABILITIES is set. # Fix up some vars when XBPS_USE_CAPABILITIES is set.
# #
if [ -n "$XBPS_USE_CAPABILITIES" ]; then if [ -n "$XBPS_USE_CAPABILITIES" ]; then
chroot_cmd="@@XBPS_INSTALL_LIBEXECDIR@@/capchroot" CHROOT_CMD="@@XBPS_INSTALL_LIBEXECDIR@@/capchroot"
unset sudo_cmd unset SUDO_CMD
fi fi
if [ "$(id -u)" -eq 0 ]; then if [ "$(id -u)" -eq 0 ]; then
# disable sudo and fakeroot if uid==0 # disable sudo and fakeroot if uid==0
chroot_cmd="chroot" CHROOT_CMD="chroot"
unset sudo_cmd unset SUDO_CMD
if [ -n "$IN_CHROOT" ]; then if [ -n "$IN_CHROOT" ]; then
unset fakeroot_cmd unset FAKEROOT_CMD
unset fakeroot_cmd_args unset FAKEROOT_CMD_ARGS
fi fi
fi fi
@ -361,7 +360,7 @@ bootstrap-update)
if [ -z "$IN_CHROOT" ]; then if [ -z "$IN_CHROOT" ]; then
xbps_chroot_handler ${target} dummy xbps_chroot_handler ${target} dummy
else else
${fakeroot_cmd} ${fakeroot_cmd_args} ${XBPS_BIN_CMD} -y autoupdate ${FAKEROOT_CMD} ${FAKEROOT_CMD_ARGS} ${XBPS_BIN_CMD} -y autoupdate
fi fi
;; ;;
build|configure) build|configure)
@ -466,9 +465,7 @@ make-repoidx)
if [ -n "${_PACKAGEDIR}" ]; then if [ -n "${_PACKAGEDIR}" ]; then
export XBPS_PACKAGESDIR=${_PACKAGEDIR} export XBPS_PACKAGESDIR=${_PACKAGEDIR}
fi fi
msg_normal "Updating pkg-index for local repository at:\n" make_repoidx
msg_normal " $XBPS_PACKAGESDIR\n"
${XBPS_REPO_CMD} genindex ${XBPS_PACKAGESDIR} 2>/dev/null
;; ;;
remove) remove)
if [ -z "${_pkgname}" ]; then if [ -z "${_pkgname}" ]; then