File:  [ELWIX - Embedded LightWeight unIX -] / elwix / config / rc.3thparty_helper
Revision 1.3.2.1: download - view: text, annotated - select for diffs - revision graph
Tue Jun 13 17:39:31 2017 UTC (7 years, 6 months ago) by misho
Branches: elwix2_6
Diff to: branchpoint 1.3: preferred, unified
adds new script
update build
new sysctl

#!/bin/sh
#
# (C)`14 PKG-Builder script helper for elwix by Michael Pounov <misho@elwix.org>
#
# ./rc.3thparty_helper [package] [make_tool] [prefix_dir] [build_arch_str]
#
# $Id: rc.3thparty_helper,v 1.3.2.1 2017/06/13 17:39:31 misho Exp $
#

[ -r ./config/rc.elwix ] && . ./config/rc.elwix
if [ X"${ELWIX_IS_CONFIGURED}" != X"YES" ]; then
	echo
	echo "ELWIX project is not configured !?!"
	echo
	exit 1
fi


CMD=$1
MK=${2:-make}
P=${3:-/tmp/elwix}
B=$4
PFX="--prefix ${P}"
shift; shift; shift; shift;
echo ">>> Working script ${MK} into ${PFX}"

if [ -n "${B}" ]; then
	PFX="${PFX} --host ${B}"
fi

TOP=$(pwd)
echo ">>> TOPDIR=${TOP}"

if [ $P = "/tmp/elwix" ]; then
	rm -rf /tmp/elwix
	install -d /tmp/elwix
	install -d /tmp/elwix/bin
	install -d /tmp/elwix/include
	install -d /tmp/elwix/lib
	install -d /tmp/elwix/libexec
	install -d /tmp/elwix/man
	install -d /tmp/elwix/man/man1
	install -d /tmp/elwix/man/man2
	install -d /tmp/elwix/man/man3
	install -d /tmp/elwix/man/man4
	install -d /tmp/elwix/man/man5
	install -d /tmp/elwix/man/man6
	install -d /tmp/elwix/man/man7
	install -d /tmp/elwix/man/man8
	install -d /tmp/elwix/man/man9
	install -d /tmp/elwix/sbin
	install -d /tmp/elwix/share
fi

find ${ADDSRC} -name .deps -type d -exec rm -rf {} \;

case $CMD in
	automake)
		cd ${ADDSRC}/automake
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	sudo)
		cd ${ADDSRC}/sudo
		./configure --sysconfdir=/etc --libexecdir=/usr/local/libexec --with-ignore-dot \
					--with-tty-tickets --with-env-editor --with-logincap \
					--with-long-otp-prompt --with-pam --with-logfac=local2 \
					--with-bsm-audit ${PFX} || exit 1
		${MK} clean || exit 1
		${MK} || exit 1
		install src/sudo ${P}/bin || exit 1
		ln ${P}/bin/sudo ${P}/bin/sudoedit || exit 1
		install plugins/sudoers/sudoreplay ${P}/bin || exit 1
		install plugins/sudoers/visudo ${P}/sbin || exit 1
		install plugins/sudoers/.libs/sudoers.so ${P}/libexec || exit 1
		install src/.libs/libsudo_noexec.so ${P}/libexec || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	expat)
		cd ${ADDSRC}/expat
		./configure ${PFX} || exit 1
		${MK} clean || exit 1
		${MK} || exit 1
		${MK} install || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	readline)
		cd ${ADDSRC}/readline
		${CEXEC} INSTALL="/usr/bin/install" ./configure ${PFX} || exit 1
		${MK} clean || exit 1
		${MK} || exit 1
		${MK} install || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	confuse)
		cd ${ADDSRC}/confuse
		${CEXEC} INSTALL="/usr/bin/install" ./configure --disable-nls --enable-shared ${PFX} || exit 1
		${MK} clean || exit 1
		${MK} || exit 1
		${MK} install || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	mpd)
#		cd ${ADDSRC}/libpdel
#		${MK} clean || exit 1
#		${MK} || exit 1
#		find . -name \*.so\* -type f -exec install {} ${P}/lib \;
#		cd ..
		cd ${ADDSRC}/mpd/src
		${CEXEC} INSTALL="/usr/bin/install" DESTDIR=${WORLD} ./configure
		${MK} DESTDIR=${WORLD} clean || exit 1
		${MK} DESTDIR=${WORLD} || exit 1
		install mpd5 ${P}/sbin || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	libevent)
		cd ${ADDSRC}/libevent
		./configure ${PFX} --mandir=${P}/man --infodir=${P}/info || exit 1
		${MK} clean || exit 1
		${MK} || exit 1
		${MK} install || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	mini_sendmail)
		cd ${ADDSRC}/mini_sendmail
		${MK} clean || exit 1
		${MK} || exit 1
		install mini_sendmail ${P}/sbin || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	choparp)
		cd ${ADDSRC}/choparp
		rm -f choparp
		${MK} choparp || exit 1
		install choparp ${P}/sbin || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	ttcp)
		cd ${ADDSRC}/ttcp
		rm -f ttcp
		${MK} ttcp || exit 1
		install ttcp ${P}/bin || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	iperf)
		cd ${ADDSRC}/iperf
		./configure --disable-silent-rules ${PFX} || exit 1
		${MK} clean || exit 1
		${MK} || exit 1
		${MK} install || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	trafshow)
		cd ${ADDSRC}/trafshow
		./configure --sysconfdir=/etc ${PFX} || exit 1
		${MK} clean || exit 1
		${MK} || exit 1
		${MK} install || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	ipsec-tools)
		cd ${ADDSRC}/ipsec-tools
		./configure --enable-shared --sysconfdir=/etc/racoon --localstatedir=/var/run --with-pkgversion=elwix-0.8.2 \
				 --enable-debug --enable-ipv6 --enable-adminport --enable-stats \
				 --enable-dpd --enable-natt=yes --enable-frag --enable-hybrid \
				 --without-libpam --disable-gssapi --with-libradius --without-libldap \
				 --disable-samode-unspec --disable-rc5 --disable-idea ${PFX} || exit 1
		${MK} clean || exit 1
		${MK} || exit 1
		${MK} install || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	dhcp)
		cd ${ADDSRC}/dhcp
		./configure --localstatedir=/var --enable-paranoia --enable-early-chroot \
				--enable-dhcpv6 ${PFX} || exit 1
		${MK} clean || exit 1
		${MK} || exit 1
		install server/dhcpd ${P}/sbin || exit 1
		install relay/dhcrelay ${P}/sbin || exit 1
		install dhcpctl/omshell ${P}/bin || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	dhcping)
		cd ${ADDSRC}/dhcping
		./configure ${PFX} || exit 1
		${MK} clean || exit 1
		${MK} || exit 1
		${MK} install || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	mrouted)
		cd ${ADDSRC}/mrouted
		${MK} clean || exit 1
		${MK} || exit 1
		install map-mbone ${P}/sbin || exit 1
		install mrinfo ${P}/sbin || exit 1
		install mrouted ${P}/sbin || exit 1
		install mtrace ${P}/sbin || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	igmpproxy)
		cd ${ADDSRC}/igmpproxy
		${CEXEC} INSTALL="/usr/bin/install" ./configure ${PFX} || exit 1
		${MK} clean || exit 1
		${MK} || exit 1
		${MK} install || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	bmon)
		cd ${ADDSRC}/bmon
		LDFLAGS="-L${PKG}/lib" CFLAGS="-I${PKG}/include" ${CEXEC} INSTALL="/usr/bin/install" ./configure ${PFX} || exit 1
		${MK} clean || exit 1
		${MK} || exit 1
		${MK} install || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	iftop)
		cd ${ADDSRC}/iftop
		./configure --with-resolver=netdb_1thread ${PFX} || exit 1
		${MK} clean || exit 1
		${MK} || exit 1
		${MK} install || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	libnet)
		cd ${ADDSRC}/libnet
		${CEXEC} INSTALL="/usr/bin/install" ./configure ${PFX} || exit 1
		${MK} clean || exit 1
		${MK} || exit 1
		${MK} install || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	arping)
		cd ${ADDSRC}/arping
#		${CEXEC} LDFLAGS=-L${ADDSRC}/libnet/src CFLAGS=-I${ADDSRC}/libnet/include \
		LDFLAGS="-L${PKG}/lib" CFLAGS="-I${PKG}/include" ${CEXEC} INSTALL="/usr/bin/install" ./configure ${PFX} || exit 1
		${MK} clean || exit 1
		${MK} || exit 1
		${MK} install || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	hping2)
		cd ${ADDSRC}/hping2
		${CEXEC} INSTALL="/usr/bin/install" ./configure ${PFX} || exit 1
		${MK} clean || exit 1
		case ${TARGET_ARCH} in
			i386|amd64)
				CROSSCOMPILE="-D__LITTLE_ENDIAN_BITFIELD" ${MK} || exit 1
				;;
			*)
				CROSSCOMPILE="-D__BIG_ENDIAN_BITFIELD" ${MK} || exit 1
				;;
		esac
		${MK} strip
		install hping2 ${P}/sbin || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	mtr)
		cd ${ADDSRC}/mtr
		${CEXEC} INSTALL="/usr/bin/install" ./configure --enable-ipv6 --without-gtk ${PFX} || exit 1
		${MK} clean || exit 1
		${MK} || exit 1
		${MK} install || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	ipguard)
		cd ${ADDSRC}/ipguard
		${MK} clean || exit 1
		${MK} PREFIX="${PKG}" LOCALBASE="${PKG}" || exit 1
		install ipguard ${P}/sbin || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	miniupnpd)
		cd ${ADDSRC}/miniupnpd
		${MK} clean || exit 1
		${MK} || exit 1
		install miniupnpd ${P}/sbin || exit 1
		install miniupnpdctl ${P}/sbin || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	miniupnpc)
		cd ${ADDSRC}/miniupnpc
		${MK} clean || exit 1
		${MK} || exit 1
		install libminiupnpc.so ${P}/lib || exit 1
		install external-ip.sh ${P}/bin || exit 1
		install upnpc-shared ${P}/bin/upnpc || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	pimd)
		cd ${ADDSRC}/pimd
		${CEXEC} INSTALL="/usr/bin/install" ./configure --enable-scoped-acls --prefix=${PFX} || exit 1
		${MK} clean || exit 1
		install pimd ${P}/sbin || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	smartmontools)
		cd ${ADDSRC}/smartmontools
		./configure --enable-sample --disable-dependency-tracking --enable-drivedb ${PFX} || exit 1
		${MK} clean || exit 1
		${MK} || exit 1
		${MK} install || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	libiconv)
		cd ${ADDSRC}/libiconv
		./configure --enable-static --without-libintl-prefix ${PFX} || exit 1
		${MK} clean || exit 1
		${MK} || exit 1
		${MK} install || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	quagga)
		cd ${ADDSRC}/quagga
		${CEXEC} INSTALL="/usr/bin/install" ./configure --enable-user=quagga --enable-group=quagga --disable-snmp \
				--sysconfdir=/etc/quagga --localstatedir=/var/run/quagga \
				--enable-vtysh --enable-opaque-lsa --enable-rtadv ${PFX} || exit 1
		${MK} clean || exit 1
		${MK} || exit 1
		${MK} install || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	pcre)
		cd ${ADDSRC}/pcre
		./configure --enable-utf --enable-unicode-properties --enable-pcre8 \
				--enable-pcre16 --enable-pcre32 ${PFX} || exit 1
		${MK} clean || exit 1
		${MK} || exit 1
		${MK} install || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	libxml2)
		cd ${ADDSRC}/libxml2
		./configure --without-python ${PFX} || exit 1
		${MK} clean || exit 1
		${MK} || exit 1
		${MK} install || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	php)
		cd ${ADDSRC}/php
		./configure --with-layout=GNU --localstatedir=/var --with-config-file-scan-dir=/etc/php \
			--disable-all --enable-libxml --enable-xml --with-libxml-dir=${P} --with-openssl \
			--enable-zip --enable-sqlite-utf8 ${PFX} || exit 1
		${MK} clean || exit 1
		${MK} || exit 1
		${MK} install || exit 1
		rm -f ${P}/bin/php
		strip -s ${P}/bin/php-cgi
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	scan_ffs)
		cd ${ADDSRC}/scan_ffs
		${MK} clean || exit 1
		${MK} || exit 1
		install scan_ffs ${P}/bin || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	dnsmasq)
		cd ${ADDSRC}/dnsmasq
		${MK} clean || exit 1
		${MK} || exit 1
		install src/dnsmasq ${P}/bin || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	rsync)
		cd ${ADDSRC}/rsync
		${CEXEC} INSTALL="/usr/bin/install" ./configure.sh --disable-debug --enable-ipv6 --with-rsyncd-conf=/etc/rsyncd.conf \
			--disable-iconv --with-included-popt ${PFX} || exit 1
		${MK} clean || exit 1
		${MK} || exit 1
		${MK} install || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	istgt)
		cd ${ADDSRC}/istgt
		./configure --enable-symlink-device ${PFX} || exit 1
		${MK} clean || exit 1
		${MK} || exit 1
		install src/istgt ${P}/bin || exit 1
		install src/istgtcontrol ${P}/bin || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	ntp)
		cd ${ADDSRC}/ntp
		./configure --without-ntpsnmpd --with-crypto --enable-ipv6 --enable-BANCOMM \
			--enable-GPSVME --enable-ACTS --enable-ARBITER --enable-ARCRON_MSF \
			--enable-AS2201 --enable-ATOM --enable-CHRONOLOG --enable-CHU \
			--enable-AUDIO_CHU --enable-DATUM --enable-DUMBCLOCK --enable-FG \
			--enable-HEATH --enable-HOPFSERIAL --enable-HOPFPCI --enable-HPGPS \
			--enable-IRIG --enable-JJY --enable-JUPITER --enable-LEITCH \
			--enable-LOCAL_CLOCK --enable-MX4200 --enable-NEOCLOCK4X --enable-NMEA \
			--enable-ONCORE --enable-PALISADE --enable-PCF --enable-PST \
			--enable-RIPENCC --enable-SHM --enable-SPECTRACOM --enable-TRUETIME \
			--enable-ULINK --enable-WWV --enable-ZYFER --enable-COMPUTIME \
			--enable-DCF7000 --enable-HOPF6021 --enable-MEINBERG --enable-RAWDCF \
			--enable-RCC8000 --enable-SCHMID --enable-TRIMTAIP --enable-TRIMTSIP \
			--enable-WHARTON --enable-VARITEXT ${PFX} || exit 1
		${MK} clean || exit 1
		${MK} || exit 1
		${MK} install || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	nginx)
		cd ${ADDSRC}/nginx
		./configure --conf-path=/etc/nginx.conf --user=www --group=www \
			--pid-path=/var/run/nginx.pid \
			--error-log-path=/var/log/nginx-error.log \
			--lock-path=/var/run/nging.lock \
			--http-log-path=/var/log/nginx-access.log --with-ipv6 \
			--with-http_ssl_module --with-http_mp4_module ${PFX} || exit 1
#		${MK} clean || exit 1
		${MK} || exit 1
#		${MK} install || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	spawn-fcgi)
		cd ${ADDSRC}/spawn-fcgi
		./configure ${PFX} || exit 1
		${MK} clean || exit 1
		${MK} || exit 1
		${MK} install || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	lighttpd)
		cd ${ADDSRC}/lighttpd
		./configure --libdir=/usr/local/lib/lighttpd --without-attr --without-bzip2 \
			--without-gdbm --without-libev --without-lua --without-memcached --with-openssl \
			--without-valgrind --enable-static ${PFX} || exit 1
		${MK} clean || exit 1
		${MK} || exit 1
		${MK} install || exit 1
		echo ">>> Now rebuild elwix $CMD program ..."
		;;
	*)
		echo "Package not supported at this moment ..."
		exit 1
esac

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