Blame env-builder-data/build/script/include/inc-pklicense-default.sh

99b145
99b145
# PK_DIRNAME
99b145
# PK_LICENSE_FILES
99b145
99b145
pklicense() {
99b145
    local TARGET="$LICENSE_PACKET_DIR/license-$NAME"
99b145
    rm -f "$TARGET"
99b145
99b145
    local FILES=" \
99b145
        AUTHORS \
99b145
        AUTHORS.txt \
99b145
        COPYING \
99b145
        COPYING.txt \
99b145
        LICENSE \
99b145
        LICENSE.txt \
99b145
        License.txt \
99b145
        COPYRIGHT \
99b145
        Copyright \
99b145
        Copyright.txt \
99b145
        CREDITS \
99b145
        CREDITS.txt "
99b145
    if [ ! -z "$PK_LICENSE_FILES" ]; then
99b145
        FILES="$PK_LICENSE_FILES"
99b145
    fi
99b145
    
99b145
    cd "$BUILD_PACKET_DIR/$PK_DIRNAME"
99b145
    local FILE=
99b145
    for FILE in $FILES; do
99b145
        if [ -f "$FILE" ]; then
e7fa50
            add_license "$FILE" "$FILE" "$TARGET" || (echo "Cannot copy license file: $FILE"; return 1)
99b145
        elif [ -f "$FILES_PACKET_DIR/$FILE" ]; then
e7fa50
            add_license "$FILES_PACKET_DIR/$FILE" "" "$TARGET" || (echo "Cannot copy license file: $FILE"; return 1)
99b145
        elif [ ! -z "$PK_LICENSE_FILES" ]; then
99b145
            echo "Cannot copy license file: $FILE"
99b145
            return 1
99b145
        fi
99b145
    done
99b145
99b145
    if [ ! -f "$TARGET" ]; then
99b145
        echo "Cannot copy any license";
99b145
        return 1
99b145
    fi
99b145
    
99b145
    if ! pkhook_postlicense; then
99b145
        return 1
99b145
    fi
99b145
}