RPM

The MARTe2 core and MARTe2 components are packaged as RPM files. They can be installed individually or by installing the target specific YUM release RPM (look for RPM files named release).

Building the RPM from sources

The MARTe2 core and components RPM files can be built by issuing the command make -f Makefile.rpmbuild.

Project specific RPM

A project specific RPM can be built using the rpmbuild MakeDefaults definitions and rules.

The following is an example of a project specific RPM Makefile:

TARGET=rpmbuild
ROOT_DIR=.

FOLDERSX?=Source.x Makefile.x86-linux.x Makefile.inc.x Startup.x Configurations.x

MARTe2_MAKEDEFAULT_DIR?=$(MARTe2_DIR)/MakeDefaults

#If not set try to get the project version from a git tag (in the format vx.y, i.e. assuming it starts with v)
M2_RPM_VERSION?=$(shell git tag | sort -V | tail -1 | cut -c2-)
M2_RPM_NAME?=SUPITA
M2_RPM_ID?=supita
M2_RPM_REQUIRES=marte2-core marte2-components marte2-components-ccs
M2_RPM_SPEC_FILE_PATH=$(MARTe2_DIR)/Resources/RPM/

#If not specified, the MakeDefaults behaviour is to get the latest tag from git
#M2_RPM_VERSION=dev$(shell git rev-parse --short HEAD)

#Project specific folders that are to be installed. It really has to be escaped with a space.
M2_RPM_OTHER_FOLDERS=Startup\ Configurations
#Get current CODAC version
CODAC_CCS=`codac-version | cut -c 1,3`
#If not set it will default to standard OS (e.g. el7)
M2_RPM_CUSTOM_DIST="ccs$(CODAC_CCS)"

include $(MARTe2_MAKEDEFAULT_DIR)/MakeStdLibDefs.$(TARGET)

all: $(OBJS) $(BUILD_DIR)/$(M2_RPM_ID)-$(M2_RPM_VERSION).rpm check-env
      echo  $(OBJS)

check-env:
ifndef MARTe2_DIR
    $(error MARTe2_DIR is undefined)
endif
ifndef MARTe2_Components_DIR
    $(error MARTe2_Components_DIR is undefined)
endif

include $(MARTe2_MAKEDEFAULT_DIR)/MakeStdLibRules.$(TARGET)