PLESK LANGUAGE PACKS

Section 4.2 LP SH Format

To create an installation package in the form of an SH file, follow these steps:

  • create the <application name>-<version number>-<release number>.sh file and make it executable: chmod 777 <file_name>

  • include in the SH file the header with the code responsible for decoding UUENCODE, a block with the language pack TAR archive, unpacking this archive, copying files in the required place, setting up config files and for further removing temporary installation catalogs and files.

  • For example:

    # Copyright (c) 2004 by SWsoft, Inc.
    # All rights reserved
    #
    #ident "@(#)plesk 7.0 04/02/02 SWsoft"

    #
    # Plesk locale pack install script
    #

    # accumulates chown and chmod
    set_ac()
    {
    u_owner="$1"
    g_owner="$2"
    perms="$3"
    node="$4"

    chown $u_owner:$g_owner $node || die "chown $u_owner:$g_owner $node"
    chmod $perms $node || die "chmod $perms $node"
    }

    p_echo()
    {
    echo "$*" >> "$product_log" 2>&1
    echo "$*"
    }
    ...

  • It's required to set a corresponding value for several variables in this block:

    • DISTSIZE=@LOCALE_PACKET_DISTSIZE@ - the required amount of free space on a disk (in KB), for example: DISTSIZE=2048
    • product=@PRODNAME@ - the installation name of the product, the language pack is created for. Here, it is psa.
    • product_bb="@PRODUCT_NAME@"
    • roduct_full="@PRODUCT_FULL_NAME@" - these two variables indicate the trade name of the product. For example, Plesk.
    • support_email=@SUPPORT_EMAIL@ - here is indicated the e-mail address for connecting the support department of the company that created this language pack.
    • sales_email=@SALES_EMAIL@ - the e-mail address of the sales department of the company developed this language pack.  
    • "@PLESK_VERSION@" -here it is necessary to set the Plesk version the language pack is created for. 
    • locale=@LOCALE@ - a short locale name.
    • locale_full=@LOCALE_FULL@ - a full locale name.
    • You may find a more detailed info on names of locales here.

  • create the file structure that would correspond to the future location of language pack files:

    <PRODUCT_ROOT_DIR>/admin
                         /htdocs
                            /locales
                               /<localeID> //e.g. de-DE
                         /plib
                            /locales
                               /<localeID> //e.g. de-DE


    <PRODUCT_ROOT_DIR> - root dir of Plesk installation, e.g. /usr/local/psa

  • rewrite localization files in these directories.

  • create the psa_locale_<localeID>.tar.gz archive to pack the received file structure in.

  • encode this tar.gz file with the help of the UUENCODE utility and add the received code in the SH file body:

  • uuencode psa_locale_de-DE.tar.gz psa_locale_de-DE.ta.gz >> psa_locale_de-DE.sh

As a result, you will receive the file with the following structure:

...
printf "\a\a\a"
p_echo
p_echo
p_echo
p_echo
p_echo " Congratulations!"
p_echo " All stages of installation were successfully completed"
p_echo
p_echo
p_echo " If the number of LP's installed exceeds the number of possible LP's"
p_echo " defined within the key, then the installed Locale packs that exceed"
p_echo " the number defined by the key will not be available via Plesk interface."
p_echo " Please contact your Plesk sales representative in order to purchase"
p_echo " an appropriate key."
p_echo
p_echo

exit 0
begin 644 psa_locale_de_DE.tar.gz
M'XL(`"S=DD$``^Q<6V_<1I;VLWY%P5@@-M!62XID+;**LAI[DO4XL878@8"\
M&-5DJ57=)(O+BQGRT1AC?D.0G^&WK-^L_E_[G5-%LMC=LBZ;\7AV1,"61-;E
MU*ESKW-J<USFV3@R@8S&:2[',HQU,CXK0A/D]K7*QVGTX/C[\9V;/EM;NUO[
M>WOXN?/E[LX^?F[M/]S=II_M<V=[:WMW=V_OX>[>[IVM[?W=A[MWQ-Z-9[S&
M4^:%S(2X,REU%*KLPG:3BS_],S^;5]__,Q6E-R*":^__SM;N]NW^?Y+GNOLO
...

to top