aboutsummaryrefslogtreecommitdiffstats
path: root/java/eclipse-cdt/scripts/pre-patch
blob: 3a5e9550f38f936ef4d5b63fb8dae62dc73fbf16 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/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