When finished, make the script executable:
# chmod +x ~dru/pbi/lib.sh
As this script takes an executable as an argument, find out the names of your package's executables:
# pwd /home/dru/pbi/digikam/bin # file * | grep LSB dcraw: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), for FreeBSD 5.3-CURRENT (rev 5), dynamically linked (uses shared libs), stripped digikam: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), for FreeBSD 5.3-CURRENT (rev 5), dynamically linked (uses shared libs), stripped <snip 36 other executables)>
This particular package has 38 executables, so you need to run lib.sh that many times. Note that lib.sh makes a script that copies the libraries needed by that executable. As you create each script, run it and then remove it:
# ~dru/pbi/lib.sh dcraw Run the script dcraw_lib.sh to copy the required libraries # ./dcraw_lib.sh && rm dcraw_lib.sh # ~dru/pbi/lib.sh digikam Run the script dcraw_lib.sh to copy the required libraries # ./digikam_lib.sh && rm digikam_lib.sh <snip other 36 iterations>
When you finish, you'll have a populated lib/ directory:
# ls lib | wc 79 79 1055
Looks like there are 79 libraries.
Next, double-check whether your package has any lib/ subdirectories:
# ls -F ~dru/pbi/digikam/lib | grep "/" gphoto2/ gphoto2_port/ imlib2/ kde3/
If there are any, create those subdirectories in your bin/lib/ and copy the appropriate library files over:
# pwd /home/dru/pbi/digikam/bin/lib # mkdir gphoto2 gphoto2_port imlib2 kde3 # cp -R ~dru/pbi/digikam/lib/gphoto2/* gphoto2 # cp -R ~dru/pbi/digikam/lib/gphoto2_port/* gphoto2_port # cp -R ~dru/pbi/digikam/lib/imlib2/* imlib2 # cp -R ~dru/pbi/digikam/lib/kde3/* kde3
Step 5: Look for an Icon and Cleanup bin/
Adding an icon to your PBI is nice. Check whether one came with your package:
# grep -w icons ../+CONTENTS share/apps/digikam/icons/hicolor/32x32/actions/addimagefolder.png <snip large output>
This package definitely came with many icons, and this is the one I'm looking for:
# cp ../share/icons/crystalsvg/128x128/apps/digikam.png .
If your package doesn't have any icons, choose your favorite from a subdirectory of /usr/local/share/icons/crystalsvg/128x128/ and copy it to bin/.
When you finish, uninstall the package and its dependencies so they won't interfere when you test the PBI:
# pkg_delete -rx digikam
Finally, double-check bin/ to ensure that it contains only the tarball, the install and uninstall scripts, the binaries, and the lib/ directory.