-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update packaging: add requirements into debian tar.gz files
When using the tar balls - it's problematic sometime, since we don't include the required libraries that are needed to run, and have no way to communicate these to a end user (like a deb or rpm does). This fixes that by adding a "required2tar" target which can be run after "make package", which fixes this problem, by adding the required libraries to the tar ball, just like we do for the windows zip file. Signed-off-by: Robin Getz <rgetz@mathworks.com>
- Loading branch information
Showing
4 changed files
with
110 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,6 +73,7 @@ stages: | |
fi | ||
make | ||
make package | ||
make required2tar | ||
displayName: 'Build' | ||
- task: CopyFiles@2 | ||
inputs: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#!/bin/sh | ||
# should be called from "make required2tar" | ||
set -e | ||
|
||
cd @CMAKE_BINARY_DIR@ | ||
|
||
manifest=./require_manifest.txt | ||
if [ ! -f ${manifest} ] ; then | ||
echo "Can not find manifest at ${manifest}" | ||
exit 1 | ||
fi | ||
|
||
gz=$(ls ./libiio*.tar.gz) | ||
if [ -z "${gz}" ] ; then | ||
echo "try make package first" | ||
exit 1 | ||
fi | ||
if [ "$(echo -n ${gz} | tr -cd ' \t' | wc -c)" -ne "0" ] ; then | ||
echo "too many tar, there should be only one, but found ${gz}" | ||
exit 1 | ||
fi | ||
tar=$(echo ${gz} | sed 's/\.gz$//') | ||
|
||
#unzip the file (can not append while it is gzipped) | ||
#gunzip ${gz} | ||
|
||
# We should be able to just "tar --append -f ${tar} -T manufest.txt, but the tar on | ||
# CenrOS7 doesn't support that - so we we need to split it apart, and add | ||
# files manually. | ||
|
||
if [ -d tarball_fixup ] ; then | ||
rm -rf tarball_fixup | ||
fi | ||
mkdir tarball_fixup | ||
tar -xzf ${gz} -C ./tarball_fixup | ||
|
||
while read -r line | ||
do | ||
if [ -f ${line} ] ; then | ||
echo "adding ${line} to architve" | ||
#make sure the directory exists as a target | ||
mkdir -p ./tarball_fixup$(dirname ${line}) | ||
cp ${line} ./tarball_fixup${line} | ||
|
||
cd ./tarball_fixup$(dirname ${line}) | ||
line=$(basename ${line}) | ||
|
||
until echo ${line} | grep -q \.so.[0-9]*$ | ||
do | ||
tmp=$(echo ${line} | sed 's/\.[0-9]*$//') | ||
if [ ! -f "${tmp}" ] ; then | ||
ln -s ${line} ${tmp} | ||
else | ||
echo "target ${tmp} already exists" | ||
ls -l ${tmp} | ||
fi | ||
line=${tmp} | ||
done | ||
cd @CMAKE_BINARY_DIR@ | ||
|
||
else | ||
echo "could not find ${line} to copy" | ||
exit 1 | ||
fi | ||
done < ${manifest} | ||
|
||
tar -czf ${gz} -C ./tarball_fixup/ . | ||
rm -rf tarball_fixup | ||
|