Once the skin contents are prepared, you need to create a skin package in order to be able to install your skin into the control panel. It is recommended that you use your favorite archiver software to pack all the skin files and directories in a zip or tar.gz archive, and then simply upload the created archive file to the control panel's skins repository. If desired, you can create a skin rpm package; to do this, follow the instructions provided below.
The first thing you need to do is to create a temporary build directory. It can be located anywhere on your hard disk. Let it be /tmp/skin_builds/ for example:
# mkdir /tmp/skin_build
Next, inside the temporary build directory create the complete path to where the skin will be located when installed in Plesk.
The RPM spec (specification) file contains data required for building the RPM package. Below is a sample spec file that could be used for the skin considered in our example. In this sample file:
# name of your skin to be called in CP # quote it by the "shell" rules if it contains spaces or special characters %define skinname 'My Skin' # directory where to place your skin # you may use any sequence of alphanumeric characters and underscores %define skindir my_skin # path where files of your skin is located %define source /tmp/my_skin Name: MySkin Version: 0.0.1 Release: 1 License: BSD Group: Applications/Internet Summary: Example spec for Plesk # END of customizable part # you can leave the following unchanged in most cases Buildroot: /var/tmp/build-%{name}-%{version} Provides: plesk-skin Requires: psa >= 7.5 %define pleskdir /usr/local/psa/admin %define pleskskins %{pleskdir}/htdocs/skins %install rm -rf $RPM_BUILD_ROOT%{pleskskins}/%{skindir} mkdir -p $RPM_BUILD_ROOT%{pleskskins} umask 022 cp -r %{source} $RPM_BUILD_ROOT%{pleskskins}/%{skindir} %clean test $RPM_BUILD_ROOT != / rm -rf $RPM_BUILD_ROOT%{pleskskins}/%{skindir} %description This is a sample skin for Plesk 7.5 Reloaded™ %pre %{pleskdir}/sbin/skinmng --test-install-directory --installdir=%{skindir} %post %{pleskdir}/sbin/skinmng --register --installdir=%{skindir} --name=%{skinname} %preun %{pleskdir}/sbin/skinmng --remove --installdir=%{skindir} --leave-files %files %defattr(-,root,root) %{pleskskins}/%{skindir}/
To complete preparing the spec file for the custom skin from our example (my_skin), the above items need to be replaced with proper values.
Once you have the temporary build directory with the skin files all set and the spec file complete you can proceed to building the RPM package for your skin.
You must be logged in as root to build the RPM package.
Execute the following command:
# rpmbuild -bb SKIN.spec
Here SKIN.spec should be replaced with the name of your custom skin spec file described in the previous section.
Once the process of building the RPM package is complete you will find the package (in our example it will be MySkin-0.0.1-1.noarch.rpm) in the following directory: /usr/src/redhat/RPMS/noarch.