Annotation of elwix/build_3thparty.sh, revision 1.6.2.2

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.6.2.2 ! misho       8: # $Id: build_3thparty.sh,v 1.6.2.1 2017/06/14 14:56:24 misho Exp $
1.2       misho       9: #
                     10: 
                     11: [ -r ./config/rc.elwix ] && . ./config/rc.elwix
1.5       misho      12: if [ ! -r ./config/rc.3thparty_helper ]; then
                     13:        echo
                     14:        echo "ELWIX project is not configured - Missing rc.3thparty_helper script"
                     15:        echo
                     16:        exit 1
                     17: fi
                     18: 
1.2       misho      19: if [ X"${ELWIX_IS_CONFIGURED}" != X"YES" ]; then
                     20:        echo
                     21:        echo "ELWIX project is not configured !?!"
                     22:        echo
                     23:        exit 1
                     24: fi
                     25: V=${VERSION}
                     26: [ -r ${CENV} ] && . ${CENV}
                     27: unset INSTALL
                     28: unset VERSION
                     29: VERSION="$V"
                     30: 
                     31: if [ ! -d $BSDSRC ]; then
                     32:        echo
                     33:        echo "ELWIX project is not configured - missing BSD sources !?!"
                     34:        echo
                     35:        exit 1
                     36: fi
                     37: 
                     38: if [ ! -d $DEST ]; then
                     39:        echo
                     40:        echo "ELWIX project is not configured - missing Dest directory !?!"
                     41:        echo
                     42:        exit 1
                     43: fi
                     44: 
                     45: clean_3th()
                     46: {
1.6       misho      47:        echo "+++ Clean ELWIX 3th party ... ${PKG}, ${ROMFS_USR2}"
1.2       misho      48: 
1.3       misho      49:        rm -rf ${PKG} ${ROMFS_USR2}
                     50: 
1.2       misho      51:        install -d ${PKG}
                     52:        install -d ${PKG}/bin
                     53:        install -d ${PKG}/etc
                     54:        install -d ${PKG}/include
                     55:        install -d ${PKG}/man
                     56:        install -d ${PKG}/lib
                     57:        install -d ${PKG}/libexec
                     58:        install -d ${PKG}/sbin
1.3       misho      59: 
                     60:        install -d ${ROMFS_USR2}
                     61:        install -d ${ROMFS_USR2}/bin
                     62:        install -d ${ROMFS_USR2}/etc
                     63:        install -d ${ROMFS_USR2}/lib
                     64:        install -d ${ROMFS_USR2}/libexec
                     65:        install -d ${ROMFS_USR2}/sbin
1.2       misho      66: }
                     67: 
                     68: compile_3th()
                     69: {
                     70:        echo "+++ Compile ELWIX 3th party ..."
                     71: 
1.5       misho      72:        BUILD_SH="./config/rc.3thparty_helper"
                     73: 
1.6       misho      74: #      ${BUILD_SH} expat ${CBUILD} ${PKG} ${TARGET_BUILD}
                     75: #      [ $? -ne 0 ] && exit 1
                     76: #      ${BUILD_SH} libevent ${CBUILD} ${PKG} ${TARGET_BUILD}
                     77: #      [ $? -ne 0 ] && exit 1
                     78: #      ${BUILD_SH} libiconv ${CGBUILD} ${PKG} ${TARGET_BUILD}
                     79: #      [ $? -ne 0 ] && exit 1
                     80: #      ${BUILD_SH} pcre ${CBUILD} ${PKG} ${TARGET_BUILD}
                     81: #      [ $? -ne 0 ] && exit 1
                     82: 
                     83:        ${BUILD_SH} mini_sendmail ${CBUILD} ${PKG} ${TARGET_BUILD}
1.2       misho      84:        [ $? -ne 0 ] && exit 1
1.6       misho      85:        ${BUILD_SH} choparp ${CBUILD} ${PKG} ${TARGET_BUILD}
1.2       misho      86:        [ $? -ne 0 ] && exit 1
1.6       misho      87:        ${BUILD_SH} libnet ${CBUILD} ${PKG} ${TARGET_BUILD}
1.2       misho      88:        [ $? -ne 0 ] && exit 1
1.6       misho      89:        ${BUILD_SH} arping ${CBUILD} ${PKG} ${TARGET_BUILD}
1.2       misho      90:        [ $? -ne 0 ] && exit 1
1.6       misho      91:        ${BUILD_SH} ipguard ${CBUILD} ${PKG} ${TARGET_BUILD}
1.2       misho      92:        [ $? -ne 0 ] && exit 1
1.6.2.1   misho      93: #      ${BUILD_SH} igmpproxy ${CBUILD} ${PKG} ${TARGET_BUILD}
                     94: #      [ $? -ne 0 ] && exit 1
1.6       misho      95:        ${BUILD_SH} ttcp ${CBUILD} ${PKG} ${TARGET_BUILD}
1.2       misho      96:        [ $? -ne 0 ] && exit 1
1.6       misho      97:        ${BUILD_SH} mtr ${CBUILD} ${PKG} ${TARGET_BUILD}
1.2       misho      98:        [ $? -ne 0 ] && exit 1
1.5       misho      99:        ${BUILD_SH} rsync ${CBUILD} ${PKG} ${TARGET_BUILD}
1.2       misho     100:        [ $? -ne 0 ] && exit 1
1.5       misho     101:        ${BUILD_SH} mpd ${CBUILD} ${PKG} ${TARGET_BUILD}
1.2       misho     102:        [ $? -ne 0 ] && exit 1
1.6       misho     103:        ${BUILD_SH} dnsmasq ${CBUILD} ${PKG} ${TARGET_BUILD}
1.2       misho     104:        [ $? -ne 0 ] && exit 1
1.6       misho     105:        ${BUILD_SH} confuse ${CGBUILD} ${PKG} ${TARGET_BUILD}
1.2       misho     106:        [ $? -ne 0 ] && exit 1
1.5       misho     107:        ${BUILD_SH} bmon ${CGBUILD} ${PKG} ${TARGET_BUILD}
1.2       misho     108:        [ $? -ne 0 ] && exit 1
1.6       misho     109:        ${BUILD_SH} hping2 ${CBUILD} ${PKG} ${TARGET_BUILD}
1.6.2.1   misho     110:        [ $? -ne 0 ] && exit 1
                    111:        ${BUILD_SH} pimd ${CBUILD} ${PKG} ${TARGET_BUILD}
                    112:        [ $? -ne 0 ] && exit 1
                    113:        ${BUILD_SH} pimdd ${CBUILD} ${PKG} ${TARGET_BUILD}
                    114:        [ $? -ne 0 ] && exit 1
                    115:        ${BUILD_SH} freevrrpd ${CBUILD} ${PKG} ${TARGET_BUILD}
1.2       misho     116:        [ $? -ne 0 ] && exit 1
1.6       misho     117:        ${BUILD_SH} readline ${CGBUILD} ${PKG} ${TARGET_BUILD}
1.6.2.2 ! misho     118:        [ $? -ne 0 ] && exit 1
        !           119:        env CFLAGS="-I${PKG}/include" LDFLAGS="-L${PKG}/lib" ${BUILD_SH} bird ${CGBUILD} ${PKG} ${TARGET_BUILD}
        !           120:        [ $? -ne 0 ] && exit 1
        !           121:        env CFLAGS="-I${PKG}/include" LDFLAGS="-L${PKG}/lib" ${BUILD_SH} bird6 ${CGBUILD} ${PKG} ${TARGET_BUILD}
1.2       misho     122:        [ $? -ne 0 ] && exit 1
1.5       misho     123:        env CFLAGS="-I${PKG}/include" LDFLAGS="-L${PKG}/lib" ${BUILD_SH} quagga ${CBUILD} ${PKG} ${TARGET_BUILD}
1.2       misho     124:        [ $? -ne 0 ] && exit 1
1.6       misho     125: 
                    126: 
                    127: #      ${BUILD_SH} iftop ${CBUILD} ${PKG} ${TARGET_BUILD}
                    128: #      [ $? -ne 0 ] && exit 1
                    129: #      ${BUILD_SH} iperf ${CBUILD} ${PKG} ${TARGET_BUILD}
                    130: #      [ $? -ne 0 ] && exit 1
                    131: #      ${BUILD_SH} sudo ${CBUILD} ${PKG} ${TARGET_BUILD}
                    132: #      [ $? -ne 0 ] && exit 1
                    133: #      ${BUILD_SH} smartmontools ${CBUILD} ${PKG} ${TARGET_BUILD}
                    134: #      [ $? -ne 0 ] && exit 1
                    135: #      ${BUILD_SH} trafshow ${CBUILD} ${PKG} ${TARGET_BUILD}
                    136: #      [ $? -ne 0 ] && exit 1
1.5       misho     137: #      ${BUILD_SH} ipsec-tools ${CGBUILD} ${PKG} ${TARGET_BUILD}
                    138: #      [ $? -ne 0 ] && exit 1
                    139: #      ${BUILD_SH} dhcp ${CBUILD} ${PKG} ${TARGET_BUILD}
                    140: #      [ $? -ne 0 ] && exit 1
                    141: #      ${BUILD_SH} dhcping ${CBUILD} ${PKG} ${TARGET_BUILD}
                    142: #      [ $? -ne 0 ] && exit 1
                    143: #      ${BUILD_SH} miniupnpd ${CBUILD} ${PKG} ${TARGET_BUILD}
                    144: #      [ $? -ne 0 ] && exit 1
                    145: #      ${BUILD_SH} miniupnpc ${CGBUILD} ${PKG} ${TARGET_BUILD}
                    146: #      [ $? -ne 0 ] && exit 1
1.6       misho     147: #      ${BUILD_SH} ntp ${CBUILD} ${PKG} ${TARGET_BUILD}
                    148: #      [ $? -ne 0 ] && exit 1
1.5       misho     149: #      ${BUILD_SH} spawn-fcgi ${CBUILD} ${PKG} ${TARGET_BUILD}
                    150: #      [ $? -ne 0 ] && exit 1
                    151: #      ${BUILD_SH} lighttpd ${CBUILD} ${PKG} ${TARGET_BUILD}
1.4       misho     152: #      [ $? -ne 0 ] && exit 1
1.5       misho     153: #      ${BUILD_SH} libxml2 ${CBUILD} ${PKG} ${TARGET_BUILD}
1.4       misho     154: #      [ $? -ne 0 ] && exit 1
1.5       misho     155: #      ${BUILD_SH} php ${CBUILD} ${PKG} ${TARGET_BUILD}
                    156: #      [ $? -ne 0 ] && exit 1
                    157:        echo
1.3       misho     158: }
                    159: 
                    160: install_3th()
                    161: {
                    162:        LIBS="${ROMFS_USR2}/lib"
                    163:        LIBEXEC="${ROMFS_USR2}/libexec"
                    164:        BIN="${ROMFS_USR2}/bin"
                    165:        SBIN="${ROMFS_USR2}/sbin"
                    166:        ETC="${ROMFS_USR2}/etc"
                    167: 
1.6       misho     168:        echo "+++ Install ELWIX RomFS secondary firmware ... ${ROMFS_USR2}"
1.3       misho     169: 
                    170:        StripFiles \*.so\* ${PKG}/lib
                    171:        InstallFiles \*.so\* ${PKG}/lib $LIBS
                    172:        StripFiles \* ${PKG}/libexec
                    173:        InstallFiles \* ${PKG}/libexec $LIBEXEC
                    174:        StripFiles \* ${PKG}/bin
                    175:        InstallFiles \* ${PKG}/bin $BIN
                    176:        StripFiles \* ${PKG}/sbin
                    177:        InstallFiles \* ${PKG}/sbin $SBIN
                    178: 
                    179:        InstallFiles \* ${PKG}/etc $ETC
                    180: 
                    181:        chown -R root:wheel $SBIN $BIN $LIBDATA $LIBEXEC $LIBS
                    182: }
                    183: 
                    184: build_3th()
                    185: {
1.6       misho     186:        echo "+++ Build ELWIX Firmware secondary image ... ${ROMFS_USR2} --> ${REL}/${ROMFS_IMG2}"
1.3       misho     187: 
                    188:        cd ${ROMFS_USR2}
                    189:        pax -w -z -v -f${REL}/${ROMFS_IMG2} .
                    190:        cd -
1.2       misho     191: 
1.3       misho     192: # Stop using uzip fs
                    193: #      makefs -ominfree=0,bsize=8192,fsize=1024,optimization=space -s${ROMFS_SIZE2} \
                    194: #              ${REL}/${ROMFS_IMG2} ${ROMFS_USR2}
                    195: 
                    196: #      MDDEV=$(mdconfig -a -t vnode -f ${REL}/${ROMFS_IMG2});
                    197: #      tunefs -L elwixFirmware2 /dev/$MDDEV;
                    198: #      mdconfig -d -u $MDDEV;
                    199: 
                    200: #      mkuzip -s 8192 -o ${REL}/${ROMFS_IMG2}.uzip ${REL}/${ROMFS_IMG2};
                    201: #      mv ${REL}/${ROMFS_IMG2}.uzip ${REL}/${ROMFS_IMG2}
1.6       misho     202: 
                    203:        echo "+++ Complited ELWIX Firmware secondary image ... ${REL}/${ROMFS_IMG2}"
1.2       misho     204: }
                    205: 
                    206: ### main()
                    207: if ! SnitVer ${PKG}/elwix.ver; then
1.5       misho     208:        clean_3th || exit 1
                    209:        compile_3th || exit 1
1.3       misho     210: 
1.5       misho     211:        install_3th || exit 1
                    212:        build_3th || exit 1
1.3       misho     213: 
                    214:        echo "ELWIX Platform:${PLATFORM} Version:${VERSION} TargetArch:${TARGET_ARCH}" >${PKG}/elwix.ver
1.2       misho     215: else
                    216:        echo "Skipped ELWIX 3th party build ..."
                    217: fi
                    218: 
                    219: echo "+++ Complete build ELWIX 3th party"

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