Blame Scripts/Bash/Functions/cli_getCopyrightInfo.sh

1971b4
#!/bin/bash
1971b4
#
1971b4
# cli_getCopyrightInfo.sh -- This function outputs copyright
1971b4
# information based on action value (ACTIONVAL) variable.
1971b4
#
93aaae
# The copyright information is printed to show the fact that one
93aaae
# person how creates something has the creation rights over that
93aaae
# something he/she created. An so, the legal power to release his/her
93aaae
# creation under the ethical terms of whatever license he/she
93aaae
# considers more appropriate, in order to distribute his/her creation.
93aaae
#
93aaae
# Inside CentOS Artwork Repository, we print copyright information in
93aaae
# the following image-related components:
93aaae
#
93aaae
#   1. The artistic motifs, to define the visual style of themes.
93aaae
#
93aaae
#      The copyright information of artistic motifs is owned by the
93aaae
#      person who creates the artistic motif (i.e., the artistic motif
93aaae
#      author). The copyright information of artistic motifs is
93aaae
#      specified in the `authors.txt' file placed inside the artistic
93aaae
#      motif directory structure. The copyright information of
93aaae
#      artistic motifs is printed in imagesunder
93aaae
#      trunk/Identity/Themes/Motifs/$THEME/Concept directory structure
93aaae
#      only.
93aaae
# 
93aaae
#   2. The design models, to define the characteristics of themes.
93aaae
# 
93aaae
#      The copyright information of design models is owned by the
93aaae
#      person who creates the design model (i.e., the design model
93aaae
#      author). The copyright information of design models is
93aaae
#      specified in the metadata of each scalable vector graphic that
93aaae
#      make a design model on its own. The copyright information of
93aaae
#      design models is not printed in images.
93aaae
#
93aaae
#   3. The CentOS themes, to cover each visual manifestation of The
93aaae
#      CentOS Project corporate visual identity.  A CentOS theme is
93aaae
#      made of many different images connected among themselves by
93aaae
#      mean of a uniform visual pattern (artistic motif + design
93aaae
#      model).
93aaae
#
93aaae
#      The copyright information of CentOS themes is owned by The
93aaae
#      CentOS Project. Instead of printing the copyright information
93aaae
#      over all images inside one CentOS theme, the copyright
93aaae
#      information of CentOS themes is printed only on images related
93aaae
#      to Anaconda progress first slides.
93aaae
# 
93aaae
# At this point, we've defined who own the creation rights of artistic
93aaae
# motifs, design models, and the CentOS themes.
93aaae
#     
93aaae
# Now, in order for the CentOS Community to use these components, it
93aaae
# is required that each component author relases his/her creation
93aaae
# under a license that grants the freedom of using, studying, changing
93aaae
# and releasing improved versions of his/her creation. Also, the license
93aaae
# should prevent any privatizing practice or any kind of darkness that
93aaae
# put in risk the freedom of CentOS Community.
93aaae
# 
93aaae
# What license to use is a decision that CentOS Community has to take.
93aaae
# The license adopted, by CentOS Community, specifies the ethical terms
93aaae
# the CentOS Community agree to work with. It reflects the
93aaae
# philosophical thinking of CentOS Community, so all creation inside
93aaae
# CentOS Community should be released under such license terms, no
93aaae
# matter who the person who creates something be. If some person want
93aaae
# to create for CentOS, that person has to aggree with CentOS
93aaae
# Community philosophical thinking (i.e. that reflected by license
93aaae
# adopted to release creations). This way, that's because it is so
93aaae
# important that the decision of what license to use be a collective
93aaae
# decision, that everyone understand why we are using this license and
93aaae
# not other.
93aaae
#
93aaae
# I'm not a lawyer. So, I can't give details of something I don't know
93aaae
# certainly.  All I can do is using my intuition and it says to me
93aaae
# that Creative Common Attribution-ShareAlike 3.0 License
93aaae
# (http://creativecommons.org/licenses/by-sa/3.0/) seems to be a good
93aaae
# candidate. It has been used in the wiki (http://wiki.centos.org/)
93aaae
# for some time. Also, other relevant projects like The Tango Project
93aaae
# are using it to release art works and similar creations.
93aaae
#         
93aaae
# So, in the sake of covering copyright information and license needs
93aaae
# inside centos-art.sh script, all images produced by `centos-art.sh'
93aaae
# script will be released using the copyright information his/her
93aaae
# author (see above) and the license Creative Common
93aaae
# Attribution-ShareAlike 3.0 License
93aaae
# (http://creativecommons.org/licenses/by-sa/3.0/).  This could change
93aaae
# in the future, after a collective discussion in the CentOS mailing
93aaae
# list.
93aaae
#
1971b4
# Copyright (C) 2009-2011 Alain Reguera Delgado
1971b4
# 
1971b4
# This program is free software; you can redistribute it and/or
1971b4
# modify it under the terms of the GNU General Public License as
1971b4
# published by the Free Software Foundation; either version 2 of the
1971b4
# License, or (at your option) any later version.
1971b4
# 
1971b4
# This program is distributed in the hope that it will be useful, but
1971b4
# WITHOUT ANY WARRANTY; without even the implied warranty of
1971b4
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1971b4
# General Public License for more details.
1971b4
#
1971b4
# You should have received a copy of the GNU General Public License
1971b4
# along with this program; if not, write to the Free Software
1971b4
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
1971b4
# USA.
1971b4
# 
1971b4
# ----------------------------------------------------------------------
1971b4
# $Id$
1971b4
# ----------------------------------------------------------------------
1971b4
1971b4
function cli_getCopyrightInfo {
1971b4
93aaae
    local NOTE=''
93aaae
    local DIR=''
93aaae
    local -a DIRS
93aaae
    local -a NOTES
93aaae
    local COUNT=0
93aaae
93aaae
    # Define directory structures that don't use default information.
93aaae
    DIRS[0]="$(cli_getRepoTLDir)/Identity/Themes/Motifs/$(cli_getThemeName)/Concept"
93aaae
93aaae
    case "$1" in
93aaae
93aaae
        '--description' )
93aaae
93aaae
            # Define default description information.
93aaae
            NOTE="The CentOS Project corporate visual identity"
93aaae
93aaae
            # Define description information for directory structures
93aaae
            # that don't use default description information.
93aaae
            NOTES[0]="=NAME= is an artistic motif and theme for ${NOTE}."
93aaae
            ;;
93aaae
93aaae
        '--license' )
93aaae
93aaae
            # Define default license information used by all
93aaae
            # image-based creations inside CentOS Artwork Repository.
93aaae
            NOTE="Creative Common Attribution-ShareAlike 3.0 License"
93aaae
93aaae
            # Define license information for directory structures that
93aaae
            # don't match default license information.
93aaae
            NOTES[0]="=NAME= artistic motif and theme are released under ${NOTE}."
93aaae
            ;;
1971b4
93aaae
        '--copyright' | * )
93aaae
    
93aaae
            # Define default copyright information.
93aaae
            NOTE="Copyright © 2003-$(date +%Y) The CentOS Project. All rights reserved."
1971b4
93aaae
            # Define copyright information for directory structures
93aaae
            # that don't use default copyright information.
93aaae
            NOTES[0]=$(cli_readFileContent \
93aaae
                "$(cli_getRepoTLDir)/Identity/Themes/Motifs/$(cli_getThemeName)/authors.txt" \
93aaae
                '--copyright')
93aaae
            ;;
93aaae
    esac
1971b4
93aaae
    # Redefine information of directory structures that don't use
93aaae
    # default copyright information.
93aaae
    while [[ ${COUNT} -lt ${#DIRS[*]} ]];do
93aaae
        if [[ $ACTIONVAL =~ "${DIRS[$COUNT]}" ]];then
93aaae
            if [[ "${NOTES[$COUNT]}" != '' ]];then
93aaae
                NOTE=${NOTES[$COUNT]}
93aaae
            fi
1971b4
        fi
93aaae
        COUNT=$(($COUNT + 1))
93aaae
    done
1971b4
93aaae
    # Print information.
93aaae
    echo $NOTE
1971b4
1971b4
}