KRB5CONFIG=/usr/bin/krb5-config # Inside an ebuidl the following are set up by portage PN=heimdal # not reported by krb5-config PV=1.0.1_rc1 # dtto D=/ # in portage, the temporary install directory # end of standard portage variables dodir /usr/lib/pkgconfig for package in krb5 gssapi kadm-client kadm-server kafs; do cat > "${D}"/usr/lib/pkgconfig/"${package}.pc" <<-EOF prefix=`"${D}/${KRB5CONFIG}" --prefix "${package}"` exec_prefix=`"${D}/${KRB5CONFIG}" --exec-prefix "${package}"` libdir=`"${D}/${KRB5CONFIG}" --libs |sed -e's/^-L\([^ ]*\)\($\| .*$\)/\1/'` includedir=`"${D}/${KRB5CONFIG}" --cflags |sed -e's/^-I\([^ ]*\)\($\| .*$\)/\1/'` Name: ${PN} ${package} Description: the $package part of ${PN} Version: ${PV} Requires: Libs: `"${D}/${KRB5CONFIG}" --libs "${package}"` Cflags: `"${D}/${KRB5CONFIG}" --cflags "${package}"` EOF done