[PC-BSD Commits] r5536 - in pbibuild: pbibuilder7/pbicreator pbibuilder7/scripts pbibuilder8/pbicreator pbibuilder8/scripts

svn at pcbsd.org svn at pcbsd.org
Thu Dec 10 08:28:42 PST 2009


Author: kris
Date: 2009-12-10 08:28:42 -0800 (Thu, 10 Dec 2009)
New Revision: 5536

Modified:
   pbibuild/pbibuilder7/pbicreator/createpbi.sh
   pbibuild/pbibuilder7/scripts/3.makepbi.sh
   pbibuild/pbibuilder8/pbicreator/createpbi.sh
   pbibuild/pbibuilder8/scripts/3.makepbi.sh
Log:

Updated pbibuilder for 7.x / 8.x, added new knobs for auto-pruning some of the larger
files out of a PBI package, with the ability to keep them if needed



Modified: pbibuild/pbibuilder7/pbicreator/createpbi.sh
===================================================================
--- pbibuild/pbibuilder7/pbicreator/createpbi.sh	2009-12-10 15:38:02 UTC (rev 5535)
+++ pbibuild/pbibuilder7/pbicreator/createpbi.sh	2009-12-10 16:28:42 UTC (rev 5536)
@@ -45,9 +45,13 @@
 # Get the directory of the program
 PBILOC="`cat ${PBCFILE} | grep PackageDir | cut -d " " -f 2-5`" ; export PBILOC
 
-# Figure out if we need to prune the fonts / GL libs
+# Figure out if we need to prune the fonts / GL libs or others
 PBIUSESYSFONTS="`cat ${PBCFILE} | grep ProgUseSysFonts: | cut -d " " -f 2-5`" ; export PBIUSESYSFONTS
 PBIUSESYSGL="`cat ${PBCFILE} | grep ProgUseSysGL | cut -d " " -f 2-5`" ; export PBIUSESYSGL
+PBIPRUNEINCLUDE="`cat ${PBCFILE} | grep ProgPruneInclude | cut -d " " -f 2-5`" ; export PBIPRUNEINCLUDE
+PBIPRUNEPYTHON="`cat ${PBCFILE} | grep ProgPrunePython | cut -d " " -f 2-5`" ; export PBIPRUNEPYTHON
+PBIPRUNEPERL="`cat ${PBCFILE} | grep ProgPrunePerl | cut -d " " -f 2-5`" ; export PBIPRUNEPERL
+PBIPRUNEDOC="`cat ${PBCFILE} | grep ProgPruneDoc | cut -d " " -f 2-5`" ; export PBIPRUNEDOC
 
 # Now start creating the PkgConfig file from the data in the PBC file
 ############################################################################
@@ -76,16 +80,6 @@
 sed -e "s,PBIUpdate:,ProgUpdateURL:,g" ${WORKDIR}/PkgConfig > ${WORKDIR}/.pkgtmp
 mv ${WORKDIR}/.pkgtmp ${WORKDIR}/PkgConfig 
 
-# Calculate the size of the software we are packaging
-du -c -m $PBILOC >$WORKDIR/.duout
-
-tail -n 1 ${WORKDIR}/.duout | grep total 2>/dev/null
-if [ "$?" = "0" ]
-then
- PBISIZE="`tail -n 1 ${WORKDIR}/.duout | cut -f 1`"
- echo "ProgSize: $PBISIZE" >> ${WORKDIR}/PkgConfig
-fi
-
 # Figure out the PBI name for the /Programs/<progname> 
 cat ${PBCFILE} | grep '^ProgName:' | cut -d ' ' -f 2-10 >${WORKDIR}/.s1
 sed -e "s, ,,g" ${WORKDIR}/.s1 > ${WORKDIR}/.s2
@@ -232,10 +226,52 @@
   rm -rf ${PBILOC}/lib/X11/fonts >/dev/null 2>/dev/null
 fi
 
+# Do any additional pruning
+###############################################################################
 
+if [ "$PBIPRUNEINCLUDE" = "YES" ]
+then
+  rm -rf ${PBILOC}/include >/dev/null 2>/dev/null
+  rm -rf ${PBILOC}/kde4/include >/dev/null 2>/dev/null
+fi
+
+if [ "$PBIPRUNEPYTHON" = "YES" ]
+then
+  rm -rf ${PBILOC}/bin/python* >/dev/null 2>/dev/null
+  rm -rf ${PBILOC}/lib/python* >/dev/null 2>/dev/null
+  rm -rf ${PBILOC}/lib/libpython* >/dev/null 2>/dev/null
+  rm -rf ${PBILOC}/share/python* >/dev/null 2>/dev/null
+  rm -rf ${PBILOC}/share/examples/python* >/dev/null 2>/dev/null
+fi
+
+if [ "$PBIPRUNEPERL" = "YES" ]
+then
+  rm -rf ${PBILOC}/bin/perl* >/dev/null 2>/dev/null
+  rm -rf ${PBILOC}/lib/perl* >/dev/null 2>/dev/null
+fi
+
+if [ "$PBIPRUNEDOC" = "YES" ]
+then
+  rm -rf ${PBILOC}/man >/dev/null 2>/dev/null
+  rm -rf ${PBILOC}/info >/dev/null 2>/dev/null
+  rm -rf ${PBILOC}/share/doc >/dev/null 2>/dev/null
+  rm -rf ${PBILOC}/share/examples >/dev/null 2>/dev/null
+fi
+
 # Create the tarball now
 ###############################################################################
 
+# Calculate the size of the software we are packaging
+echo "Calculating the size of the archive..."
+du -c -m $PBILOC >$WORKDIR/.duout
+
+tail -n 1 ${WORKDIR}/.duout | grep total 2>/dev/null
+if [ "$?" = "0" ]
+then
+ PBISIZE="`tail -n 1 ${WORKDIR}/.duout | cut -f 1`"
+ echo "ProgSize: $PBISIZE" >> ${WORKDIR}/PkgConfig
+fi
+
 echo -e "Creating file archive...\t\c"
 
 # Copy the lzma binary to the workdir

Modified: pbibuild/pbibuilder7/scripts/3.makepbi.sh
===================================================================
--- pbibuild/pbibuilder7/scripts/3.makepbi.sh	2009-12-10 15:38:02 UTC (rev 5535)
+++ pbibuild/pbibuilder7/scripts/3.makepbi.sh	2009-12-10 16:28:42 UTC (rev 5536)
@@ -45,6 +45,10 @@
 PBIAUTOPOPULATE_PORTS="" ; export PBIAUTOPOPULATE_PORTS
 PBIDISABLEFONTLINK="" ; export PBIDISABLEFONTLINK
 PBIKEEPGL="" ; export PBIKEEPGL
+PBIPRUNEINCLUDE="" ; export PBIPRUNEINCLUDE
+PBIPRUNEPYTHON="" ; export PBIPRUNEPYTHON
+PBIPRUNEPERL="" ; export PBIPRUNEPERL
+PBIPRUNEDOC="" ; export PBIPRUNEDOC
 INMATEVER="" ; export INMATEVER
 BUILDINMATE="" ; export BUILDINMATE
 
@@ -212,6 +216,30 @@
   USESYSGL="YES"
 fi
 
+# Auto-prune include files
+if [ "${PBIPRUNEINCLUDE}" != "NO" ]
+then
+  PBIPRUNEINCLUDE="YES"
+fi
+
+# Auto-prune include files
+if [ "${PBIPRUNEPYTHON}" != "NO" ]
+then
+  PBIPRUNEPYTHON="YES"
+fi
+
+# Auto-prune include files
+if [ "${PBIPRUNEPERL}" != "NO" ]
+then
+  PBIPRUNEPERL="YES"
+fi
+
+# Auto-prune include files
+if [ "${PBIPRUNEDOC}" != "NO" ]
+then
+  PBIPRUNEDOC="YES"
+fi
+
 # Start the creation of the .pbc file
 echo "Starting build of pbc file..."
 echo "[ PBC 1.0 ]
@@ -221,6 +249,10 @@
 ProgAuthor: ${PROGAUTHOR}
 ProgUseSysFonts: ${USESYSFONTS}
 ProgUseSysGL: ${USESYSGL}
+ProgPruneInclude: ${PBIPRUNEINCLUDE}
+ProgPrunePython: ${PBIPRUNEPYTHON}
+ProgPrunePerl: ${PBIPRUNEPERL}
+ProgPruneDoc: ${PBIPRUNEDOC}
 PBIVer: 0
 PBIUpdate: ${PBIUPDATE}
 PackageDir: ${PBIDIR}/

Modified: pbibuild/pbibuilder8/pbicreator/createpbi.sh
===================================================================
--- pbibuild/pbibuilder8/pbicreator/createpbi.sh	2009-12-10 15:38:02 UTC (rev 5535)
+++ pbibuild/pbibuilder8/pbicreator/createpbi.sh	2009-12-10 16:28:42 UTC (rev 5536)
@@ -45,9 +45,13 @@
 # Get the directory of the program
 PBILOC="`cat ${PBCFILE} | grep PackageDir | cut -d " " -f 2-5`" ; export PBILOC
 
-# Figure out if we need to prune the fonts / GL libs
+# Figure out if we need to prune the fonts / GL libs or others
 PBIUSESYSFONTS="`cat ${PBCFILE} | grep ProgUseSysFonts: | cut -d " " -f 2-5`" ; export PBIUSESYSFONTS
 PBIUSESYSGL="`cat ${PBCFILE} | grep ProgUseSysGL | cut -d " " -f 2-5`" ; export PBIUSESYSGL
+PBIPRUNEINCLUDE="`cat ${PBCFILE} | grep ProgPruneInclude | cut -d " " -f 2-5`" ; export PBIPRUNEINCLUDE
+PBIPRUNEPYTHON="`cat ${PBCFILE} | grep ProgPrunePython | cut -d " " -f 2-5`" ; export PBIPRUNEPYTHON
+PBIPRUNEPERL="`cat ${PBCFILE} | grep ProgPrunePerl | cut -d " " -f 2-5`" ; export PBIPRUNEPERL
+PBIPRUNEDOC="`cat ${PBCFILE} | grep ProgPruneDoc | cut -d " " -f 2-5`" ; export PBIPRUNEDOC
 
 # Now start creating the PkgConfig file from the data in the PBC file
 ############################################################################
@@ -76,16 +80,6 @@
 sed -e "s,PBIUpdate:,ProgUpdateURL:,g" ${WORKDIR}/PkgConfig > ${WORKDIR}/.pkgtmp
 mv ${WORKDIR}/.pkgtmp ${WORKDIR}/PkgConfig 
 
-# Calculate the size of the software we are packaging
-du -c -m $PBILOC >$WORKDIR/.duout
-
-tail -n 1 ${WORKDIR}/.duout | grep total 2>/dev/null
-if [ "$?" = "0" ]
-then
- PBISIZE="`tail -n 1 ${WORKDIR}/.duout | cut -f 1`"
- echo "ProgSize: $PBISIZE" >> ${WORKDIR}/PkgConfig
-fi
-
 # Figure out the PBI name for the /Programs/<progname> 
 cat ${PBCFILE} | grep '^ProgName:' | cut -d ' ' -f 2-10 >${WORKDIR}/.s1
 sed -e "s, ,,g" ${WORKDIR}/.s1 > ${WORKDIR}/.s2
@@ -227,10 +221,52 @@
   rm -rf ${PBILOC}/lib/X11/fonts >/dev/null 2>/dev/null
 fi
 
+# Do any additional pruning
+###############################################################################
 
+if [ "$PBIPRUNEINCLUDE" = "YES" ]
+then
+  rm -rf ${PBILOC}/include >/dev/null 2>/dev/null
+  rm -rf ${PBILOC}/kde4/include >/dev/null 2>/dev/null
+fi
+
+if [ "$PBIPRUNEPYTHON" = "YES" ]
+then
+  rm -rf ${PBILOC}/bin/python* >/dev/null 2>/dev/null
+  rm -rf ${PBILOC}/lib/python* >/dev/null 2>/dev/null
+  rm -rf ${PBILOC}/lib/libpython* >/dev/null 2>/dev/null
+  rm -rf ${PBILOC}/share/python* >/dev/null 2>/dev/null
+  rm -rf ${PBILOC}/share/examples/python* >/dev/null 2>/dev/null
+fi
+
+if [ "$PBIPRUNEPERL" = "YES" ]
+then
+  rm -rf ${PBILOC}/bin/perl* >/dev/null 2>/dev/null
+  rm -rf ${PBILOC}/lib/perl* >/dev/null 2>/dev/null
+fi
+
+if [ "$PBIPRUNEDOC" = "YES" ]
+then
+  rm -rf ${PBILOC}/man >/dev/null 2>/dev/null
+  rm -rf ${PBILOC}/info >/dev/null 2>/dev/null
+  rm -rf ${PBILOC}/share/doc >/dev/null 2>/dev/null
+  rm -rf ${PBILOC}/share/examples >/dev/null 2>/dev/null
+fi
+
 # Create the tarball now
 ###############################################################################
 
+# Calculate the size of the software we are packaging
+echo "Calculating the size of the archive..."
+du -c -m $PBILOC >$WORKDIR/.duout
+
+tail -n 1 ${WORKDIR}/.duout | grep total 2>/dev/null
+if [ "$?" = "0" ]
+then
+ PBISIZE="`tail -n 1 ${WORKDIR}/.duout | cut -f 1`"
+ echo "ProgSize: $PBISIZE" >> ${WORKDIR}/PkgConfig
+fi
+
 echo -e "Creating file archive...\t\c"
 
 # Copy the lzma binary to the workdir

Modified: pbibuild/pbibuilder8/scripts/3.makepbi.sh
===================================================================
--- pbibuild/pbibuilder8/scripts/3.makepbi.sh	2009-12-10 15:38:02 UTC (rev 5535)
+++ pbibuild/pbibuilder8/scripts/3.makepbi.sh	2009-12-10 16:28:42 UTC (rev 5536)
@@ -45,6 +45,10 @@
 PBIAUTOPOPULATE_PORTS="" ; export PBIAUTOPOPULATE_PORTS
 PBIDISABLEFONTLINK="" ; export PBIDISABLEFONTLINK
 PBIKEEPGL="" ; export PBIKEEPGL
+PBIPRUNEINCLUDE="" ; export PBIPRUNEINCLUDE
+PBIPRUNEPYTHON="" ; export PBIPRUNEPYTHON
+PBIPRUNEPERL="" ; export PBIPRUNEPERL
+PBIPRUNEDOC="" ; export PBIPRUNEDOC
 INMATEVER="" ; export INMATEVER
 BUILDINMATE="" ; export BUILDINMATE
 
@@ -212,6 +216,30 @@
   USESYSGL="YES"
 fi
 
+# Auto-prune include files
+if [ "${PBIPRUNEINCLUDE}" != "NO" ]
+then
+  PBIPRUNEINCLUDE="YES"
+fi
+
+# Auto-prune include files
+if [ "${PBIPRUNEPYTHON}" != "NO" ]
+then
+  PBIPRUNEPYTHON="YES"
+fi
+
+# Auto-prune include files
+if [ "${PBIPRUNEPERL}" != "NO" ]
+then
+  PBIPRUNEPERL="YES"
+fi
+
+# Auto-prune include files
+if [ "${PBIPRUNEDOC}" != "NO" ]
+then
+  PBIPRUNEDOC="YES"
+fi
+
 # Start the creation of the .pbc file
 echo "Starting build of pbc file..."
 echo "[ PBC 1.0 ]
@@ -221,6 +249,10 @@
 ProgAuthor: ${PROGAUTHOR}
 ProgUseSysFonts: ${USESYSFONTS}
 ProgUseSysGL: ${USESYSGL}
+ProgPruneInclude: ${PBIPRUNEINCLUDE}
+ProgPrunePython: ${PBIPRUNEPYTHON}
+ProgPrunePerl: ${PBIPRUNEPERL}
+ProgPruneDoc: ${PBIPRUNEDOC}
 PBIVer: 0
 PBIUpdate: ${PBIUPDATE}
 PackageDir: ${PBIDIR}/



More information about the Commits mailing list