# Copyright 2008 Daniel Mierswa # Distributed under the terms of the GNU General Public License v2 export_exlib_phases src_prepare src_install HOMEPAGE_BASE="http://cr.yp.to" HOMEPAGE_EXTENSION="${HOMEPAGE_EXTENSION:-${PN}.html}" HOMEPAGE="${HOMEPAGE:-${HOMEPAGE_BASE}/${HOMEPAGE_EXTENSION}}" LICENCES="${LICENCES:-public-domain}" DOWNLOADS="${DOWNLOADS:-${HOMEPAGE_BASE}/${PN}/${PNV}.tar.gz}" # first give gcc, ranlib and ar a host-triplet # then replace some trivial code with newer extensions of gcc/C to # avoid running binaries on the host to obtain the information (i.e. # support cross-compiling) # TODO: check if iopause.h can be created by us djb_src_prepare() { local basedir=$(dirname $(find -type f -name conf-cc)) local ranlib_file=$(grep -r ranlib . | sed 's/:.*//') edo sed \ -e "/^gcc/s:.*:& ${CPPFLAGS} ${CFLAGS}:" \ -e "/^gcc/s:gcc:${CC}:" \ -i "${basedir}/conf-cc" edo sed \ -e "/^gcc/s:.*:& ${LDFLAGS}:" \ -e "/^gcc/s:gcc:${LD}:" \ -i "${basedir}/conf-ld" edo sed \ -e "/echo 'ar cr/s:ar:${AR}:" \ -e "/*) echo 'ranlib \"\\$/s:ranlib:${RANLIB}:" \ -i "${ranlib_file}" if [ -f "${basedir}/auto-str.c" ] ; then edo cat >> "${basedir}/auto-str" <> "${basedir}/uint64.h" < typedef uint64_t uint64; #endif EOF fi if [ -f "${basedir}/conf-home" ] ; then edo echo /usr > "${basedir}/conf-home" fi default } djb_src_install() { local hierc_file=$(find -type f -name hier.c) local count dir file opts while read line ; do line=$(echo ${line} | tr ',' ' ' | tr -d '"') count=$(echo ${line} | wc -w) [ ${count} -ne 6 ] && continue dir=$(echo ${line} | awk '{ print $2 }') file=$(echo ${line} | awk '{ print $3 }') opts=$(echo ${line} | awk '{ print $6 }') opts=${opts#?} opts=${opts%??} [ ! "${dir%bin}" = "${dir}" ] && dir="/usr/${dir}" insinto "${dir}" insopts "-m${opts}" doins "${file}" done < "${hierc_file}" # $(tail -n+8 "${hierc_file}" | head -n-1 | tr ',' ' ' | awk '{ print $3 }' | tr -d '"') ; do }