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