84 lines
2.3 KiB
Bash
84 lines
2.3 KiB
Bash
#!/bin/bash
|
|
# RTI Connext DDS DEB Package Build Script
|
|
# Builds librti-connext-dds-7.7.0-dev DEB package for internal SCM repository
|
|
|
|
set -e
|
|
|
|
PACKAGE_NAME="librti-connext-dds-7.7.0-dev"
|
|
VERSION="7.7.0"
|
|
ARCHITECTURE="amd64"
|
|
MAINTAINER="Legatus Team <legatus@defence-elec.de>"
|
|
DESCRIPTION="RTI Connext DDS 7.7.0 Pro - development files (commercial license)"
|
|
|
|
# Create package structure
|
|
DEB_DIR="deb-package"
|
|
rm -rf "$DEB_DIR"
|
|
mkdir -p "$DEB_DIR/DEBIAN"
|
|
mkdir -p "$DEB_DIR/opt/rti_connext_dds-7.7.0"
|
|
mkdir -p "$DEB_DIR/opt/offline-cache/rti"
|
|
|
|
# Copy RTI files from external/rti_connext_dds-7.7.0
|
|
if [ -d "../../external/rti_connext_dds-7.7.0" ]; then
|
|
cp -r ../../external/rti_connext_dds-7.7.0/* "$DEB_DIR/opt/rti_connext_dds-7.7.0/"
|
|
fi
|
|
|
|
# Copy license file
|
|
if [ -f "../../../rti_license.dat" ]; then
|
|
cp ../../../rti_license.dat "$DEB_DIR/opt/rti_connext_dds-7.7.0/rti_license.dat"
|
|
fi
|
|
|
|
# Create control file
|
|
cat > "$DEB_DIR/DEBIAN/control" << EOF
|
|
Package: $PACKAGE_NAME
|
|
Version: $VERSION
|
|
Architecture: $ARCHITECTURE
|
|
Maintainer: $MAINTAINER
|
|
Depends: libqt6core6, libqt6gui6, libqt6widgets6, libstdc++6, libc6
|
|
Section: libdevel
|
|
Priority: optional
|
|
Description: $DESCRIPTION
|
|
RTI Connext DDS 7.7.0 Pro for Legatus.
|
|
.
|
|
License: Commercial FlexLM license
|
|
License file: /opt/rti_connext_dds-7.7.0/rti_license.dat
|
|
Set RTI_LICENSE_FILE environment variable.
|
|
EOF
|
|
|
|
# Create postinst script
|
|
cat > "$DEB_DIR/DEBIAN/postinst" << 'EOF'
|
|
#!/bin/bash
|
|
set -e
|
|
|
|
echo "RTI Connext DDS DEB package installed successfully"
|
|
echo "License: Commercial FlexLM license"
|
|
echo "License file: /opt/rti_connext_dds-7.7.0/rti_license.dat"
|
|
echo "Set RTI_LICENSE_FILE environment variable to use the library."
|
|
|
|
# Set permissions
|
|
chmod -R 755 /opt/rti_connext_dds-7.7.0
|
|
|
|
exit 0
|
|
EOF
|
|
|
|
chmod 755 "$DEB_DIR/DEBIAN/postinst"
|
|
|
|
# Create postrm script
|
|
cat > "$DEB_DIR/DEBIAN/postrm" << 'EOF'
|
|
#!/bin/bash
|
|
set -e
|
|
|
|
echo "RTI Connext DDS DEB package removed"
|
|
|
|
exit 0
|
|
EOF
|
|
|
|
chmod 755 "$DEB_DIR/DEBIAN/postrm"
|
|
|
|
# Build DEB package
|
|
echo "Building DEB package: ${PACKAGE_NAME}_${VERSION}_${ARCHITECTURE}.deb"
|
|
cd "$DEB_DIR"
|
|
dpkg-deb --build . "../${PACKAGE_NAME}_${VERSION}_${ARCHITECTURE}.deb"
|
|
cd ..
|
|
|
|
echo "DEB package created: ${PACKAGE_NAME}_${VERSION}_${ARCHITECTURE}.deb"
|
|
echo "Size: $(du -h ${PACKAGE_NAME}_${VERSION}_${ARCHITECTURE}.deb | cut -f1)" |