5 # Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
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 2 of the License, or
10 # (at your option) any later version.
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.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
27 echo "makeworld version $version"
28 echo "usage: $0 [options] <destdir> <category> [category] ..."
30 echo " -b, --builddeps Build missing dependencies from source"
31 echo " -B, --noccache Do not use ccache during build"
32 echo " -c, --clean Clean up work files after build"
33 echo " -C, --cleancache Clean up source files from the cache"
34 echo " -d, --nodeps Skip all dependency checks"
35 echo " -e, --noextract Do not extract source files (use existing src/ dir)"
36 echo " -f, --force Overwrite existing packages"
37 echo " -i, --install Install package after successful build"
38 echo " -m, --nocolor Disable colorized output messages"
39 echo " -h, --help This help"
40 echo " -o, --nobuild Download and extract files only"
41 echo " -r, --rmdeps Remove installed dependencies after a successful build"
42 echo " -s, --syncdeps Install missing dependencies with pacman"
43 echo " -S, --usesudo Use sudo when running pacman commands"
45 echo "These options can be passed to pacman:"
47 echo " --noconfirm Do not ask for confirmation when resolving dependencies"
48 echo " --noprogressbar Do not show a progress bar when downloading files"
50 echo "Where <category> is one or more directory names under the ABS root"
51 echo "eg: makeworld -c /packages base lib editors"
53 echo "This should be run from the toplevel directory of ABS (usually /var/abs)"
65 --noconfirm) MAKEPKG_OPTS
="$MAKEPKG_OPTS --noconfirm" ;;
66 --noprogressbar) MAKEPKG_OPTS
="$MAKEPKG_OPTS --noprogressbar" ;;
68 --clean) MAKEPKG_OPTS
="$MAKEPKG_OPTS -c" ;;
69 --install) MAKEPKG_OPTS
="$MAKEPKG_OPTS -i" ;;
70 --syncdeps) MAKEPKG_OPTS
="$MAKEPKG_OPTS -s" ;;
71 --usesudo) MAKEPKG_OPTS
="$MAKEPKG_OPTS -S" ;;
72 --builddeps) MAKEPKG_OPTS
="$MAKEPKG_OPTS -b" ;;
73 --nodeps) MAKEPKG_OPTS
="$MAKEPKG_OPTS -d" ;;
74 --force) MAKEPKG_OPTS
="$MAKEPKG_OPTS -f" ;;
75 --rmdeps) MAKEPKG_OPTS
="$MAKEPKG_OPTS -r" ;;
76 --noccache) MAKEPKG_OPTS
="$MAKEPKG_OPTS -B" ;;
77 --cleancache) MAKEPKG_OPTS
="$MAKEPKG_OPTS -C" ;;
78 --noextract) MAKEPKG_OPTS
="$MAKEPKG_OPTS -e" ;;
79 --nobuild) MAKEPKG_OPTS
="$MAKEPKG_OPTS -o" ;;
80 --nocolor) MAKEPKG_OPTS
="$MAKEPKG_OPTS -m" ;;
90 while getopts "chisSbdfrBCemoS-" opt
; do
92 c
) MAKEPKG_OPTS
="$MAKEPKG_OPTS -c" ;;
93 i
) MAKEPKG_OPTS
="$MAKEPKG_OPTS -i" ;;
94 s
) MAKEPKG_OPTS
="$MAKEPKG_OPTS -s" ;;
95 b
) MAKEPKG_OPTS
="$MAKEPKG_OPTS -b" ;;
96 d
) MAKEPKG_OPTS
="$MAKEPKG_OPTS -d" ;;
97 f
) MAKEPKG_OPTS
="$MAKEPKG_OPTS -f" ;;
98 r
) MAKEPKG_OPTS
="$MAKEPKG_OPTS -r" ;;
99 B
) MAKEPKG_OPTS
="$MAKEPKG_OPTS -B" ;;
100 C
) MAKEPKG_OPTS
="$MAKEPKG_OPTS -C" ;;
101 e
) MAKEPKG_OPTS
="$MAKEPKG_OPTS -e" ;;
102 m
) MAKEPKG_OPTS
="$MAKEPKG_OPTS -m" ;;
103 o
) MAKEPKG_OPTS
="$MAKEPKG_OPTS -o" ;;
104 S
) MAKEPKG_OPTS
="$MAKEPKG_OPTS -S" ;;
123 if [ "$dest" != "" ]; then
128 if [ "$dest" = "" ]; then
133 # convert a (possibly) relative path to absolute
138 sd
=$
(date +"[%b %d %H:%M]")
140 for category
in $
*; do
141 for port
in $
(find $toplevel/$category -maxdepth 1 -mindepth 1 -type d |
sort); do
143 if [ -f PKGBUILD
]; then
146 if [ ! -f $dest/$pkgname-$pkgver-$pkgrel.pkg.
tar.gz
]; then
147 makepkg
$MAKEPKG_OPTS -m -w $dest 2>>$toplevel/makepkg.log
148 if [ $?
-gt 0 ]; then
154 d
=$
(date +"[%b %d %H:%M]")
155 echo -n "$d " >>$toplevel/build.log
157 0) echo "$pkgname already built -- skipping" >>$toplevel/build.log
;;
158 1) echo "$pkgname was built successfully" >>$toplevel/build.log
;;
159 2) echo "$pkgname build failed" >>$toplevel/build.log
;;
164 ed
=$
(date +"[%b %d %H:%M]")
166 echo "makeworld complete." >>$toplevel/build.log
167 echo " started: $sd" >>$toplevel/build.log
168 echo " finished: $ed" >>$toplevel/build.log
172 # vim: set ts=2 sw=2 noet: