--- embedaddon/build.sh 2011/06/20 09:28:05 1.1 +++ embedaddon/build.sh 2011/07/20 12:25:35 1.2 @@ -2,90 +2,105 @@ # # (C)`10 PKG-Builder for elwix by Michael Pounov # -# ./build.sh [package] [make_target] [os_specific_set] +# ./build.sh [package] [prefix_dir] [os_specific_set] [other_make_opts ...] # -# $Id: build.sh,v 1.1 2011/06/20 09:28:05 misho Exp $ +# $Id: build.sh,v 1.2 2011/07/20 12:25:35 misho Exp $ # -if [ -n "$3" ]; then - OS="$3" -else - OS=$(uname) -fi -echo ">>> Working OS ... ${OS}" +CMD=$1 +MK=${2:-make} +P=${3:-/tmp} +PFX="--prefix ${P}" +shift; shift; shift; +echo ">>> Working script ${MK} into ${PFX}" TOP=$(pwd) echo ">>> TOPDIR=${TOP}" -case $1 in +case $CMD in sudo) cd sudo - [ ! -r config.log ] && \ +# [ ! -r config.log ] && \ ./configure --sysconfdir=/etc --with-ignore-dot --with-tty-tickets \ --with-env-editor --with-logincap \ - --with-long-otp-prompt --with-pam --with-logfac=local2 - make $2 + --with-long-otp-prompt --with-pam --with-logfac=local2 ${PFX} + ${MK} clean + ${MK} + ${MK} install echo ">>> Now rebuild elwix firmware image ..." ;; ntpd) cd ntpd - make $2 + ${MK} clean + ${MK} + install ntpd ${P}/sbin echo ">>> Now rebuild elwix firmware image ..." ;; expat) cd expat - [ ! -r config.log ] && \ - ./configure - make $2 +# [ ! -r config.log ] && \ + ./configure ${PFX} + ${MK} clean + ${MK} + ${MK} install echo ">>> Now rebuild elwix firmware image ..." ;; mpd) cd libpdel - make $2 + ${MK} clean + ${MK} + find . -name \*.so\* -type f -exec install {} ${P}/lib \; cd .. cd mpd/src - [ ! -r config.log ] && \ - ./configure - make $2 + ${MK} clean + ${MK} + install mpd5 ${P}/sbin echo ">>> Now rebuild elwix firmware image ..." ;; libevent) cd libevent - [ ! -r config.log ] && \ - ./configure - make $2 +# [ ! -r config.log ] && \ + ./configure ${PFX} + ${MK} clean + ${MK} + ${MK} install echo ">>> Now rebuild elwix firmware image ..." ;; mini_sendmail) cd mini_sendmail - make $2 + ${MK} clean + ${MK} + install mini_sendmail ${P}/sbin echo ">>> Now rebuild elwix firmware image ..." ;; choparp) cd choparp - clang -o choparp -Wall -O2 choparp.c + rm -f choparp + ${MK} choparp + install choparp ${P}/sbin echo ">>> Now rebuild elwix firmware image ..." ;; ttcp) cd ttcp - clang -o ttcp -Wall -O2 ttcp.c + rm -f ttcp + ${MK} ttcp + install ttcp ${P}/bin echo ">>> Now rebuild elwix firmware image ..." ;; - pfflowd) - cd pfflowd - make $2 - echo ">>> Now rebuild elwix firmware image ..." - ;; ifstated) cd ifstated - make $2 + ${MK} clean + ${MK} + install ifstated ${P}/sbin echo ">>> Now rebuild elwix firmware image ..." ;; trafshow) cd trafshow - [ ! -r config.log ] && \ - ./configure --sysconfdir=/etc - make $2 +# [ ! -r config.log ] && \ + ./configure --sysconfdir=/etc ${PFX} + ${MK} clean + ${MK} + ${MK} install echo ">>> Now rebuild elwix firmware image ..." ;; ipsec-tools) @@ -93,235 +108,330 @@ case $1 in ./configure --enable-shared --sysconfdir=/etc/racoon --localstatedir=/var/db \ --enable-debug --enable-ipv6 --enable-adminport --enable-stats \ --enable-dpd --enable-natt=yes --enable-frag --enable-hybrid \ - --without-libpam --with-libradius - make $2 + --without-libpam --with-libradius ${PFX} + ${MK} clean + ${MK} + ${MK} install echo ">>> Now rebuild elwix firmware image ..." ;; dhcp) cd dhcp - [ ! -r config.log ] && \ - ./configure --localstatedir=/var --enable-paranoia --enable-early-chroot --enable-dhcpv6 - make $2 +# [ ! -r config.log ] && \ + ./configure --localstatedir=/var --enable-paranoia --enable-early-chroot \ + --enable-dhcpv6 ${PFX} + ${MK} clean + ${MK} + ${MK} install echo ">>> Now rebuild elwix firmware image ..." ;; dhcping) cd dhcping - [ ! -r config.log ] && \ - ./configure - make $2 +# [ ! -r config.log ] && \ + ./configure ${PFX} + ${MK} clean + ${MK} + ${MK} install echo ">>> Now rebuild elwix firmware image ..." ;; dhcdrop) cd dhcdrop - [ ! -r config.log ] && \ - ./configure - make $2 +# [ ! -r config.log ] && \ + ./configure ${PFX} + ${MK} clean + ${MK} + ${MK} install echo ">>> Now rebuild elwix firmware image ..." ;; mrouted) cd mrouted - make $2 + ${MK} clean + ${MK} + install map-mbone ${P}/sbin + install mrinfo ${P}/sbin + install mrouted ${P}/sbin + install mtrace ${P}/sbin echo ">>> Now rebuild elwix firmware image ..." ;; + igmpproxy) + cd igmpproxy + ./configure ${PFX} + ${MK} clean + ${MK} + ${MK} install +# [ ! -r config.log ] && \ + echo ">>> Now rebuild elwix firmware image ..." + ;; bmon) cd bmon - [ ! -r config.log ] && \ - ./configure --disable-rrd --disable-asound --disable-dbi - gmake $2 +# [ ! -r config.log ] && \ + ./configure --disable-rrd --disable-asound --disable-dbi ${PFX} + ${MK} clean + ${MK} + ${MK} install echo ">>> Now rebuild elwix firmware image ..." ;; iftop) cd iftop - [ ! -r config.log ] && \ - ./configure --with-resolver=netdb_1thread - make $2 +# [ ! -r config.log ] && \ + ./configure --with-resolver=netdb_1thread ${PFX} + ${MK} clean + ${MK} + ${MK} install echo ">>> Now rebuild elwix firmware image ..." ;; arping) echo ">>> Building libnet ..." cd libnet - [ ! -r config.log ] && \ - ./configure - make $2 +# [ ! -r config.log ] && \ + ./configure ${PFX} + ${MK} clean + ${MK} + ${MK} install echo ">>> Building arping ..." cd ../arping - [ ! -r config.log ] && \ - env LDFLAGS=-L${TOP}/libnet/src CFLAGS=-I${TOP}/libnet/include ./configure - make $2 +# [ ! -r config.log ] && \ + env LDFLAGS=-L${TOP}/libnet/src CFLAGS=-I${TOP}/libnet/include ./configure ${PFX} + ${MK} clean + ${MK} + ${MK} install echo ">>> Now rebuild elwix firmware image ..." ;; hping2) cd hping2 - [ ! -r config.log ] && \ - ./configure - gmake $2 +# [ ! -r config.log ] && \ + ./configure ${PFX} + ${MK} clean + ${MK} + install hping2 ${P}/sbin echo ">>> Now rebuild elwix firmware image ..." ;; mtr) cd mtr - [ ! -r config.log ] && \ - ./configure --enable-ipv6 --without-gtk - make $2 +# [ ! -r config.log ] && \ + ./configure --enable-ipv6 --without-gtk ${PFX} + ${MK} clean + ${MK} + ${MK} install echo ">>> Now rebuild elwix firmware image ..." ;; ipguard) cd ipguard - make $2 + ${MK} clean + ${MK} + install ipguard ${P}/sbin echo ">>> Now rebuild elwix firmware image ..." ;; ishell) cd ishell - make bsd $2 + ${MK} bsd clean + ${MK} bsd + install ish ${P}/bin + install ishd ${P}/sbin echo ">>> Now rebuild elwix firmware image ..." ;; miniupnpd) cd miniupnpd - make $2 + ${MK} clean + ${MK} + install miniupnpd ${P}/sbin + install miniupnpdctl ${P}/sbin echo ">>> Now rebuild elwix firmware image ..." ;; + miniupnpc) + cd miniupnpc + ${MK} clean + ${MK} + install libminiupnpc.so ${P}/lib + install external-ip.sh ${P}/bin + install upnpc-shared ${P}/bin/upnpc + echo ">>> Now rebuild elwix firmware image ..." + ;; strobe) cd strobe - make $2 + ${MK} clean + ${MK} + install strobe ${P}/bin echo ">>> Now rebuild elwix firmware image ..." ;; iperf) cd iperf - [ ! -r config.log ] && \ - ./configure +# [ ! -r config.log ] && \ + ./configure ${PFX} + ${MK} clean + ${MK} + ${MK} install echo ">>> Now rebuild elwix firmware image ..." ;; smartmontools) cd smartmontools - [ ! -r config.log ] && \ - ./configure --enable-sample --disable-dependency-tracking --enable-drivedb - make $2 +# [ ! -r config.log ] && \ + ./configure --enable-sample --disable-dependency-tracking --enable-drivedb ${PFX} + ${MK} clean + ${MK} + ${MK} install echo ">>> Now rebuild elwix firmware image ..." ;; conserver) cd conserver - [ ! -r config.log ] && \ +# [ ! -r config.log ] && \ ./configure --sysconfdir=/etc --with-master=localhost --with-port=782 \ - --with-pam --with-libwrap --with-openssl - make $2 + --with-pam --with-libwrap --with-openssl ${PFX} + ${MK} clean + ${MK} + ${MK} install echo ">>> Now rebuild elwix firmware image ..." ;; coova-chilli) cd coova-chilli - [ ! -r config.log ] && \ - ./configure --localstatedir=/var --sysconfdir=/etc - make $2 +# [ ! -r config.log ] && \ + ./configure --localstatedir=/var --sysconfdir=/etc ${PFX} + ${MK} clean + ${MK} + ${MK} install echo ">>> Now rebuild elwix firmware image ..." ;; lzo) cd lzo - [ ! -r config.log ] && \ - ./configure --enable-shared - make $2 +# [ ! -r config.log ] && \ + ./configure --enable-shared ${PFX} + ${MK} clean + ${MK} + ${MK} install echo ">>> Now rebuild elwix firmware image ..." ;; libgcrypt) cd libgpg-error - [ ! -r config.log ] && \ - ./configure - make $2 +# [ ! -r config.log ] && \ + ./configure ${PFX} + ${MK} clean + ${MK} + ${MK} install cd .. cd libgcrypt - [ ! -r config.log ] && \ - ./configure - make $2 +# [ ! -r config.log ] && \ + ./configure ${PFX} + ${MK} clean + ${MK} + ${MK} install echo ">>> Now rebuild elwix firmware image ..." ;; openvpn) cd openvpn - [ ! -r config.log ] && \ +# [ ! -r config.log ] && \ ./configure --enable-password-save --sysconfdir=/etc \ - --with-lzo-headers=../lzo/include --with-lzo-lib=../lzo/src/.libs - make $2 + --with-lzo-headers=../lzo/include --with-lzo-lib=../lzo/src/.libs ${PFX} + ${MK} clean + ${MK} + ${MK} install echo ">>> Now rebuild elwix firmware image ..." ;; libiconv) cd libiconv - [ ! -r config.log ] && \ - ./configure --enable-static --without-libintl-prefix - make $2 +# [ ! -r config.log ] && \ + ./configure --enable-static --without-libintl-prefix ${PFX} + ${MK} clean + ${MK} + ${MK} install echo ">>> Now rebuild elwix firmware image ..." ;; quagga) cd quagga - [ ! -r config.log ] && \ - ./configure --enable-user=quagga --enable-group=quagga --sysconfdir=/usr/local/etc/quagga --localstatedir=/var/run/quagga --enable-vtysh --enable-opaque-lsa --enable-rtadv - make $2 +# [ ! -r config.log ] && \ + ./configure --enable-user=quagga --enable-group=quagga \ + --sysconfdir=/etc/quagga --localstatedir=/var/run/quagga \ + --enable-vtysh --enable-opaque-lsa --enable-rtadv ${PFX} + ${MK} clean + ${MK} + ${MK} install echo ">>> Now rebuild elwix firmware image ..." ;; - sqlite) - cd sqlite - [ ! -r config.log ] && \ - ./configure --disable-tcl --enable-threadsafe --enable-load-extension --without-tcl - make $2 + sqlite3) + cd sqlite3 +# [ ! -r config.log ] && \ + ./configure --disable-tcl --enable-threadsafe --enable-load-extension --without-tcl ${PFX} + ${MK} clean + ${MK} + ${MK} install echo ">>> Now rebuild elwix firmware image ..." ;; - mysql-client) + mysql) cd mysql - [ ! -r config.log ] && \ +# [ ! -r config.log ] && \ ./configure --localstatedir=/var/db/mysql --without-debug --without-readline \ --without-libedit --with-libwrap --with-low-memory \ --enable-thread-safe-client --with-plugins=max-no-ndb --enable-assembler \ - --with-named-thread-libs=-pthread --without-server --with-unix-socket-path=/tmp/mysql.sock - make $2 + --with-named-thread-libs=-pthread --with-embedded-server \ + --with-unix-socket-path=/tmp/mysql.sock ${PFX} + ${MK} clean + ${MK} + ${MK} install echo ">>> Now rebuild elwix firmware image ..." ;; pwgen) cd pwgen - [ ! -r config.log ] && \ - ./configure - make $2 +# [ ! -r config.log ] && \ + ./configure ${PFX} + ${MK} clean + ${MK} + ${MK} install echo ">>> Now rebuild elwix firmware image ..." ;; curl) cd curl - [ ! -r config.log ] && \ +# [ ! -r config.log ] && \ ./configure --enable-pop3 --enable-smtp --enable-imap --enable-rtsp \ --disable-threaded-resolver --disable-werror --with-ssl=/usr \ --disable-ares --without-gnutls --enable-ipv6 --without-krb4 \ --disable-ldap --disable-ldaps --without-libidn --without-libssh2 \ - --without-librtmp --disable-curldebug --disable-ntlm --enable-proxy - make $2 + --without-librtmp --disable-curldebug --disable-ntlm --enable-proxy ${PFX} + ${MK} clean + ${MK} + ${MK} install echo ">>> Now rebuild elwix firmware image ..." ;; pcre) cd pcre - [ ! -r config.log ] && \ - ./configure --enable-utf8 --enable-unicode-properties - make $2 +# [ ! -r config.log ] && \ + ./configure --enable-utf8 --enable-unicode-properties ${PFX} + ${MK} clean + ${MK} + ${MK} install echo ">>> Now rebuild elwix firmware image ..." ;; spawn-fcgi) cd spawn-fcgi - [ ! -r config.log ] && \ - ./configure - make $2 +# [ ! -r config.log ] && \ + ./configure ${PFX} + ${MK} clean + ${MK} + ${MK} install echo ">>> Now rebuild elwix firmware image ..." ;; lighttpd) cd lighttpd - [ ! -r config.log ] && \ - ./configure --enable-static --with-openssl CC=cc CFLAGS="-O2 -pipe -I/usr/local/include \ - -fno-strict-aliasing" LDFLAGS="-L/usr/local/lib -rpath=/usr/lib:/usr/local/lib" CPPFLAGS= CPP=cpp - make $2 +# [ ! -r config.log ] && \ + ./configure --enable-static --with-openssl ${PFX} + ${MK} clean + ${MK} + ${MK} install echo ">>> Now rebuild elwix firmware image ..." ;; php) cd libxml2 - [ ! -r config.log ] && \ - ./configure --without-python - make $2 +# [ ! -r config.log ] && \ + ./configure --without-python ${PFX} + ${MK} clean + ${MK} + ${MK} install cd .. cd php - [ ! -r config.log ] && \ - ./configure --localstatedir=/var --with-config-file-scan-dir=/etc/php --disable-all \ - --enable-libxml=../libxml2/.libs --with-openssl --with-mysql=../mysql/libmysqlclient_r \ - --enable-zip --enable-sqlite-utf8 --with-mysql-sock=/tmp/mysql.sock - make $2 +# [ ! -r config.log ] && \ + ./configure --localstatedir=/tmp --with-config-file-scan-dir=/etc/php --disable-all \ + --enable-libxml=../libxml2/.libs --with-openssl \ + --enable-zip --enable-sqlite-utf8 ${PFX} + ${MK} clean + ${MK} + ${MK} install echo ">>> Now rebuild elwix firmware image ..." ;; *)