PLESK LANGUAGE PACKS

Section 4.3 LP RPM Format

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

  • 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 SPEC file describing the process of an RPM package creation.

A SPEC file is obligatory for building an RPM package. It includes the package description, instructions on the building process, lists of the files included in the package and lists of third-party applications that need to be installed. A standard SPEC file should look as follows: <package name>-<version number>-<release number>.spec. 

A SPEC file should include info on the path the application will be installed by, the correct built number, version number and application name. 

Note: The Provides section must include the psa-locale-<localeID> name. 

In this case, the package name is psa_locale_<localeID>-<plesk_version>-<language_pack_release>.rpm. 

The example of the SPEC file for a pl-PL language pack (Polish localization)

%define namesrc pl-PL
%define name %{namesrc}

Summary: Polish locale
Name: psa_locale_%{namesrc}
Version: 7.5
Release: 1
Copyright: SWsoft, Inc.
Vendor: SWsoft
Group: Any
Packager: SWSoft Inc <info@sw-soft.com>
BuildRoot: /usr/temp
Prefix: /usr/local/psa
Requires: php
Provides: psa-locale-pl-PL

%description
pl-PL locale

%files
%attr(-, root, root)
%{prefix}/admin/htdocs/locales/%{namesrc}/*
%{prefix}/admin/plib/locales/%{namesrc}/*

%post
%include /usr/src/redhat/SOURCES/locales/install.sh

%changelog
* Fri Oct 26 2004 SWSoft Inc <info@sw-soft.com>
- First build

In the %post section (the post installation stage) it's necessary to provide for the connection of the file, either executable or a script one, responsible for Plesk database update. Database update provides for adding a record to the locales table, corresponding to the installed language pack. See the install.sh file example.

Information on what rights one must have to be able to create an RPM package can be found in the documentation for the used operation system. 

To launch an assembly package, the following command must be executed (on the example of Linux Red Hat):

# rpmbuild --bb  --target=noarch /usr/src/redhat/SPECS/<a spec file name for your locale>.spec

At the end of this utility operation, the message on where the created package is located is displayed. For example, in the Red Hat Linux it can be found in the /usr/src/redhat/RPMS/noarch directory.

to top