SUMMARY = "vrpmdv-web recipe"
DESCRIPTION = "Recipe to add vrpmdv-web to it's location."
LICENSE = "CLOSED"
# LICENSE_FLAGS = "commercial"

# inherit allarch perlnative cmake pkgconfig 
inherit perlnative
inherit cmake

DEPENDS += "perl"
DEPENDS += "boost"


# SRC_URI += " \
#    file://rt_service/CMakeLists.txt \
#    file://rt_service/rt_service.cpp \
# "

#TODO ML make a git repo
SRC_URI += " \
    file://rt_service/CMakeLists.txt \
    file://rt_service/zephyr_openamp_rsc_table.elf \
    file://rt_service/include/GILLock.h \        
    file://rt_service/include/IChannelDesc.h \
    file://rt_service/include/ISensorDesc.h \         
    file://rt_service/include/json.hpp \    
    file://rt_service/include/json_fwd.hpp \                
    file://rt_service/include/RelGILLock.h \
    file://rt_service/include/RTSCoproHelper.h \
    file://rt_service/include/RTSErrResult.h \
    file://rt_service/include/RTSMonFrame.h \    
    file://rt_service/include/RTSMonitoringTask.h \    
    file://rt_service/include/RTSPyLogging.h \
    file://rt_service/include/RTSResult.h \
    file://rt_service/include/VibChannelDesc.h \
    file://rt_service/include/VibSensorDesc.h \                        
    file://rt_service/src/rt_service.cpp \
    file://rt_service/src/monitoringTask/RTSErrResult.cpp \            
    file://rt_service/src/monitoringTask/RTSMonFrame.cpp \            
    file://rt_service/src/monitoringTask/RTSMonitoringTask.cpp \                
    file://rt_service/src/monitoringTask/RTSResult.cpp \            
    file://rt_service/src/monitoringTask/VibChannelDesc.cpp \            
    file://rt_service/src/monitoringTask/VibSensorDesc.cpp \            
    file://rt_service/src/utilities/GILLock.cpp \
    file://rt_service/src/utilities/RelGILLock.cpp \        
    file://rt_service/src/utilities/RTSCoproHelper.cpp \
    file://rt_service/src/utilities/RTSPyLogging.cpp \
"


# SRC_URI+="git://gitea.malehr.de/markus.lehr/vrpmdv-py-rtservice.git;protocol=https;branch=master;user=makus.lehr:gQsZ2Qht346yQG;destsuffix=vrpmdv-py-rtservice;name=vrpmdv-py-rtservice"
# SRCREV_vrpmdv-py-rtservice="45380e38b1c0abd7244bd36dd504fb736669a384"


SRC_URI+="git://gitea.malehr.de/markus.lehr/vrpmdv-web.git;protocol=https;branch=master;user=makus.lehr:gQsZ2Qht346yQG;name=vrpmdv-web"
SRCREV_vrpmdv-web="bd3078bdefa3892b3c8714a4d4035391f4984529" 

S = "${WORKDIR}/rt_service"
B = "${WORKDIR}/rt_service/build"



DESTINATION = "/var/www/vrpmdv-web.local"
ELFDESTINATION = "home/root/elffile"

FILES:${PN} += "${DESTINATION}"
FILES:${PN} += "${ELFDESTINATION}"

# do_configure(){
#     set(CMAKE_C_COMPILER_WORKS 1)
# }

# do_compile() {
#
# }

do_install () {
    install -d ${D}${DESTINATION}
    install -d ${D}${DESTINATION}/extensions
    install -d ${D}${DESTINATION}/extensions/rt_service
    install -d ${D}${DESTINATION}/home
    install -d ${D}/home/root
    install -d ${D}/home/root/elffile        

    
    install -d ${D}${DESTINATION}/build
    install -d ${D}${DESTINATION}/build/assets
    install -m 0644 ${WORKDIR}/git/vrpmdvserver/*.py ${D}/${DESTINATION} 
    install -m 0644 ${B}/*.so ${D}/${DESTINATION}/extensions/rt_service
    install -m 0644 ${WORKDIR}/rt_service/*.elf ${D}/${ELFDESTINATION}     
        
    # install -m 0644 ${WORKDIR}/vrpmdv-py-rtservice/*.so ${D}/${DESTINATION}/extensions/rt_service
    
    install -m 0644 ${WORKDIR}/git/vrpmdvserver/webbuild/index.html ${D}/${DESTINATION}/build
    install -m 0644 ${WORKDIR}/git/vrpmdvserver/webbuild/favicon.ico ${D}/${DESTINATION}/build        
    install -m 0644 ${WORKDIR}/git/vrpmdvserver/webbuild/assets/*.js ${D}/${DESTINATION}/build/assets     
}

BBCLASSEXTEND = "native "
# BBCLASSEXTEND =+ "native nativesdk"
# BBCLASSEXTEND =+ "multilib:multilib_name"
RDEPENDS:${PN} += " perl"
RDEPENDS:${PN} += " boost-python"
RDEPENDS:${PN} += " boost"


