Creating a New cPAddon Script
You will first need to create a script compatible with the cPAddons system if you wish for the script to be accessible from the cPanel interface. To view examples of such scripts, see
http://httpupdate.cpanel.net/cpanelsync/cpaddons/cPanel/.
Assuming we are making a cPAddon for a CMS called "Foo" version 1.0, we would follow these steps:
- Create the working directory, as well as a backup.
- Example:
mkdir Foo_1.0.work && mkdir Foo_1.0.orig
- Put
Foo_1.0.tar.gz into the working directory.
- Untar
Foo_1.0.tar.gz into Foo_1.0.orig/ and Foo_1.0.work/
-
tar xvfz Foo_1.0.tar.gz -C ./Foo_1.0.orig/ && tar xvfz Foo_1.0.tar.gz -C ./Foo_1.0.work/
- Make a directory
Foo/
- Make
Foo.pm and place it into the working directory.
- Modify
Foo_1.0.work/ here as needed.
- Your goal is to get the files necessary for the install all prepped and together.
- Remove any install scripts and upgrade scripts, as this is all handled via the cPAddons interface.
- Prepare any config files. This entails:
- Set appropriate permissions on all the files (world readable config files and world writable directories will result in a much lower security rating).
- Create
Foo/1.0.mysql if needed.
-
Note: The mysql file uses the Config file variables.
- You should also include a use statement at the top. Assuming the
mysql key in the module's $meta_info is 'mysql' => ['foo'],, your mysql file would start like this:
-
| USE [% foo %];|
-
| CREATE TABLE [% table_prefix %]_barbaz (|
- Create
Foo/1.0.tar.gz from Foo_1.0.work/ by issuing the following commands:
-
cd ./Foo_1.0.work
-
tar -cvfz ../Foo/1.0.tar.gz
-
The reason we use cd above is to ensure that the tarball contains the files as they should be in the installation directory.
- Create a file named
Foo/lisc (contains your license verbiage).
- Install on server or distribute through a cPanel Sync server.
Topic revision: r16 - 17 Aug 2011 - 15:26:14 - Main.JustinSchaefer
CpanelAddons.CreatingScripts moved from Sandbox.CreatingScripts on 18 May 2009 - 17:03 by Main.JustinSchaefer