#!/bin/bash
###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2008 Michael Tremer & Christian Schmidt #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see . #
# #
###############################################################################
# Save packages, that were already compiled in this variable:
PACKAGES_DONE=
pkg_list_groups() {
grep ^GROUP $BASEDIR/lfs/* | awk '{ print $3 }' | sort | uniq
}
pkg_list_packages() {
echo "#### List of softwares used to build $NAME Version: $VERSION ####"
local package
for i in $BASEDIR/lfs/*; do
package=$(basename $i)
( unset NAME VERSION
eval $(pkg_info ${package})
[ "$NAME" = "" ] && exit
printf " * %-30s" ${NAME}-${VERSION}
echo "${SHORT}"
)
done
}
pkg_list_packages_wiki() {
echo "====== List of softwares used to build $NAME Version: $VERSION ======"
local package
for i in $BASEDIR/lfs/*; do
package=$(basename $i)
( unset NAME VERSION
eval $(pkg_info ${package})
[ "$NAME" = "" ] && exit
echo " * [[.:package:$package|${NAME}-${VERSION}]] - ${SHORT}"
)
done
}
pkg_info() {
cd $BASEDIR/lfs && $EXTRA_MAKE make -f $1 \
CONFIG_ROOT=$CONFIG_ROOT \
LINKER=$LINKER \
TOOLS_DIR=$TOOLS_DIR \
MACHINE="$MACHINE" \
MACHINE_REAL="$MACHINE_REAL" \
IFS_HOST="$IFS_HOST" \
IFS_TARGET="$IFS_TARGET" \
TARGET="$TARGET" \
LFS_BASEDIR=$BASEDIR \
LFS=$LFS \
INSTALLER_DIR=$INSTALLER_DIR \
PARALLELISMFLAGS=$PARALLELISMFLAGS \
KVER=$KVER \
STAGE=$STAGE \
STAGE_ORDER=$STAGE_ORDER \
info
}
pkg_info_wiki() {
(
unset NAME VERSION
eval $(pkg_info ${1})
[ "$NAME" = "" ] && exit
# Output everything in wiki format
echo "^ $NAME ^^"
echo "| Version: | $VERSION |"
echo "| Release: | $RELEASE |"
echo "| Group: | $GROUP |"
echo "| License: | $LICENSE |"
echo "| Maintainer: | $MAINTAINER |"
echo "| $DESC ||"
echo "| Website: | $URL |"
if [ "$DEBUG" = "yes" ]; then
echo "This is a debug-package."
fi
if [ "$EXTRA" = "yes" ]; then
echo "This is an extra package."
fi
echo
for file in $(find $BASEDIR/src/rootfiles -name "$1" | xargs cat); do
echo " $file"
done
)
}
pkg_deps() {
(
unset NAME VERSION
eval $(pkg_info ${1})
echo $DEPS
)
}
pkg_files() {
(
unset NAME VERSION
eval $(pkg_info ${1})
for i in $FILES; do
echo $i
done
)
}