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.
606e4c
#
606e4c
#      The copyright information printed on Anaconda progress first
606e4c
#      slides is used to print the creation rights of The CentOS
606e4c
#      Project over its creation (i.e., The CentOS Distribution) not
606e4c
#      The CentOS Theme itself.
93aaae
# 
606e4c
# At this point, we've defined who own the creation rights of image
606e4c
# components. Now, it is important to remark that if we need to show
606e4c
# one creation copyright, in different places, all references to the
606e4c
# same cration copyright information should be the same. Cannot be any
606e4c
# ambiguity among them. The best way to reach this is having just one
606e4c
# unique definition, and build images using that unique copyright
606e4c
# definition as reference.
93aaae
#     
606e4c
# Another relevant point, we need to be aware of, is that related to
606e4c
# the licenses. As creators has the creation rights, they have the
606e4c
# right to distribute their work as their consideration.  If creators
606e4c
# release their creations under the terms of a privatizing license,
606e4c
# that creation will be almost useless for The CentOS Community. So,
606e4c
# in order for creations to be useful in The CentOS Community,
606e4c
# creators should distribution their creations under the terms of a
606e4c
# license that grants the freedom of using, studying, changing and
606e4c
# releasing improved versions of them. Likewise, the license should
606e4c
# prevent any privatizing practice or any kind of darkness that put in
606e4c
# risk the freedom of The CentOS Community.
93aaae
# 
606e4c
# What license should be used to distribute images (and the components
606e4c
# used to build them) is a decision for The CentOS Community to take.
606e4c
# The license adopted, by The CentOS Community, specifies the ethical
606e4c
# terms The CentOS Community is agree to work with. It is a reference
606e4c
# we all have to agree with and follow in the sake of our community
606e4c
# and ourselves freedom.  That's why license selection has to be a
606e4c
# collective decision, and also be constantly in question.
93aaae
#
93aaae
# I'm not a lawyer. So, I can't give details of something I don't know
606e4c
# certainly.  All I've done so far is using my intuition and basic
606e4c
# understanding of what copyright and license is. So, if you have a
606e4c
# deeper understanding and experience in such legal topics, please
606e4c
# feel free to make your own revisions to ideas described here.
93aaae
#         
606e4c
# In the sake of covering copyright information and license needs
93aaae
# inside centos-art.sh script, all images produced by `centos-art.sh'
606e4c
# script will be released using the copyright information of his/her
606e4c
# creator (see above) and the license Creative Common
93aaae
# Attribution-ShareAlike 3.0 License
606e4c
# (http://creativecommons.org/licenses/by-sa/3.0/).  
606e4c
#
606e4c
# The Creative Common Attribution-ShareAlike 3.0 License has been
606e4c
# adopted in The CentOS Wiki (http://wiki.centos.org/) and seems to be
606e4c
# good as well to distribute image-specific creations under CentOS
606e4c
# Artwork Repository. Of course, as licenses are always questionable,
606e4c
# the one we've choosed could be changed in the future after a
606e4c
# collective discussion in the CentOS mailing list, in order to better
606e4c
# reflect the ethical feelings of our community.
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 -a DIRS
606e4c
    local -a FILES
93aaae
    local -a NOTES
606e4c
    local NOTE=''
93aaae
    local COUNT=0
93aaae
93aaae
    # Define directory structures that don't use default information.
5c2f35
    DIRS[0]="$(cli_getRepoTLDir)/Identity/Themes/Motifs/$(cli_getPathComponent '--theme')/Concept"
5c2f35
    DIRS[1]="$(cli_getRepoTLDir)/Identity/Themes/Motifs/$(cli_getPathComponent '--theme')/Promo"
606e4c
606e4c
    # Define absolute path to file from which we retrive copyright
606e4c
    # information for directory structures that don't use default
606e4c
    # information. 
5c2f35
    FILES[0]="$(cli_getRepoTLDir)/Identity/Themes/Motifs/$(cli_getPathComponent '--theme-name')/copyright.txt"
93aaae
93aaae
    case "$1" in
93aaae
93aaae
        '--description' )
93aaae
93aaae
            # Define default description information.
606e4c
            NOTE="The CentOS Project corporate visual identity."
93aaae
93aaae
            # Define description information for directory structures
93aaae
            # that don't use default description information.
567435
            NOTES[0]="=THEMENAME= 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.
606e4c
            NOTE="Creative Common Attribution-ShareAlike 3.0 License."
93aaae
93aaae
            # Define license information for directory structures that
93aaae
            # don't match default license information.
567435
            NOTES[0]="=THEMENAME= artistic motif and theme are released under ${NOTE}"
ae310e
            NOTES[1]="`gettext "The CentOS distribution is released as GPL."`"
93aaae
            ;;
1971b4
93aaae
        '--copyright' | * )
93aaae
    
93aaae
            # Define default copyright information.
ae310e
            NOTE="Copyright © 2003-$(date +%Y) The CentOS Project. `gettext "All rights reserved."`"
1971b4
93aaae
            # Define copyright information for directory structures
606e4c
            # that don't match default copyright information.
606e4c
            if [[ -f ${FILES[0]} ]];then
606e4c
                NOTES[0]=$(cli_readFileContent "${FILES[0]}" '--copyright')
606e4c
            fi
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
606e4c
                NOTE="${NOTES[$COUNT]}"
93aaae
            fi
1971b4
        fi
93aaae
        COUNT=$(($COUNT + 1))
93aaae
    done
1971b4
93aaae
    # Print information.
606e4c
    echo "$NOTE"
1971b4
1971b4
}