# -*- shell-script -*-
# cygwin/mknetrel - ec-fonts-mftraced mknetrel overrides

# This script should be used to package ec-fonts-mftraced for Cygwin.
# It can be used to build ec-fonts-mftraced on Cygwin, but also on GNU/Linux.

sub_packages=""
old_path=$PATH

# patch=$mknetrel_root/patch

# for cross building:
if ! iscygwin; then
    uploads=$here/uploads/$base && mkdir -p $uploads/
    tarstem=$uploads/$package
fi

# copy and include extra mknetrel stuff
# extras="doc patch auto cross split"
extras="doc"
for i in $extras; do
    f=mknetrel.$i
    [ -r $extra/$f ] && cp -pv $extra/$f $src/cygwin/$f
    . $src/cygwin/$f
done


# needdevoflags () {
#     false
# }

# prebuild () {
#     :
# }

# preinstall () {
#     :
# }

postinstall () {

    ## postinstall
    cd $src || exit 1
    install -d -m755 $inst/etc/postinstall
    install -m755 cygwin/postinstall-ec-fonts-mftraced.sh $inst/etc/postinstall

    ## copy READMEs etc
    cd $src || exit 1
    install -d -m755 $inst/$packagedocdir

    install -m644 ChangeLog LICENSE README VERSION $inst/$packagedocdir

    ## Cygwin readmes
    cygwin=cygwin
    cd $src || exit 1
    install -d -m755 $inst/$cygdocdir
    install -m644 $cygwin/changelog $inst/$packagedocdir/changelog.Cygwin

    cd $build || exit 1
    make $(pwd)/cygwin/README
    install -m644 $cygwin/README $inst/$packagedocdir/README.Cygwin
    install -m644 $cygwin/README $inst/$cygdocdir/$package.README
}

