fi
}
-build_package() {
- local BUILD_SUCCESSFUL="no"
-
+make_work_dir() {
export PKG="$PKGMK_WORK_DIR/pkg"
export SRC="$PKGMK_WORK_DIR/src"
umask 022
cd $PKGMK_ROOT
- rm -rf $PKGMK_WORK_DIR
+ remove_work_dir
mkdir -p $SRC $PKG
-
+
if [ "$PKGMK_IGNORE_MD5SUM" = "no" ]; then
check_md5sum
fi
+}
+
+remove_work_dir() {
+ rm -rf $PKGMK_WORK_DIR
+}
+
+
+build_package() {
+ local BUILD_SUCCESSFUL="no"
+
+ make_work_dir
if [ "$UID" != "0" ]; then
warning "Packages should be built as root."
fi
if [ "$PKGMK_KEEP_WORK" = "no" ]; then
- rm -rf $PKGMK_WORK_DIR
+ remove_work_dir
fi
if [ "$BUILD_SUCCESSFUL" = "yes" ]; then
echo " -r, --recursive search for and build packages recursively"
echo " -d, --download download missing source file(s)"
echo " -do, --download-only do not build, only download missing source file(s)"
+ echo " -eo, --extract-only do not build, only extract source file(s)"
echo " -utd, --up-to-date do not build, only check if package is up to date"
echo " -uf, --update-footprint update footprint using result from last build"
echo " -if, --ignore-footprint build package without checking footprint"
-do|--download-only)
PKGMK_DOWNLOAD="yes"
PKGMK_DOWNLOAD_ONLY="yes" ;;
+ -eo|--extract-only)
+ PKGMK_EXTRACT_ONLY="yes" ;;
-utd|--up-to-date)
PKGMK_UP_TO_DATE="yes" ;;
-uf|--update-footprint)
exit 0
fi
+ if [ "$PKGMK_EXTRACT_ONLY" = "yes" ]; then
+ download_source
+ make_work_dir
+ info "Extracting sources of package '$name-$version'."
+ unpack_source
+ exit 0
+ fi
+
if [ "$PKGMK_UP_TO_DATE" = "yes" ]; then
if [ "`build_needed`" = "yes" ]; then
info "Package '$TARGET' is not up to date."
PKGMK_RECURSIVE="no"
PKGMK_DOWNLOAD="no"
PKGMK_DOWNLOAD_ONLY="no"
+PKGMK_EXTRACT_ONLY="no"
PKGMK_UP_TO_DATE="no"
PKGMK_UPDATE_FOOTPRINT="no"
PKGMK_IGNORE_FOOTPRINT="no"