Blame Scripts/Bash/centos-art/Functions/cli_getCopyrightInfo.sh

1971b4
#!/bin/bash
1971b4
#
1971b4
# cli_getCopyrightInfo.sh -- This function outputs copyright
1d5701
# information defined by design model the artistic motif images are
1d5701
# produced from. As convenction, we use the file `copyright.txt' to
1d5701
# store design model copyright information, in the root directory of
1d5701
# design model directory structure.
1971b4
#
1d5701
# The copyright information is printed to show the fact that the
93aaae
# person how creates something has the creation rights over that
1d5701
# something he/she creates. 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
# 
1d5701
# At this point, we've defined who owns 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
    case "$1" in
93aaae
93aaae
        '--license' )
93aaae
1d5701
            # Output default license name used by all image-based
1d5701
            # creations inside CentOS Artwork Repository.
1d5701
            echo "Creative Common Attribution-ShareAlike 3.0"
93aaae
            ;;
1d5701
f1f97d
        '--license-url' )
f1f97d
1d5701
            # Ouput default license url used by all image-based
f1f97d
            # creations inside CentOS Artwork Repository.
1d5701
            echo "http://creativecommons.org/licenses/by-sa/3.0/"
f1f97d
            ;;
1971b4
1d5701
        '--copyright-year' )
1d5701
1d5701
            local FILE=''
1d5701
            local YEAR=''
1d5701
1d5701
            # Define default copyright file. The place the copyright
1d5701
            # information is retrived from.
1d5701
            FILE="$(echo $TEMPLATE \
1d5701
                | sed -r "s!(Themes/Models/${THEMEMODEL}).+!\1/copyright.txt!")"
1971b4
1d5701
            # Define default copyright year.
1d5701
            if [[ -f $FILE ]];then
1d5701
                YEAR=$(cli_readFileContent "${FILE}" '--copyright-year')
1d5701
            else
1d5701
                YEAR=$(date +%Y)
606e4c
            fi
1971b4
1d5701
            # Output default copyright year.
1d5701
            echo $YEAR
1d5701
            ;;
1d5701
    
1d5701
        '--copyright-holder' | * )
1d5701
            
1d5701
            local FILE=''
1d5701
            local HOLDER=''
1d5701
1d5701
            # Define default copyright file. The place the copyright
1d5701
            # information is retrived from.
1d5701
            FILE="$(echo $TEMPLATE \
1d5701
                | sed -r "s!(Themes/Models/${THEMEMODEL}).+!\1/copyright.txt!")"
1d5701
1d5701
            # Define default copyright holder.
1d5701
            if [[ -f $FILE ]];then 
1d5701
                HOLDER=$(cli_readFileContent "${FILE}" '--copyright-holder')
1d5701
            else 
1d5701
                HOLDER="The CentOS Project. `gettext "All rights reserved."`"
93aaae
            fi
1971b4
1d5701
            # Output default copyright holder.
1d5701
            echo $HOLDER
1d5701
            ;;
1d5701
1d5701
    esac
1971b4
1971b4
}