Skip to content

Commit

Permalink
remove most of custom packaging scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
jlblancoc committed Oct 25, 2021
1 parent 02ac17f commit 6dbd5c3
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 252 deletions.
13 changes: 8 additions & 5 deletions packaging/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
Utility scripts to ease packaging for Debian, Ubuntu, Windows binaries, etc.
------------------------------------------------------------------------------

The main entry points in this directory are:
The main entry point in this directory is:

- `packaging/prepare_debian.sh`: Generates the `*.orig.tar.gz` tarballs and
sign them.
- `packaging/prepare_release.sh`: Generates the `*.tar.gz` and `*.zip` source
code packages.
- `packaging/make_release.sh`: Generates the `*.tar.gz` and `*.zip` source
code packages. Refer to comments in
[packaging/make_release.sh](packaging/make_release.sh) for the full list of
tasks done.

- `packaging/prepare_ubuntu_pkgs_for_ppa.sh`: Script to generate Ubuntu PPA
packages.

Both above include the git submodules that should go into packages, and removes
those that are not intended to be shipped within Debian packages but which we
Expand Down
19 changes: 0 additions & 19 deletions packaging/append_debian_changelog.sh

This file was deleted.

16 changes: 0 additions & 16 deletions packaging/generate_snapshot_version.sh

This file was deleted.

57 changes: 30 additions & 27 deletions packaging/prepare_release.sh → packaging/make_release.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
#!/bin/bash
# Export sources from a git tree and prepare it for a public release.
# JLBC, 2008-2018
#
# Export sources from a git tree (including SOME of the git submodules) and
# prepare it for a public release:
# - tar.gz, .zip: source code, with Unix / Windows line feeds.
# - gpg signature.
# - Creates SOURCE_DATE_EPOCH. Read https://reproducible-builds.org/docs/source-date-epoch/
# - Compiles the guides into .ps.gz. See list in MRPT/doc/guide-list.txt
#
# JLBC, 2008-2021

set -e # exit on error

# Checks
# Sets the bash variables:
# MRPT_VERSION_STR, MRPT_VER_MMP, MRPT_VER_MM, MRPT_VERSION_{MAJOR,MINOR,PATCH}
# --------------------------------
source packaging/parse_mrpt_version.sh

if [ -f version_prefix.txt ];
then
MRPT_VERSION_MAJOR=${MRPT_VERSION_STR:0:1}
MRPT_VERSION_STR=`head -n 1 version_prefix.txt`
MRPT_VERSION_MAJOR=${MRPT_VERSION_STR:0:1}
MRPT_VERSION_MINOR=${MRPT_VERSION_STR:2:1}
MRPT_VERSION_PATCH=${MRPT_VERSION_STR:4:1}
MRPT_VER_MM="${MRPT_VERSION_MAJOR}.${MRPT_VERSION_MINOR}"
MRPT_VER_MMP="${MRPT_VERSION_MAJOR}.${MRPT_VERSION_MINOR}.${MRPT_VERSION_PATCH}"
echo "MRPT version: ${MRPT_VER_MMP}"
else
echo "ERROR: Run this script from the MRPT root directory."
echo "Error: cannot find version_prefix.txt!! Invoke scripts from mrpt sources root directory."
exit 1
fi

Expand All @@ -38,13 +46,14 @@ mkdir -p ${OUT_DIR}
# Export / copy sources to target dir:
if [ -d "$MRPTSRC/.git" ];
then
echo "# Exporting git source tree to ${OUT_DIR}"
echo "> Exporting git source tree to ${OUT_DIR}"
git archive --format=tar HEAD | tar -x -C ${OUT_DIR}

# Include external submodules:
EXTERNAL_MODS="nanogui nanogui/ext/nanovg googletest libfyaml rplidar_sdk ${MRPT_PKG_EXPORTED_SUBMODULES}"
for MOD in $EXTERNAL_MODS;
do
echo "> Exporting git submodule: ${MRPTSRC}/3rdparty/$MOD"
cd ${MRPTSRC}/3rdparty/$MOD
git archive --format=tar HEAD | tar -x -C ${OUT_DIR}/3rdparty/$MOD
done
Expand All @@ -57,7 +66,7 @@ then
# Generate ./SOURCE_DATE_EPOCH with UNIX time_t
SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)
else
echo "# Copying sources to ${OUT_DIR}"
echo "> Copying sources to ${OUT_DIR}"
cp -R . ${OUT_DIR}

# Generate ./SOURCE_DATE_EPOCH with UNIX time_t
Expand All @@ -69,36 +78,22 @@ echo $SOURCE_DATE_EPOCH > ${OUT_DIR}/SOURCE_DATE_EPOCH

# Compile guides now:
LST_GUIDES=`cat $MRPTSRC/doc/guide-list.txt`
echo "# Building LaTeX documents..."
echo "> Building LaTeX documents..."
for guide in $LST_GUIDES; do
echo "# * Building $guide..."
echo "> * Building $guide..."
make -C $MRPTSRC/doc/$guide/ > /tmp/mrpt_build_latex.log 2>&1
cp $MRPTSRC/doc/$guide/$guide.pdf ${OUT_DIR}/doc/
done

cd ${OUT_DIR}

# Patch for extra External Projects in old Ubuntu PPAs:
TMP_EXTRA_OTHERLIBS="/tmp/mrpt_release_extra_otherlibs.zip"
if [ ! -z "$MRPT_RELEASE_EXTRA_OTHERLIBS_URL" ];
then
if [ ! -f "$TMP_EXTRA_OTHERLIBS" ];
then
wget $MRPT_RELEASE_EXTRA_OTHERLIBS_URL -O $TMP_EXTRA_OTHERLIBS
fi
cp $TMP_EXTRA_OTHERLIBS $MRPT_RELEASE_EXTRA_OTHERLIBS_PATH
fi

# Dont include Debian files in releases:
rm -fR packaging

# Orig tarball:
cd ..
echo "# Creating orig tarball: mrpt-${MRPT_VERSION_STR}.tar.gz"
echo "> Creating source tarball: mrpt-${MRPT_VERSION_STR}.tar.gz"
tar czf mrpt-${MRPT_VERSION_STR}.tar.gz mrpt-${MRPT_VERSION_STR}

# Create .zip file with DOS line endings
echo "# Creating orig zip in DOS format: mrpt-${MRPT_VERSION_STR}.zip"
echo "> Creating source zip in DOS format: mrpt-${MRPT_VERSION_STR}.zip"
cd mrpt-${MRPT_VERSION_STR}
bash scripts/all_files_change_format.sh todos
cd ..
Expand All @@ -108,3 +103,11 @@ rm -fr mrpt-${MRPT_VERSION_STR}

# GPG signature:
gpg --armor --detach-sign mrpt-${MRPT_VERSION_STR}.tar.gz


echo "=================================================================="
echo " Package files generated:"
echo "=================================================================="
find $(pwd)
echo "=================================================================="
echo "You should also do now: \"git clean -fd\" in the source code root"
2 changes: 2 additions & 0 deletions packaging/parse_mrpt_version.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash
# Sets the bash variables:
# MRPT_VERSION_STR, MRPT_VER_MMP, MRPT_VER_MM, MRPT_VERSION_{MAJOR,MINOR,PATCH}

if [ -f version_prefix.txt ];
then
Expand Down
10 changes: 6 additions & 4 deletions packaging/ppa_build_and_upload_all.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash
# Build all Ubuntu PPA packages and upload them.
# JLBC, 2013
# JLBC, 2013-2021
#
# TODO: Update script to work with gdb!

set -e

Expand All @@ -17,10 +19,10 @@ fi
MRPTDIR=`pwd`

# Build PPA packages:
export MRPT_PKG_CUSTOM_CMAKE_PARAMS=""

bash packaging/prepare_ubuntu_pkgs_for_ppa.sh
cd $HOME/mrpt_ubuntu
bash $MRPTDIR/packaging/upload_all_mrpt_ppa.sh

# upload:
find . -name '*.changes' | xargs -I FIL dput ppa:joseluisblancoc/mrpt FIL

exit 0
121 changes: 0 additions & 121 deletions packaging/prepare_debian.sh

This file was deleted.

54 changes: 0 additions & 54 deletions packaging/prepare_fedora.sh

This file was deleted.

4 changes: 1 addition & 3 deletions packaging/prepare_ubuntu_pkgs_for_ppa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
# intention of uploading them to:
# https://launchpad.net/~joseluisblancoc/+archive/mrpt
#
# JLBC, 2010
# [Addition 2012:]
#
# You can declare a variable (in the caller shell) with extra flags for the
# CMake in the final ./configure like:
# MRPT_PKG_CUSTOM_CMAKE_PARAMS="\"-DENABLE_SSE3=OFF\""
#
# TODO: Update script to work with gdb!

set -e

Expand Down
Loading

0 comments on commit 6dbd5c3

Please sign in to comment.