]> git.ipfire.org Git - ipfire-3.x.git/blob - tools/make-packages
Added new package: dosfstools.
[ipfire-3.x.git] / tools / make-packages
1 #!/bin/bash
2 ###############################################################################
3 # #
4 # IPFire.org - A linux based firewall #
5 # Copyright (C) 2008 Michael Tremer & Christian Schmidt #
6 # #
7 # This program is free software: you can redistribute it and/or modify #
8 # it under the terms of the GNU General Public License as published by #
9 # the Free Software Foundation, either version 3 of the License, or #
10 # (at your option) any later version. #
11 # #
12 # This program is distributed in the hope that it will be useful, #
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15 # GNU General Public License for more details. #
16 # #
17 # You should have received a copy of the GNU General Public License #
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
19 # #
20 ###############################################################################
21
22 # Save packages, that were already compiled in this variable:
23 PACKAGES_DONE=
24
25 pkg_list_groups() {
26 grep ^GROUP $BASEDIR/lfs/* | awk '{ print $3 }' | sort | uniq
27 }
28
29 pkg_list_packages() {
30 echo "#### List of softwares used to build $NAME Version: $VERSION ####"
31 local package
32 for i in $BASEDIR/lfs/*; do
33 package=$(basename $i)
34 ( unset NAME VERSION
35 eval $(pkg_info ${package})
36 [ "$NAME" = "" ] && exit
37 printf " * %-30s" ${NAME}-${VERSION}
38 echo "${SHORT}"
39 )
40 done
41 }
42
43 pkg_list_packages_wiki() {
44 echo "====== List of softwares used to build $NAME Version: $VERSION ======"
45 local package
46 for i in $BASEDIR/lfs/*; do
47 package=$(basename $i)
48 ( unset NAME VERSION
49 eval $(pkg_info ${package})
50 [ "$NAME" = "" ] && exit
51 echo " * [[.:package:$package|${NAME}-${VERSION}]] - ${SHORT}"
52 )
53 done
54 }
55
56 pkg_info() {
57 cd $BASEDIR/lfs && $EXTRA_MAKE make -f $1 \
58 CONFIG_ROOT=$CONFIG_ROOT \
59 LINKER=$LINKER \
60 TOOLS_DIR=$TOOLS_DIR \
61 MACHINE="$MACHINE" \
62 MACHINE_REAL="$MACHINE_REAL" \
63 IFS_HOST="$IFS_HOST" \
64 IFS_TARGET="$IFS_TARGET" \
65 TARGET="$TARGET" \
66 LFS_BASEDIR=$BASEDIR \
67 LFS=$LFS \
68 INSTALLER_DIR=$INSTALLER_DIR \
69 PARALLELISMFLAGS=$PARALLELISMFLAGS \
70 KVER=$KVER \
71 STAGE=$STAGE \
72 STAGE_ORDER=$STAGE_ORDER \
73 info
74 }
75
76 pkg_info_wiki() {
77 (
78 unset NAME VERSION
79 eval $(pkg_info ${1})
80
81 [ "$NAME" = "" ] && exit
82
83 # Output everything in wiki format
84 echo "^ $NAME ^^"
85 echo "| Version: | $VERSION |"
86 echo "| Release: | $RELEASE |"
87 echo "| Group: | $GROUP |"
88 echo "| License: | $LICENSE |"
89 echo "| Maintainer: | $MAINTAINER |"
90 echo "| $DESC ||"
91 echo "| Website: | $URL |"
92 if [ "$DEBUG" = "yes" ]; then
93 echo "<color red>This is a debug-package.</color>"
94 fi
95 if [ "$EXTRA" = "yes" ]; then
96 echo "<color green>This is an extra package.</color>"
97 fi
98 echo
99 for file in $(find $BASEDIR/src/rootfiles -name "$1" | xargs cat); do
100 echo " $file"
101 done
102 )
103 }
104
105 pkg_deps() {
106 (
107 unset NAME VERSION
108 eval $(pkg_info ${1})
109 echo $DEPS
110 )
111 }
112
113 pkg_files() {
114 (
115 unset NAME VERSION
116 eval $(pkg_info ${1})
117 for i in $FILES; do
118 echo $i
119 done
120 )
121 }