From 7e068db32ae18d8831ab13d713f05128440cab0b Mon Sep 17 00:00:00 2001 From: Chris Punches Date: Sat, 8 Mar 2025 22:05:13 -0500 Subject: [PATCH] breaking away module development to use only dpmdk --- modules/info/CMakeLists.txt | 34 ++++++++++++++++++++++++++++++++++ modules/info/README.md | 31 +++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 modules/info/CMakeLists.txt create mode 100644 modules/info/README.md diff --git a/modules/info/CMakeLists.txt b/modules/info/CMakeLists.txt new file mode 100644 index 0000000..d5b8593 --- /dev/null +++ b/modules/info/CMakeLists.txt @@ -0,0 +1,34 @@ +cmake_minimum_required(VERSION 3.22) +project(dpm-info-module VERSION 0.1.0) + +# Set C++ standard +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +# Create output directory +file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/modules) + +# Create shared library with the correct naming convention (no prefix) +add_library(info MODULE + info.cpp + src/infoFuncs.cpp +) + +# Set output properties for the module +set_target_properties( + info PROPERTIES + PREFIX "" + SUFFIX ".so" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/modules" +) + +# Include directories based on the actual project structure +target_include_directories(info PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${CMAKE_SOURCE_DIR}/../../dpmdk/include # Path to DPMDK headers outside the module directory +) + +# Installation rules +install(TARGETS info + LIBRARY DESTINATION /usr/lib/dpm/modules +) \ No newline at end of file diff --git a/modules/info/README.md b/modules/info/README.md new file mode 100644 index 0000000..a2ad4b7 --- /dev/null +++ b/modules/info/README.md @@ -0,0 +1,31 @@ +# DPM Module Development + +Modules for the Dark Horse Package Manager (DPM) can be developed independently of the core system. The `info` module in this repository provides a reference implementation. + +## Required Dependencies + +Modules must include the DPMDK headers: + +```cpp +#include +``` + +## Required Functions + +Every module must implement these three functions: + +```cpp +extern "C" const char* dpm_module_get_version(void); +extern "C" const char* dpm_get_description(void); +extern "C" int dpm_module_execute(const char* command, int argc, char** argv); +``` + +See `modules/info/info.cpp` for a working implementation. + +## Building + +See the standalone CMakeLists.txt in the `modules/info` directory as a reference for building independent modules. + +## Configuration + +Standard configuration location: `/etc/dpm/conf.d/` \ No newline at end of file