[PC-BSD Commits] r3151 - pbibuild/pbibuilder/scripts
svn at pcbsd.org
svn at pcbsd.org
Mon Dec 29 12:49:53 PST 2008
Author: kris
Date: 2008-12-29 12:49:51 -0800 (Mon, 29 Dec 2008)
New Revision: 3151
Added:
pbibuild/pbibuilder/scripts/functions.sh
Modified:
pbibuild/pbibuilder/scripts/2.1.startmake.sh
pbibuild/pbibuilder/scripts/3.makepbi.sh
Log:
Updated the pbibuilder to PBIv2 Schema. Now ports -> PBI's will all be built with their own LOCALBASE
which keeps them nice and tidy in /Programs/<ProgName> and doesn't require a large number of links to /usr/local/ for operation. I will start updating our modules in SVN to take use this new format here soon, and rebuild them.
Modified: pbibuild/pbibuilder/scripts/2.1.startmake.sh
===================================================================
--- pbibuild/pbibuilder/scripts/2.1.startmake.sh 2008-12-29 18:54:33 UTC (rev 3150)
+++ pbibuild/pbibuilder/scripts/2.1.startmake.sh 2008-12-29 20:49:51 UTC (rev 3151)
@@ -13,6 +13,7 @@
exit 1
fi
+
if [ -z ${1} ]
then
echo "ERROR: Failed to specify which module to build..."
@@ -21,6 +22,10 @@
module="${1}"
+
+# Source our functions
+. ${PROGDIR}/scripts/functions.sh
+
PDESTDIR="${PROGDIR}/pbisandbox" ; export PDESTDIR
PBIDIR="/pbi" ; export PBIDIR
MODULEDIR="${PROGDIR}/modules/${module}" ; export MODULEDIR
@@ -33,6 +38,12 @@
if [ -e "${module}/pbi.conf" ]
then
+# Unset the PBIVERSION
+PBIVERSION="" ; export PBIVERSION
+INMATEVER="" ; export INMATEVER
+BUILDINMATE="" ; export BUILDINMATE
+PBILOCALBASE=""; export PBILOCALBASE
+
. ${module}/pbi.conf
else
@@ -91,11 +102,54 @@
fi
+if [ "$BUILDINMATE" = "YES" ]
+then
+ echo "BATCH=yes
+${MAKEOPTS}" >${PDESTDIR}/etc/make.conf
+ echo "#!/bin/sh
+ PATH="${PATH}:/usr/local/kde4/bin"
+ export PATH
+ LD_LIBRARY_PATH="/usr/local/lib/qt4:/usr/local/kde4/lib"
+ export LD_LIBRARY_PATH
+ " >${PDESTDIR}/source.sh
+
+else
+# We are running a regular PBI make
+
+# Run our function to find the port version
+find_port_ver
+
+# Check if we were given a custom LOCALBASE and use it if so
+if [ -z "${PBILOCALBASE}" ]
+then
+ PBILOCALBASE="/Programs/${PROGNAME}${PORTVER}"
+fi
+
# Save the PBIs make options
-echo "BATCH=yes
+ echo "BATCH=yes
+X11BASE=${PBILOCALBASE}
+LOCALBASE=${PBILOCALBASE}
${MAKEOPTS}" >${PDESTDIR}/etc/make.conf
+ rm -rf ${PDESTDIR}/usr/local
+ mkdir -p ${PDESTDIR}/${PBILOCALBASE}
+
+ echo "#!/bin/sh
+PATH=\"${PATH}:${PBILOCALBASE}/bin:${PBILOCALBASE}/sbin:${PBILOCALBASE}/kde4/bin\"
+export PATH
+
+LD_LIBRARY_PATH=\"${PBILOCALBASE}/lib:${PBILOCALBASE}/lib/qt4:${PBILOCALBASE}/kde4/lib\"
+export LD_LIBRARY_PATH
+FORCE_PKG_REGISTER=\"Y\"
+export FORCE_PKG_REGISTER" >${PDESTDIR}/source.sh
+
+fi
+
+# Touch our source.sh script to make sure it exists
+touch ${PDESTDIR}/source.sh
+chmod 755 ${PDESTDIR}/source.sh
+
cp /etc/resolv.conf ${PDESTDIR}/etc/resolv.conf
echo "Rebuilding module ${module}..."
@@ -107,21 +161,62 @@
echo "Found preportmake.sh, running it..." >>${BLOG}
cp ${MODULEDIR}/preportmake.sh ${PDESTDIR}/preportmake.sh
chmod 755 ${PDESTDIR}/preportmake.sh
- chroot ${PDESTDIR} /preportmake.sh >>${BLOG} 2>>${BLOG}
- echo "Finished preportmake.sh!"
fi
+
+############## Start of ppmake.sh
+ echo "#!/bin/sh
+mount -t devfs devfs /dev
+. /source.sh
+
+if [ "${PBILOCALBASE}" != "/usr/local" ]
+then
+ ln -s ${PBILOCALBASE} /usr/local
+fi
+
+echo $PATH
+echo $LD_LIBRARY_PATH
+
+/etc/rc.d/ldconfig start
+chmod 777 /tmp
+
+# Make gmake first
+cd /usr/ports/devel/gmake
+make install
+make clean
+rehash
+
+cd /usr/ports/lang/perl5.8
+make clean
+make
+make install
+rehash
+
+cd /
+if [ -e '/preportmake.sh' ]
+then
+ /preportmake.sh
+fi
+
+umount /dev" >${PDESTDIR}/ppmake.sh
+############## End of ppmake.sh
+
+chmod 755 ${PDESTDIR}/ppmake.sh
+chroot ${PDESTDIR} /ppmake.sh >>${BLOG} 2>>${BLOG}
+
echo "Running port build..."
-# Create the script which chroot will run
+
+####### Create the script which chroot will run
echo '#!/bin/sh
+
#unset some variables which may cause build problems
PROGNAME=""
PROGWEB=""
PROGLIBS=""
PROGAUTHOR=""
module=""
-FORCE_PKG_REGISTER="Y" ; export FORCE_PKG_REGISTER
+. /source.sh
mount -t devfs devfs /dev
@@ -134,13 +229,13 @@
ln -s /usr/local /usr/X11R6
# Make gmake first, since almost all progs require it
-#cd /usr/ports/devel/gmake
-#make clean
-#make install
+cd /usr/ports/devel/gmake
+make clean
+make install
-#cd /usr/ports/devel/qmake
-#make clean
-#make install
+cd /usr/ports/devel/qmake
+make clean
+make install
# Cd to the port and start the build
cd ${PBIPORT}
@@ -185,6 +280,7 @@
exit 0
'> ${PDESTDIR}/makeport.sh
+##################### End of script which makes ports
chmod 755 ${PDESTDIR}/makeport.sh
Modified: pbibuild/pbibuilder/scripts/3.makepbi.sh
===================================================================
--- pbibuild/pbibuilder/scripts/3.makepbi.sh 2008-12-29 18:54:33 UTC (rev 3150)
+++ pbibuild/pbibuilder/scripts/3.makepbi.sh 2008-12-29 20:49:51 UTC (rev 3151)
@@ -23,6 +23,9 @@
exit 2
fi
+# Source our functions
+. ${PROGDIR}/scripts/functions.sh
+
BUILDWORLD="${PROGDIR}/buildworld" ; export BUILDWORLD
PDESTDIR="${PROGDIR}/pbisandbox" ; export PDESTDIR
PBIDIR="/pbi" ; export PBIDIR
@@ -55,58 +58,9 @@
MODULEDIR="${PROGDIR}/modules/${module}" ; export MODULEDIR
BLOG="${OUTDIR}/build.log" ; export BLOG
+# Locate the port version for this program
+find_port_ver
-# Check if we have a custom version string key and try to set PORTVER
-if [ ! -z "${VERKEY}" ]
-then
- # Now try the supplied VERKEY strings
- PORTVER="`grep $VERKEY ${PDESTDIR}/${PBIPORT}/Makefile | tr -d '\t' | tr -d ' ' | cut -d '=' -f 2`"
-fi
-
-if [ -z "${PORTVER}" ]
-then
- # Get the port version number
- PORTVER="`grep DISTVERSION= ${PDESTDIR}/${PBIPORT}/Makefile | tr -d '\t' | tr -d ' ' | cut -d '=' -f 2`"
-fi
-
-if [ -z "${PORTVER}" ]
-then
-
- # Now try the PORTVERSION= line
- PORTVER="`grep PORTVERSION= ${PDESTDIR}/${PBIPORT}/Makefile | tr -d '\t' | tr -d ' ' | cut -d '=' -f 2`"
- if [ -z "$PORTVER" -o "${PORTVER}" = " " ]
- then
- PORTVER="`grep PORTVERSION= ${PDESTDIR}/${PBIPORT}/Makefile | cut -f 3`"
- fi
-
-fi
-
-if [ -z "${PORTVER}" ]
-then
- # Now try the DISTVERSION?= line
- PORTVER="`grep DISTVERSION?= ${PDESTDIR}/${PBIPORT}/Makefile | tr -d '\t' | tr -d ' ' | cut -d '=' -f 2`"
-fi
-
-
-# Check if we have a portrevision to use in version number
-cat ${PDESTDIR}/${PBIPORT}/Makefile | grep "PORTREVISION="
-if [ "$?" = "0" ]
-then
- PORTREV="`grep PORTREVISION= ${PDESTDIR}/${PBIPORT}/Makefile | tr -d '\t' | tr -d ' ' | cut -d '=' -f 2`"
- PORTVER="${PORTVER}_${PORTREV}" ; export PORTVER
-fi
-
-if [ ! -z "${PBIVERSION}" ]
-then
- echo "Using set PBIVERSION"
- PORTVER="${PBIVERSION}"
-fi
-
-echo "PORTREV ${PORTREV}
-PORTVER ${PORTVER}"
-
-export PORTVER
-
# Copy over the PBI module directory
echo "Copying over ${module}..." >>${BLOG}
rm -rf ${PDESTDIR}/module
@@ -121,7 +75,6 @@
-
# Create the script which chroot will run
echo '#!/bin/sh
@@ -226,8 +179,27 @@
sh /module/build.sh
fi
+## Make our autolibs directory and link it to lib
+mkdir ${PBIDIR}/lib 2>/dev/null >/dev/null
+mkdir ${PBIDIR}/etc 2>/dev/null >/dev/null
+cd ${PBIDIR}
+if [ -d "autolibs" ]
+then
+ cp -R autolibs/* lib/ >/dev/null >/dev/null
+ rm -rf autolibs
+fi
+ln -s lib autolibs >/dev/null >/dev/null
+## Check for some common types of setups, and copy necessary files
+if [ -d "/usr/local/kde4/lib/kde4" ]
+then
+ # Copy over the kde4 plugin / theme data
+ mkdir -p ${PBIDIR}/kde4/lib/kde4/plugins >/dev/null 2>/dev/null
+ cp -R /usr/local/kde4/lib/kde4/plugins/imageformats ${PBIDIR}/kde4/lib/kde4/plugins/
+ cp -R /usr/local/kde4/lib/kde4/plugins/styles ${PBIDIR}/kde4/lib/kde4/plugins/
+fi
+
# Now run creation of PBI file:
cd /PBC
./createpbi.sh /pbi.pbc /PBC
Property changes on: pbibuild/pbibuilder/scripts/functions.sh
___________________________________________________________________
Added: svn:executable
+ *
More information about the Commits
mailing list