Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rebuild debian docker stuff #712

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
lmod (8.7.44) unstable; urgency=medium

* Setting TAG_VERSION to 8.7.44

-- Lmod automatic deb changelog script <[email protected]> Fri, 12 Jul 2024 11:44:00 -0400


lmod (8.7.34) unstable; urgency=medium

* Setting TAG_VERSION to 8.7.34
Expand Down
57 changes: 57 additions & 0 deletions debian/debuild.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/bin/bash
# create a debian docker container, build Lmod in that container, copy the build files to
# a new directory, and print the path to that new directory.
set -e

image_name="debuild-image"
ct_name="lmod-debuild"
repo_dir="$(dirname "$(dirname "$(realpath "$0")")")"
dockerfile_path="$(mktemp)"
output_dir_path="$(mktemp -d)"

cat >"$dockerfile_path" <<'EOF'
FROM debian:12

# Optionally, add incoming to sources.list
#RUN echo 'deb http://incoming.debian.org/debian-buildd buildd-unstable main contrib non-free' > /etc/apt/sources.list.d/incoming.list

# Add deb-src to sources.list
RUN find /etc/apt/sources.list* -type f -exec sed -i 'p; s/^deb /deb-src /' '{}' +

# Install developer tools
RUN apt-get update \
&& apt-get install --no-install-recommends -yV \
apt-utils \
build-essential \
devscripts \
equivs \
devscripts \
autoconf \
automake \
autopoint \
autotools-dev \
debhelper \
dh-autoreconf \
dh-strip-nondeterminism \
dwz \
libdebhelper-perl \
libfile-stripnondeterminism-perl \
libsub-override-perl \
libtool \
po-debconf \
quilt \
bc

# recursive copy all files into container. Bind mount can cause unwanted changes in cwd.
COPY . /lmod/src
# install dependencies from the debian control file
RUN mk-build-deps --install --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' /lmod/src/debian/control

EOF

cd "$repo_dir" # required for relative path inside dockerfile
docker build . --tag="$image_name" --file="$dockerfile_path"
docker run --name="$ct_name" --workdir="/lmod/src" "$image_name" debuild -us -uc -b
docker cp "$ct_name:/lmod/" "$output_dir_path/"
docker rm "$ct_name"
echo "output files have been copied to \"$output_dir_path\"."
4 changes: 2 additions & 2 deletions debian/files
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
lmod_8.7.34_all.deb devel optional
lmod_8.7.34_amd64.buildinfo devel optional
lmod_8.7.44_all.deb devel optional
lmod_8.7.44_arm64.buildinfo devel optional
45 changes: 45 additions & 0 deletions debian/update-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/bash
# update the debian files based on the latest git tag.
set -e

cd "$(dirname "$(realpath "$0")")" # go to the directory where this script exists

git remote -v | grep -q -e '^upstream.*TACC/Lmod' || (
echo "in order to get the latest version number, the official TACC repo must be an upstream."
echo "example: \`git remote add upstream https://github.com/TACC/Lmod.git\`"
exit 1
)

git fetch --tags
latest_tag="$(git rev-list --tags --max-count=1)"
latest_version="$(git describe --tags "$latest_tag")"
echo "Version is $latest_version"

if head -n1 ./changelog | grep $latest_version; then
echo "Latest version already in deb changelog. I should not do a thing"
exit 0
fi

echo "It's not the latest version. Adding a new tag to changelog"

### Adding a new changelog entry. Yes, I use ex

ex ./changelog <<EOM
1 insert
lmod ($latest_version) unstable; urgency=medium

* Setting TAG_VERSION to $latest_version

-- Lmod automatic deb version script <[email protected]> $(date -R)


.
xit
EOM

### Adding the filenames to debian/files with correct version

cat >./files <<EOM
lmod_${latest_version}_all.deb devel optional
lmod_${latest_version}_amd64.buildinfo devel optional
EOM
53 changes: 0 additions & 53 deletions docker/Dockerfile

This file was deleted.

60 changes: 0 additions & 60 deletions docker/build.sh

This file was deleted.

Loading