Annotation of elwix/build_3thparty.sh, revision 1.2.6.9

1.2       misho       1: #!/bin/sh
                      2: #
                      3: # ELWIX build script for cross compiling 3th party software
                      4: #
                      5: # (C) AITNET ltd - Sofia/Bulgaria <office@aitnet.org>
                      6: #    by Michael Pounov <misho@elwix.org>
                      7: #
1.2.6.9 ! misho       8: # $Id: build_3thparty.sh,v 1.2.6.8 2013/07/31 13:17:53 misho Exp $
1.2       misho       9: #
                     10: 
                     11: [ -r ./config/rc.elwix ] && . ./config/rc.elwix
                     12: if [ X"${ELWIX_IS_CONFIGURED}" != X"YES" ]; then
                     13:        echo
                     14:        echo "ELWIX project is not configured !?!"
                     15:        echo
                     16:        exit 1
                     17: fi
                     18: V=${VERSION}
                     19: [ -r ${CENV} ] && . ${CENV}
                     20: unset INSTALL
                     21: unset VERSION
                     22: VERSION="$V"
                     23: 
                     24: if [ ! -d $BSDSRC ]; then
                     25:        echo
                     26:        echo "ELWIX project is not configured - missing BSD sources !?!"
                     27:        echo
                     28:        exit 1
                     29: fi
                     30: 
                     31: if [ ! -d $DEST ]; then
                     32:        echo
                     33:        echo "ELWIX project is not configured - missing Dest directory !?!"
                     34:        echo
                     35:        exit 1
                     36: fi
                     37: 
                     38: clean_3th()
                     39: {
                     40:        echo "+++ Clean ELWIX 3th party ..."
                     41: 
1.2.6.9 ! misho      42:        rm -rf ${PKG} ${ROMFS_USR2}
        !            43: 
1.2       misho      44:        install -d ${PKG}
                     45:        install -d ${PKG}/bin
                     46:        install -d ${PKG}/etc
                     47:        install -d ${PKG}/include
                     48:        install -d ${PKG}/man
                     49:        install -d ${PKG}/lib
                     50:        install -d ${PKG}/libexec
                     51:        install -d ${PKG}/sbin
1.2.6.9 ! misho      52: 
        !            53:        install -d ${ROMFS_USR2}
        !            54:        install -d ${ROMFS_USR2}/bin
        !            55:        install -d ${ROMFS_USR2}/etc
        !            56:        install -d ${ROMFS_USR2}/lib
        !            57:        install -d ${ROMFS_USR2}/libexec
        !            58:        install -d ${ROMFS_USR2}/sbin
1.2       misho      59: }
                     60: 
                     61: compile_3th()
                     62: {
                     63:        echo "+++ Compile ELWIX 3th party ..."
                     64: 
                     65:        cd $CROSS_3TH
                     66:        ./build.sh expat ${CBUILD} ${PKG} ${TARGET_BUILD}
                     67:        [ $? -ne 0 ] && exit 1
                     68:        ./build.sh libevent ${CBUILD} ${PKG} ${TARGET_BUILD}
                     69:        [ $? -ne 0 ] && exit 1
                     70:        ./build.sh libiconv ${CGBUILD} ${PKG} ${TARGET_BUILD}
                     71:        [ $? -ne 0 ] && exit 1
                     72:        ./build.sh pcre ${CBUILD} ${PKG} ${TARGET_BUILD}
                     73:        [ $? -ne 0 ] && exit 1
                     74:        ./build.sh mini_sendmail ${CBUILD} ${PKG} ${TARGET_BUILD}
                     75:        [ $? -ne 0 ] && exit 1
                     76:        ./build.sh choparp ${CBUILD} ${PKG} ${TARGET_BUILD}
                     77:        [ $? -ne 0 ] && exit 1
                     78:        ./build.sh scan_ffs ${CBUILD} ${PKG} ${TARGET_BUILD}
                     79:        [ $? -ne 0 ] && exit 1
                     80:        ./build.sh istgt ${CBUILD} ${PKG} ${TARGET_BUILD}
                     81:        [ $? -ne 0 ] && exit 1
                     82:        ./build.sh rsync ${CBUILD} ${PKG} ${TARGET_BUILD}
                     83:        [ $? -ne 0 ] && exit 1
                     84:        ./build.sh ttcp ${CBUILD} ${PKG} ${TARGET_BUILD}
                     85:        [ $? -ne 0 ] && exit 1
                     86:        ./build.sh mpd ${CBUILD} ${PKG} ${TARGET_BUILD}
                     87:        [ $? -ne 0 ] && exit 1
                     88:        ./build.sh mrouted ${CGBUILD} ${PKG} ${TARGET_BUILD}
                     89:        [ $? -ne 0 ] && exit 1
                     90:        ./build.sh igmpproxy ${CBUILD} ${PKG} ${TARGET_BUILD}
                     91:        [ $? -ne 0 ] && exit 1
                     92:        ./build.sh sudo ${CBUILD} ${PKG} ${TARGET_BUILD}
                     93:        [ $? -ne 0 ] && exit 1
                     94:        ./build.sh bmon ${CGBUILD} ${PKG} ${TARGET_BUILD}
                     95:        [ $? -ne 0 ] && exit 1
                     96:        ./build.sh mtr ${CBUILD} ${PKG} ${TARGET_BUILD}
                     97:        [ $? -ne 0 ] && exit 1
                     98:        ./build.sh ipguard ${CBUILD} ${PKG} ${TARGET_BUILD}
                     99:        [ $? -ne 0 ] && exit 1
                    100:        ./build.sh smartmontools ${CBUILD} ${PKG} ${TARGET_BUILD}
                    101:        [ $? -ne 0 ] && exit 1
                    102:        ./build.sh quagga ${CBUILD} ${PKG} ${TARGET_BUILD}
                    103:        [ $? -ne 0 ] && exit 1
                    104:        ./build.sh iftop ${CBUILD} ${PKG} ${TARGET_BUILD}
                    105:        [ $? -ne 0 ] && exit 1
                    106:        ./build.sh arping ${CBUILD} ${PKG} ${TARGET_BUILD}
                    107:        [ $? -ne 0 ] && exit 1
                    108:        ./build.sh hping2 ${CGBUILD} ${PKG} ${TARGET_BUILD}
                    109:        [ $? -ne 0 ] && exit 1
                    110:        ./build.sh trafshow ${CBUILD} ${PKG} ${TARGET_BUILD}
                    111:        [ $? -ne 0 ] && exit 1
                    112:        ./build.sh ipsec-tools ${CBUILD} ${PKG} ${TARGET_BUILD}
                    113:        [ $? -ne 0 ] && exit 1
1.2.6.8   misho     114:        ./build.sh dhcp ${CBUILD} ${PKG} ${TARGET_BUILD}
1.2       misho     115:        [ $? -ne 0 ] && exit 1
1.2.6.8   misho     116:        ./build.sh dhcping ${CBUILD} ${PKG} ${TARGET_BUILD}
1.2.6.6   misho     117:        [ $? -ne 0 ] && exit 1
1.2.6.8   misho     118: #      ./build.sh dnsmasq ${CBUILD} ${PKG} ${TARGET_BUILD}
1.2.6.5   misho     119: #      [ $? -ne 0 ] && exit 1
1.2.6.8   misho     120:        ./build.sh miniupnpd ${CBUILD} ${PKG} ${TARGET_BUILD}
                    121:        [ $? -ne 0 ] && exit 1
                    122:        ./build.sh miniupnpc ${CGBUILD} ${PKG} ${TARGET_BUILD}
                    123:        [ $? -ne 0 ] && exit 1
1.2       misho     124:        ./build.sh ntp ${CBUILD} ${PKG} ${TARGET_BUILD}
                    125:        [ $? -ne 0 ] && exit 1
1.2.6.8   misho     126:        ./build.sh libxml2 ${CBUILD} ${PKG} ${TARGET_BUILD}
                    127:        [ $? -ne 0 ] && exit 1
                    128:        ./build.sh php ${CBUILD} ${PKG} ${TARGET_BUILD}
                    129:        [ $? -ne 0 ] && exit 1
1.2       misho     130:        cd -
                    131: }
                    132: 
1.2.6.9 ! misho     133: install_3th()
        !           134: {
        !           135:        LIBS="${ROMFS_USR2}/lib"
        !           136:        LIBEXEC="${ROMFS_USR2}/libexec"
        !           137:        BIN="${ROMFS_USR2}/bin"
        !           138:        SBIN="${ROMFS_USR2}/sbin"
        !           139:        ETC="${ROMFS_USR2}/etc"
        !           140: 
        !           141:        echo "+++ Install ELWIX RomFS secondary firmware ..."
        !           142: 
        !           143:        StripFiles \*.so\* ${PKG}/lib
        !           144:        InstallFiles \*.so\* ${PKG}/lib $LIBS
        !           145:        StripFiles \* ${PKG}/libexec
        !           146:        InstallFiles \* ${PKG}/libexec $LIBEXEC
        !           147:        StripFiles \* ${PKG}/bin
        !           148:        InstallFiles \* ${PKG}/bin $BIN
        !           149:        StripFiles \* ${PKG}/sbin
        !           150:        InstallFiles \* ${PKG}/sbin $SBIN
        !           151: 
        !           152:        InstallFiles \* ${PKG}/etc $ETC
        !           153: 
        !           154:        chown -R root:wheel $SBIN $BIN $LIBDATA $LIBEXEC $LIBS
        !           155: }
        !           156: 
        !           157: build_3th()
        !           158: {
        !           159:        echo "+++ Build ELWIX Firmware secondary image ..."
        !           160: 
        !           161:        cd ${ROMFS_USR2}
        !           162:        pax -w -z -v -f${REL}/${ROMFS_IMG2} .
        !           163:        cd -
        !           164: 
        !           165: # Stop using uzip fs
        !           166: #      makefs -ominfree=0,bsize=8192,fsize=1024,optimization=space -s${ROMFS_SIZE2} \
        !           167: #              ${REL}/${ROMFS_IMG2} ${ROMFS_USR2}
        !           168: 
        !           169: #      MDDEV=$(mdconfig -a -t vnode -f ${REL}/${ROMFS_IMG2});
        !           170: #      tunefs -L elwixFirmware2 /dev/$MDDEV;
        !           171: #      mdconfig -d -u $MDDEV;
        !           172: 
        !           173: #      mkuzip -s 8192 -o ${REL}/${ROMFS_IMG2}.uzip ${REL}/${ROMFS_IMG2};
        !           174: #      mv ${REL}/${ROMFS_IMG2}.uzip ${REL}/${ROMFS_IMG2}
        !           175: }
        !           176: 
1.2       misho     177: ### main()
                    178: if ! SnitVer ${PKG}/elwix.ver; then
1.2.6.3   misho     179:        clean_3th
1.2       misho     180:        compile_3th
1.2.6.1   misho     181: 
1.2.6.9 ! misho     182:        install_3th
        !           183:        build_3th
        !           184: 
1.2.6.1   misho     185:        echo "ELWIX Platform:${PLATFORM} Version:${VERSION} TargetArch:${TARGET_ARCH}" >${PKG}/elwix.ver
1.2       misho     186: else
                    187:        echo "Skipped ELWIX 3th party build ..."
                    188: fi
                    189: 
                    190: echo "+++ Complete build ELWIX 3th party"

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>