Building custom components

From ISPWiki
Jump to: navigation, search

You may build custom components in a manner that fits you best. Or you can use Ubix Makefile materials provided by COREmamager. The files are located in the src directory.

UNIX

If you want to build programs using our libraries, you will need a compiler supporting c++0x. You should use gcc 4.4. or later, and GNU make to be able to use our makefile.

Makefile

To use our makefile, create a new directory in the src directory. A directory name should match the name of the control panel that you are developing, for correct upload. For example: mypanel. Create the Makefile file with the following contents in that directory:

LIB += mypanel
mypanel_SOURCES = mypanel.cpp
mypanel_LDADD = -lbase
#mypanel_LDADD = -rdynamic
#WRAPPER += some_command_line_tool
#XMLLIST += some_xml
#XMLPATH = my_xml_path

include ../isp.mk
LIB
a list of .so files to be built.
SBIN
a list of application started from the command line that you need to set up.
WRAPPER
the same as SBIN - a list of application started from the command line that you need to set up
In COREmanager all the console applications are represented as .so files located in the libexec directory. They are started by the sbin/wrapper program. All binary files in the sbin directory are links to the wrapper file.
XMLPATH
the directoy where standard XML files are located. They are <panel name>.xml, <panel name>_menu.xml and <panel name>_msg_*.xml. By default, makefile tries to locate the files in the xml directory, if any. If the xml directory doesn't exist - in the current directory.
<panel name>.xml contains desciption of forms and lists metadata.
<panel name>_menu.xml contains desciption of the main manu for different user roles.
files <panel name>_msg_*.xml contains description of languages, one per language.
PKGCTL
programs that are started by the installer.

You can provide the following parameters for every name, which was added into one of the above variables:

<name>_SOURCES
list of source codes
<name>_LDADD
additional linker parameters
<name>_SLIB
libraries included into the product and activated statically. Unlike the libraries specified in LDADD, the libraries listed in this variable will be set up automatically.
<name>_DLIB
libraries included into the product and connected dynamically. Unlike libraries specified in LDADD, the libraries listed in this variable will be set up automatically and included into the product's distribution
<name>_FOLDER
directory in the distribution with results
(each type has a default value)
mypanel_SOURCES
description of sources for libraries (the list of .cpp files)
mypanel_LDADD
description of additional linker parameters
include ../isp.mk
connect the templates provided by COREmanager for Makefile. Make sure this record exists and stands at the very end.
XMLLIST
the list of additional xml files with metadata describing the interface of your control panel. XMLPATH doesn't affect these files. The list may contain file templates, where '*' is any number of arbitrary symbols.
SUBDIR
the directory with source code files. Also, the directory contains the Makefile.inc file, which contents will be automatically connected to the main Makefile.

Build

To build our library mypanel.so, you only need to execute gmake in the src/mypanel directory. Or in the srcdirectory, in this case the projects from all the directories inside src will be set up. в этом случае будут собраны проекты из всех каталогов внутри .

Installation

To install the panel, go to the directory with the source code ([mgr5_DIR]/src/mypanel) and execute the make install command. The mypanel.so library will be copied into the lib directory.

For WRAPPER applications, the file will be copied into the libexec directory, and the corresponding link to wrapper will be made in sbin.

The corresponding control panel will be automatically restarted.

Deletion

To delete all the files, you may execute gmake clean

This command wont' delete the files that were created during setup.