freebsd-ports/java/eclipse-cdt/scripts/pre-patch

59 lines
1.4 KiB
Bash

#!/bin/sh -x
# $FreeBSD: /tmp/pcvs/ports/java/eclipse-cdt/scripts/pre-patch,v 1.3 2006-11-07 11:04:47 girgen Exp $
copy_dir()
{
srcdir="$1"
dstdir="$2"
rm -rf "$dstdir"
cp -r "$srcdir" "$dstdir" || exit 1
if [ -d "$dstdir" ]
then
find "$dstdir" -name \*.so -delete
fi
}
prepare_files()
{
# Copy the files and rename/change them appropriately
for src in $COPY_LIST
do
dst=`echo $src | sed 's/linux/freebsd/g; s/Linux/FreeBSD/g; s/x86_64/amd64/g'`
echo Copying $src into $dst
if [ -d ${WRKSRC}/$src ]
then
copy_dir ${WRKSRC}/$src ${WRKSRC}/$dst
fi
done
find ${WRKSRC} -type d -name linux | xargs rm -r
}
unpack_jars()
{
for src in ${JAR_UNPACK_LIST}
do
cd ${WRKSRC} &&
mkdir ${src} &&
${UNZIP_CMD} -q ${src}.jar -d ${src}
done
}
COPY_LIST="
eclipse/plugins/org.eclipse.cdt.core.linux.x86_${PORTVERSION_TS}
eclipse/plugins/org.eclipse.cdt.core.linux.x86_${PORTVERSION_TS}/os/linux
eclipse/plugins/org.eclipse.cdt.core.linux.x86_${PORTVERSION_TS}/os/linux/x86
eclipse/plugins/org.eclipse.cdt.core.linux_${PORTVERSION_TS}
eclipse/plugins/org.eclipse.cdt.source.linux.gtk.x86_${PORTVERSION_TS}
eclipse/plugins/org.eclipse.cdt.source.linux.gtk.x86_${PORTVERSION_TS}/src/org.eclipse.cdt.core.linux_${PORTVERSION_TS}
"
JAR_UNPACK_LIST="
eclipse/plugins/org.eclipse.cdt.managedbuilder.gnu.ui_${PORTVERSION_TS}
eclipse/plugins/org.eclipse.cdt.core_${PORTVERSION_TS}"
prepare_files
unpack_jars
exit 0