Create Debian and RPM packages from CMakeLists
Packages must have a name, a version, a section, an architecture, a maintainer, a description (long and summary), dependencies Shared libraries must be stripped, have soversion, version (debug symbols are found in separate packages), since MODULE is used instead of SHARED it works as a plugin library which is opened using dlopen-like functionality, see: https://cmake.org/cmake/help/latest/command/add_library.html Packages must have postin and postun scripts Since it is not recommended to modify CMAKE_EXE_LINKER_FLAGS, cmake's path variables are used : https://discourse.cmake.org/t/how-do-i-replace-the-compiler-options-for-one-target/7815/5
This commit is contained in:
+17
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
set -x
|
||||
|
||||
mkdir -p /var/log/lte-log
|
||||
echo "LTE demon-reload:" >> /var/log/lte-log/lte-systemctl.log
|
||||
systemctl daemon-reload >> /var/log/lte-log/lte-systemctl.log 2>&1
|
||||
echo "LTE-SOFTMODEM enable:" >> /var/log/lte-log/lte-systemctl.log
|
||||
systemctl enable lte-softmodem.service >> /var/log/lte-log/lte-systemctl.log 2>&1
|
||||
echo "LTE-SOFTMODEM start:" >> /var/log/lte-log/lte-systemctl.log
|
||||
systemctl start lte-softmodem.service >> /var/log/lte-log/lte-systemctl.log 2>&1
|
||||
# Add ldconfig
|
||||
echo "Running ldconfig..." >> /var/log/lte-log/lte-systemctl.log
|
||||
if command -v ldconfig >> /var/log/lte-log/lte-systemctl.log 2>&1; then
|
||||
ldconfig
|
||||
else
|
||||
echo "Warning: ldconfig not found"
|
||||
fi
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
set -x
|
||||
|
||||
mkdir -p /var/log/lte-log
|
||||
echo "LTE-SOFTMODEM stop:" >> /var/log/lte-log/lte-systemctl.log
|
||||
systemctl stop lte-softmodem.service >> /var/log/lte-log/lte-systemctl.log 2>&1
|
||||
echo "LTE-SOFTMODEM disable:" >> /var/log/lte-log/lte-systemctl.log
|
||||
systemctl disable lte-softmodem.service >> /var/log/lte-log/lte-systemctl.log 2>&1
|
||||
# Then update library cache
|
||||
echo "Running ldconfig after uninstall..." >> /var/log/lte-log/lte-systemctl.log
|
||||
if command -v ldconfig >> /var/log/lte-log/lte-systemctl.log 2>&1; then
|
||||
ldconfig
|
||||
else
|
||||
echo "Warning: ldconfig not found"
|
||||
fi
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
set -x
|
||||
|
||||
mkdir -p /var/log/nr-log
|
||||
echo "NR demon-reload:" >> /var/log/nr-log/nr-systemctl.log
|
||||
systemctl daemon-reload >> /var/log/nr-log/nr-systemctl.log 2>&1
|
||||
echo "NR-CUUP enable:" >> /var/log/nr-log/nr-systemctl.log
|
||||
systemctl enable nr-cuup.service >> /var/log/nr-log/nr-systemctl.log 2>&1
|
||||
echo "NR-CUUP start:" >> /var/log/nr-log/nr-systemctl.log
|
||||
systemctl start nr-cuup.service >> /var/log/nr-log/nr-systemctl.log 2>&1
|
||||
echo "NR-SOFTMODEM enable:" >> /var/log/nr-log/nr-systemctl.log
|
||||
systemctl enable nr-softmodem.service >> /var/log/nr-log/nr-systemctl.log 2>&1
|
||||
echo "NR-SOFTMODEM start:" >> /var/log/nr-log/nr-systemctl.log
|
||||
systemctl start nr-softmodem.service >> /var/log/nr-log/nr-systemctl.log 2>&1
|
||||
# Add ldconfig
|
||||
echo "Running ldconfig..." >> /var/log/nr-log/nr-systemctl.log
|
||||
if command -v ldconfig >> /var/log/nr-log/nr-systemctl.log 2>&1; then
|
||||
ldconfig
|
||||
else
|
||||
echo "Warning: ldconfig not found"
|
||||
fi
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
set -x
|
||||
|
||||
mkdir -p /var/log/nr-log
|
||||
echo "NR-CUUP stop:" >> /var/log/nr-log/nr-systemctl.log
|
||||
systemctl stop nr-cuup.service >> /var/log/nr-log/nr-systemctl.log 2>&1
|
||||
echo "NR-CUUP disable:" >> /var/log/nr-log/nr-systemctl.log
|
||||
systemctl disable nr-cuup.service >> /var/log/nr-log/nr-systemctl.log 2>&1
|
||||
echo "NR-SOFTMODEM stop:" >> /var/log/nr-log/nr-systemctl.log
|
||||
systemctl stop nr-softmodem.service >> /var/log/nr-log/nr-systemctl.log 2>&1
|
||||
echo "NR-SOFTMODEM disable:" >> /var/log/nr-log/nr-systemctl.log
|
||||
systemctl disable nr-softmodem.service >> /var/log/nr-log/nr-systemctl.log 2>&1
|
||||
# Then update library cache
|
||||
echo "Running ldconfig after uninstall..." >> /var/log/nr-log/nr-systemctl.log
|
||||
if command -v ldconfig >> /var/log/nr-log/nr-systemctl.log 2>&1; then
|
||||
ldconfig
|
||||
else
|
||||
echo "Warning: ldconfig not found"
|
||||
fi
|
||||
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
mkdir -p /var/log/oai-log
|
||||
echo "Running ldconfig after package installation/upgrade" 2>&1
|
||||
if command -v ldconfig >> /var/log/oai-log/oai.log 2>&1; then
|
||||
ldconfig
|
||||
else
|
||||
echo "Warning: ldconfig not found"
|
||||
fi
|
||||
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
mkdir -p /var/log/oai-log
|
||||
echo "Running ldconfig after package removal" 2&>1
|
||||
# Only run ldconfig if this is not an apt purge
|
||||
if [ -n "$1" ]; then
|
||||
if [ "$1" != "purge" ]; then
|
||||
echo "Updating linker cache..."
|
||||
echo "Running ldconfig after package installation/upgrade" 2>&1
|
||||
if command -v ldconfig >> /var/log/oai-log/oai.log 2>&1; then
|
||||
ldconfig
|
||||
else
|
||||
echo "Warning: ldconfig not found"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
# Likely running under RPM/dnf: just update linker cache
|
||||
echo "Updating linker cache..."
|
||||
echo "Running ldconfig after package installation/upgrade" 2>&1
|
||||
if command -v ldconfig >> /var/log/oai-log/oai.log 2>&1; then
|
||||
ldconfig
|
||||
else
|
||||
echo "Warning: ldconfig not found"
|
||||
fi
|
||||
fi
|
||||
exit 0
|
||||
Reference in New Issue
Block a user