Merge pull request #1574 from JulianGro/server_packaging
Fix Debian and RPM server packaging
This commit is contained in:
commit
a7a341e2b6
31
INSTALLER.md
31
INSTALLER.md
@ -186,30 +186,23 @@ Overte Interface AppImages are built using [linuxdeploy](https://github.com/linu
|
|||||||
```bash
|
```bash
|
||||||
cd overte
|
cd overte
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
rm -rf build/*
|
||||||
rm -rf *
|
conan install . -s build_type=Release -b missing -pr:b=default -of build
|
||||||
```
|
```
|
||||||
Add `PRODUCTION_BUILD=1` to below command for release and release candidate builds.
|
Add `PRODUCTION_BUILD=1` to below command for release and release candidate builds.
|
||||||
```bash
|
```bash
|
||||||
OVERTE_USE_SYSTEM_QT=true cmake .. -DOVERTE_CPU_ARCHITECTURE=-msse3 -DVCPKG_BUILD_TYPE=release -DSERVER_ONLY=true -DBUILD_TOOLS=true
|
cmake --preset conan-release -DOVERTE_CPU_ARCHITECTURE=-msse3
|
||||||
```
|
```
|
||||||
|
|
||||||
4. Build
|
4. Build
|
||||||
```bash
|
```bash
|
||||||
make domain-server assignment-client oven -j$(nproc)
|
cmake --build --preset conan-release --target domain-server assignment-client oven
|
||||||
```
|
```
|
||||||
|
|
||||||
5. Create Debian package
|
5. Create Debian package
|
||||||
```bash
|
```bash
|
||||||
cd ../pkg-scripts
|
cd pkg-scripts
|
||||||
```
|
DEBVERSION="1-experimental-debian-11" DEBEMAIL="julian.gro@overte.org" DEBFULLNAME="Julian Groß" ./make-deb-server
|
||||||
For Debian 11 and Ubuntu 22.04:
|
|
||||||
```bash
|
|
||||||
OVERTE_USE_SYSTEM_QT="true" DEBVERSION="1-experimental-debian-11" DEBEMAIL="julian.gro@overte.org" DEBFULLNAME="Julian Groß" ./make-deb-server
|
|
||||||
```
|
|
||||||
For Ubuntu 18.04 and 20.04:
|
|
||||||
```bash
|
|
||||||
DEBVERSION="1-experimental-ubuntu-18.04" DEBEMAIL="julian.gro@overte.org" DEBFULLNAME="Julian Groß" ./make-deb-server
|
|
||||||
```
|
```
|
||||||
|
|
||||||
##### RPM package
|
##### RPM package
|
||||||
@ -225,23 +218,23 @@ DEBVERSION="1-experimental-ubuntu-18.04" DEBEMAIL="julian.gro@overte.org" DEBFUL
|
|||||||
```bash
|
```bash
|
||||||
cd overte
|
cd overte
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
rm -rf build/*
|
||||||
rm -rf *
|
conan install . -s build_type=Release -b missing -pr:b=default -of build
|
||||||
```
|
```
|
||||||
Add `PRODUCTION_BUILD=1` to below command for release and release candidate builds.
|
Add `PRODUCTION_BUILD=1` to below command for release and release candidate builds.
|
||||||
```bash
|
```bash
|
||||||
OVERTE_USE_SYSTEM_QT=true cmake .. -DOVERTE_CPU_ARCHITECTURE=-msse3 -DVCPKG_BUILD_TYPE=release -DSERVER_ONLY=true -DBUILD_TOOLS=true
|
cmake --preset conan-release -DOVERTE_CPU_ARCHITECTURE=-msse3 -DSERVER_ONLY=true -DBUILD_TOOLS=true
|
||||||
```
|
```
|
||||||
|
|
||||||
4. Build
|
4. Build
|
||||||
```bash
|
```bash
|
||||||
make domain-server assignment-client oven -j$(nproc)
|
cmake --build --preset conan-release --target domain-server assignment-client oven
|
||||||
```
|
```
|
||||||
|
|
||||||
5. Create RPM package
|
5. Create RPM package
|
||||||
```bash
|
```bash
|
||||||
cd ../pkg-scripts
|
cd pkg-scripts
|
||||||
```
|
```
|
||||||
```bash
|
```bash
|
||||||
OVERTE_USE_SYSTEM_QT="true" RPMVERSION="1.experimental" ./make-rpm-server
|
RPMVERSION="1.experimental" ./make-rpm-server
|
||||||
```
|
```
|
||||||
|
@ -5,14 +5,14 @@
|
|||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
if [ "$OVERTE" = "" ]; then
|
if [ "$OVERTE" = "" ]; then
|
||||||
OVERTE=`realpath ..`
|
OVERTE=`realpath ..`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sudo apt-get install chrpath binutils dh-make
|
sudo apt-get install chrpath binutils dh-make
|
||||||
|
|
||||||
DEB_BUILD_ROOT=temp-make-deb/overte-server_$DEBVERSION
|
DEB_BUILD_ROOT=temp-make-deb/overte-server_$DEBVERSION
|
||||||
if [ -d temp-make-deb ]; then
|
if [ -d temp-make-deb ]; then
|
||||||
rm -r temp-make-deb
|
rm -r temp-make-deb
|
||||||
fi
|
fi
|
||||||
mkdir -p $DEB_BUILD_ROOT
|
mkdir -p $DEB_BUILD_ROOT
|
||||||
|
|
||||||
@ -25,10 +25,10 @@ chrpath -d $DEB_BUILD_ROOT/*
|
|||||||
|
|
||||||
# TODO: get Qt from Conan if building without system Qt
|
# TODO: get Qt from Conan if building without system Qt
|
||||||
|
|
||||||
# hack: we get libnode.so.108 from conan-libs folder, because the dpkg command at the end of this file cannot always find libnode
|
# Hack: Create libnode.so from libnode.so.108
|
||||||
cp $OVERTE/build/conanlibs/Release/libnode.so.108 $DEB_BUILD_ROOT
|
# We don't fail on error, in case libnode is provided by the system already.
|
||||||
# hack: we get libttb.so.12 from conan-libs folder, because the dpkg command at the end of this file cannot always find libtbb12
|
ln -s $OVERTE/build/conanlibs/Release/libnode.so.* $OVERTE/build/conanlibs/Release/libnode.so || True
|
||||||
cp $OVERTE/build/conanlibs/Release/libttb.so.12 $DEB_BUILD_ROOT
|
cp $OVERTE/build/conanlibs/Release/*.so $DEB_BUILD_ROOT
|
||||||
|
|
||||||
strip --strip-all $DEB_BUILD_ROOT/*
|
strip --strip-all $DEB_BUILD_ROOT/*
|
||||||
cp $OVERTE/pkg-scripts/new-server $DEB_BUILD_ROOT
|
cp $OVERTE/pkg-scripts/new-server $DEB_BUILD_ROOT
|
||||||
@ -68,27 +68,24 @@ echo domain-server opt/overte >> debian/install
|
|||||||
echo oven opt/overte >> debian/install
|
echo oven opt/overte >> debian/install
|
||||||
echo new-server opt/overte >> debian/install
|
echo new-server opt/overte >> debian/install
|
||||||
for so in *.so*; do
|
for so in *.so*; do
|
||||||
echo $so opt/overte/lib >> debian/install
|
echo $so opt/overte/lib >> debian/install
|
||||||
done
|
done
|
||||||
#for service in *.service; do
|
#for service in *.service; do
|
||||||
# echo $service opt/overte/systemd >> debian/install
|
# echo $service opt/overte/systemd >> debian/install
|
||||||
#done
|
#done
|
||||||
#for target in *.target; do
|
#for target in *.target; do
|
||||||
# echo $target opt/overte/systemd >> debian/install
|
# echo $target opt/overte/systemd >> debian/install
|
||||||
#done
|
#done
|
||||||
find resources -type f -exec sh -c 'echo {} opt/overte/$(dirname "{}") >> debian/install' \;
|
find resources -type f -exec sh -c 'echo {} opt/overte/$(dirname "{}") >> debian/install' \;
|
||||||
find plugins -type f -exec sh -c 'echo {} opt/overte/$(dirname "{}") >> debian/install' \;
|
find plugins -type f -exec sh -c 'echo {} opt/overte/$(dirname "{}") >> debian/install' \;
|
||||||
|
|
||||||
if [ ! "$OVERTE_USE_SYSTEM_QT" ]; then
|
# We look for *.so.*.*.* as well, in case Qt is there.
|
||||||
SOFILES=`ls *.so *.so.*.*.* | grep -Po '^(.+\.so(\.\d+)?)' | sed 's/\./\\\./g' | paste -d'|' -s`
|
SOFILES=`ls *.so *.so.*.*.* | grep -Po '^(.+\.so(\.\d+)?)' | sed 's/\./\\\./g' | paste -d'|' -s`
|
||||||
else
|
|
||||||
SOFILES=`ls *.so | grep -Po '^(.+\.so(\.\d+)?)' | sed 's/\./\\\./g' | paste -d'|' -s`
|
|
||||||
fi
|
|
||||||
|
|
||||||
# dpkg -S can only find packages which are already installed on the system.
|
# dpkg -S can only find packages which are already installed on the system.
|
||||||
DEPENDS=`find * -path debian -prune -o -type f -executable -exec sh -c 'objdump -p {} | grep NEEDED' \; \
|
DEPENDS=`find * -path debian -prune -o -type f -executable -exec sh -c 'objdump -p {} | grep NEEDED' \; \
|
||||||
| awk '{print $2}' | sort | uniq | egrep -v "^($SOFILES)$" \
|
| awk '{print $2}' | sort | uniq | egrep -v "^($SOFILES)$" \
|
||||||
| xargs -n 1 -I {} sh -c 'dpkg -S {} | head -n 1' | cut -d ':' -f 1 | sort | uniq | paste -d',' -s`
|
| xargs -n 1 -I {} sh -c 'dpkg -S {} | head -n 1' | cut -d ':' -f 1 | sort | uniq | paste -d',' -s`
|
||||||
|
|
||||||
cp $OVERTE/pkg-scripts/server-rules debian/rules
|
cp $OVERTE/pkg-scripts/server-rules debian/rules
|
||||||
sed "s/{DEPENDS}/$DEPENDS/" $OVERTE/pkg-scripts/server-control > debian/control
|
sed "s/{DEPENDS}/$DEPENDS/" $OVERTE/pkg-scripts/server-control > debian/control
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
if [ "$OVERTE" = "" ]; then
|
if [ "$OVERTE" = "" ]; then
|
||||||
OVERTE=`realpath ..`
|
OVERTE=`realpath ..`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Remove minus character from version numbers, because rpmtool doesn't allow them.
|
# Remove minus character from version numbers, because rpmtool doesn't allow them.
|
||||||
@ -13,30 +13,32 @@ VERSION=${RPMVERSION//-}
|
|||||||
|
|
||||||
# TODO: Handle Qt built by Conan
|
# TODO: Handle Qt built by Conan
|
||||||
|
|
||||||
|
# Hack: Create libnode.so from libnode.so.108
|
||||||
|
# We don't fail on error, in case libnode is provided by the system already.
|
||||||
|
ln -s $OVERTE/build/conanlibs/Release/libnode.so.* $OVERTE/build/conanlibs/Release/libnode.so || True
|
||||||
SOFILES=`ls \
|
SOFILES=`ls \
|
||||||
$OVERTE/build/libraries/*/*.so \
|
$OVERTE/build/libraries/*/*.so \
|
||||||
$OVERTE/build/conanlibs/Release/libnode.so* \
|
$OVERTE/build/conanlibs/Release/*.so \
|
||||||
| sed 's/\./\\\./g' \
|
| sed 's/\./\\\./g' \
|
||||||
| paste -d'|' -s`
|
| paste -d'|' -s`
|
||||||
|
|
||||||
DEPENDS=mesa-libGL,`ls \
|
DEPENDS=mesa-libGL,`ls \
|
||||||
$OVERTE/build/assignment-client/assignment-client \
|
$OVERTE/build/assignment-client/assignment-client \
|
||||||
$OVERTE/build/domain-server/domain-server \
|
$OVERTE/build/domain-server/domain-server \
|
||||||
$OVERTE/build/tools/oven/oven \
|
$OVERTE/build/tools/oven/oven \
|
||||||
$OVERTE/build/libraries/*/*.so \
|
$OVERTE/build/libraries/*/*.so \
|
||||||
$OVERTE/build/conanlibs/Release/libnode.so* \
|
$OVERTE/build/conanlibs/Release/*.so \
|
||||||
$OVERTE/build/conanlibs/Release/libtbb.so* \
|
$OVERTE/build/assignment-client/plugins/*.so \
|
||||||
$OVERTE/build/assignment-client/plugins/*.so \
|
$OVERTE/build/assignment-client/plugins/*/*.so \
|
||||||
$OVERTE/build/assignment-client/plugins/*/*.so \
|
| xargs -I {} sh -c 'objdump -p {} | grep NEEDED' \
|
||||||
| xargs -I {} sh -c 'objdump -p {} | grep NEEDED' \
|
| awk '{print $2}' \
|
||||||
| awk '{print $2}' \
|
| sort | uniq \
|
||||||
| sort | uniq \
|
| grep -E -v "^($SOFILES)$" \
|
||||||
| grep -E -v "^($SOFILES)$" \
|
| grep -v ^libGL \
|
||||||
| grep -v ^libGL \
|
| xargs -I {} sh -c "ldconfig -p | grep {} | tr ' ' '\n' | grep /" \
|
||||||
| xargs -I {} sh -c "ldconfig -p | grep {} | tr ' ' '\n' | grep /" \
|
| xargs rpm -qf --queryformat "%{NAME}\n" \
|
||||||
| xargs rpm -qf --queryformat "%{NAME}\n" \
|
| sort | uniq \
|
||||||
| sort | uniq \
|
| paste -d',' -s`
|
||||||
| paste -d',' -s`
|
|
||||||
|
|
||||||
sudo yum install chrpath
|
sudo yum install chrpath
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user