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.


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.


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 ../
a list of .so files to be built.
a list of application started from the command line that you need to set up.
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.
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.
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:

list of source codes
additional linker parameters
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.
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
directory in the distribution with results
(each type has a default value)
description of sources for libraries (the list of .cpp files)
description of additional linker parameters
include ../
connect the templates provided by COREmanager for Makefile. Make sure this record exists and stands at the very end.
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.
the directory with source code files. Also, the directory contains the file, which contents will be automatically connected to the main Makefile.


To build our library, 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. в этом случае будут собраны проекты из всех каталогов внутри .


To install the panel, go to the directory with the source code ([mgr5_DIR]/src/mypanel) and execute the make install command. The 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.


To delete all the files, you may execute gmake clean

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