diff --git a/README.md b/README.md index 03aea8b..02680b7 100644 --- a/README.md +++ b/README.md @@ -166,7 +166,7 @@ You can replicate the commands executed by CI locally, from the rosdistro reposi ``` create_recipes --recipes config/recipes.yaml --recipes-dir ~/workspace/recipes --release-label hotdog --release-track hotdog --debian-version 0.0.0 pull_distro_repositories --src-dir ~/workspace/src --github-key $GITHUB_KEY --rosdistro-index rosdistro/index.yaml --recipes config/recipes.yaml --clean -generate_bundle_templates --src-dir ~/workspace/src --template-dir ~/workspace/templates --recipe ~/workspace/recipes/dev-bionic-hotdog.yaml +generate_bundle_templates --src-dir ~/workspace/src --template-dir ~/workspace/debian --recipe ~/workspace/recipes/dev-bionic-hotdog.yaml ``` diff --git a/tailor_distro/debian_templates/Dockerfile.j2 b/tailor_distro/debian_templates/Dockerfile.j2 index 5fe1d06..c6747f0 100644 --- a/tailor_distro/debian_templates/Dockerfile.j2 +++ b/tailor_distro/debian_templates/Dockerfile.j2 @@ -14,7 +14,7 @@ ENV DEBIAN_FRONTEND noninteractive ENV PYTHONUNBUFFERED 1 RUN apt-get update && apt-get install --no-install-recommends -y \ - locales curl gnupg sudo ccache software-properties-common expect + locales curl gnupg sudo software-properties-common expect rdfind RUN locale-gen en_US.UTF-8 ENV LANG en_US.UTF-8 diff --git a/tailor_distro/debian_templates/rules.j2 b/tailor_distro/debian_templates/rules.j2 index 5d14c8a..e018653 100755 --- a/tailor_distro/debian_templates/rules.j2 +++ b/tailor_distro/debian_templates/rules.j2 @@ -72,8 +72,21 @@ override_dh_strip: # We don't really care about calculating shlibdeps override_dh_shlibdeps: +# Fixup absolute and relative paths for installation target into /opt, don't touch .so libs +# Remove all python bytecode +# Find duplicate files, turn into relative symlinks override_dh_installdeb: - # Fixup absolute and relative paths for installation target into /opt, don't touch .so libs - find . -type f -exec grep -I -q . {} \; -print0 | xargs -0 sed -ri "s|($(CURDIR)/)?debian/tmp/opt|/opt|g" && \ - find . -name '*.pyc' -delete && \ + find $(INSTALL_DIR) -type f -exec grep -I -q . {} \; -print0 | xargs -0 sed -ri "s|($(CURDIR)/)?debian/tmp/opt|/opt|g" && \ + find $(INSTALL_DIR) -name '*.pyc' -delete && \ + rdfind -makesymlinks true $(INSTALL_DIR) && \ + find $(INSTALL_DIR) -type l -exec sh -c ' \ + for link do \ + target=$$(readlink "$$link"); \ + case "$$target" in \ + /*) \ + dir=$$(dirname "$$link"); \ + reltarget=$$(realpath --relative-to="$$dir" "$$target"); \ + ln -sfn "$$reltarget" "$$link";; \ + esac; \ + done' sh {} + && \ dh_installdeb