This manual made for help on OpenSCADA building from sources. In process of accumulation of experience of building for different OS Linux distributions and others platforms generally, this document will be complement for tips and details of building for different environments.
The document also contain information about preset configuration of built system of OpenSCADA, for complete start with using of present, included to sources, demo DB (model "AGLKS").
System OpenSCADA direct building
Build system must be executed from normal system user name. Thus described variants of installing and execution how global and local, to user directory. Get what user login is - "user".
Before building enter as common user and change user login to your, get sources (from ftp/http-server or SVN-repository), select install method (global or local) and follow instruction:
Steps of preparation of the source tree to build:
Make directory for project building:
$ mkdir ~/projects; cd ~/projects
Download sources package. It may be made from two ways:
$ svn co svn://oscada.org/trunk/OpenSCADA
$ cd OpenSCADA
Resolve OpenSCADA dependents for build, on according demands. Exclude dependents in case of inability its by help of option --disable-{ModName} into comman "configure" below, for example --disable-SoundCard.
Generate of build system, when download from the SVN-repository:
$ autoreconf -ivf
Steps of global building:
Configuring building system of OpenSCADA:
$ ./configure
Make OpenSCADA project:
$ make
Install OpenSCADA:
$ su; make install
Copy start script and configuration file of demonstration:
Building packages of the OpenSCADA system for the Linux distribution
Redhat-based distributions - RPM package
To build the RPM-package you'll need OpenSCADA sources, resources tarballs and RPM package specification file (openscada.spec, openscada_mod.spec) or SRPM-package of all these source materials (openscada-0.7.1-2.src.rpm), which can be downloaded from ftp or http-server of the project.
Specification file of the RPM-packages and SRPM-package may be different for distributions of Linux, in view of their features, so you should try to load them in accordance with the distribution. If the specific SRPM package is missing you can try to build from the unified specification file in the main SRPM package.
RPM-package building is made in the directory with a special structure, which is normally created when you install the appropriate distribution package (for example: rpm-build). This directory, depending on the distribution, is located in the user's home directory or in the directory /usr/src. The known facts of location the build directory of RPM-packages for different distributions:
If, after the installation of a specialized package, the directory of RPM packages creation is missed, you need to create it with the following command:
$ install -m 755 -d Distribution directory/{SPECS,SOURCES}
Build steps in the RPM specification file:
Placement of OpenSCADA archives and the specification file in the RPM build directory (the source files pre-placed in the current directory):
$ cp openscada-0.7.1.tar.lzma openscada-res-0.7.1.tar.lzma Distribution directory/SOURCES
$ cp openscada.spec Distribution directory/SPECS
Resolving of the OpenSCADA project's dependencies for building in accordance with the requirements. Exclusion of dependencies, in case of failure of their resolving, by turning off the building of unneeded modules with the option --disable-{ModName} to the "configure" command in the "openscada.spec" file, for example: --disable-SoundCard.
Building of packages
build from the beginning:
$ rpmbuild -bb Distribution directory/SPECS/openscada.spec
only the installation and packaging from the etersoft rpm-utilities package (useful when configuring openscada.spec file):
$ rpmbb -i Distribution directory/SPECS/openscada.spec
Packages are ready and available in the directory: Distribution directory/RPMS for the appropriate architecture.
Build steps from the SRPMS package:
Resolving of the OpenSCADA project's dependencies for building in accordance with the requirements.
Building of the packages (the source files pre-placed in the current directory):
$ rpmbuild --rebuild openscada-0.7.1-2.src.rpm
Packages are ready and available in the directory Distribution directory/RPMS for the appropriate architecture.
Debian-based distributions - Deb package
To build the RPM-package you'll need OpenSCADA sources, resources tarballs, which can be downloaded from ftp or http-server of the project.
Deb-package building is made in the "debian" directory with the building scripts, which is contained in the archives of the OpenSCADA sources.
Building steps:
Creation the directory to build the project:
$ mkdir ~/build; cd ~/build
Download the source package. Download the sources and resources tarball from ftp-server of project ftp://ftp.oscada.org/OpenSCADA/ and unpacking, like this:
Resolving of the OpenSCADA project's dependencies for building in accordance with the requirements. Exclusion of dependencies, in case of failure of their resolving, by turning off the building of unneeded modules with the option --disable-{ModName} to the "configure" command in the "openscada-0.7.1/debian/rules" file, for example: --disable-SoundCard.
The transition to the OpenSCADA directory and start the building:
$ cd openscada-0.7.1
build from the beginning:
$ dpkg-buildpackage -rfakeroot
skip the building and repack it is convenient for debugging openscada-0.7.1/debian/rules:
Packages are ready and available in the level above directory.
Gentoo - metadistribution
OpenSCADA is not included to official portage Gentoo tree, so the building is made from the overlay. Details about the work with the overlay can be found in the Gentoo documentation, for example: http://en.gentoo-wiki.com/wiki/Portage_Overlay. Before the building of the OpenSCADA package itself, portage will satisfy dependencies, ie build the missing packages (if necessary).
Creation of the portage overlay reduces to the describing the path to the overlay tree, ie in /etc/make.conf it is necessary to add the line:
PORTDIR_OVERLAY="/usr/local/portage"
Create the directory /usr/local/portage/dev-util/openscada/, then download the ebuild archive file from the official site and unpack it in the created folder.
You must specify the portage, that OpenSCADA is allowed to build on your platform. To do this, put the following line to the file /etc/portage/package.keywords:
dev-util/openscada
Check:
$ emerge -vp openscada These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild R ~] dev-util/openscada-0.7.1 USE="mysql ssl -bfn -blockcalc -daqgate -dbarch -dbase -dcon -demo -diamondboards -doc (-firebird) -flibcomplex1 -flibmath -flibsys -fsarch -http -icp_das -javalikecalc -logiclev -modbus -portaudio -qtcfg -qtstarter -selfsystem -serial -simens -snmp -sockets -sqlite -system -systemtest -vcaengine -vision -webcfg -webcfgd -webvision" 79,647 kB [1]
Total: 1 package (1 reinstall), Size of downloads: 79,647 kB Portage tree and overlays: [0] /usr/portage [1] /usr/local/portage
If you don't have connection to the Internet, you have to download the sources and resources tarball from ftp-server of the project, and place them in advance in the sources directory of the portage (/usr/portage/distfiles). If you have an Internet connection, then everything that is necessary for building will be taken from the project's server automatically.
It is necessary to put the required USE-flags, with which the OpenSCADA will be built. This can be done in the file /etc/portage/package.use, for example:
Database files and resources of OpenSCADA are ready and placed in the directory /var/spool/openscada/, executable files - /usr/bin/, documentation - /usr/share/doc/openscada-0.7.1/.