cd src

# Delete old version
rm -rf \
   "$SAGE_LOCAL"/lib/python*/site-packages/PIL \
   "$SAGE_LOCAL"/lib/python*/site-packages/PIL-*.egg* \
   "$SAGE_LOCAL"/lib/python*/site-packages/Pillow-*.egg*

# Note: Avoid shared libraries inside egg files, Trac #19467
sage-python23 setup.py \
       --no-user-cfg \
       build_ext \
       --disable-jpeg \
       install \
       --single-version-externally-managed \
       --root "$SAGE_DESTDIR" || sdh_die "Error building/installing Pillow"
