Add exiftool as a component tool for workhorse

This commit is contained in:
DJ Mountney 2023-04-07 01:02:09 +00:00 committed by Stan Hu
parent 4c57027790
commit e48a60a78d
9 changed files with 762 additions and 2 deletions

View file

@ -52,7 +52,7 @@ function prepare_ubi_environment() {
yum install -by --nodocs \
autoconf clang-devel cmake gcc gcc-c++ make patch perl bzip2 \
libedit ncurses uuid libarchive curl-devel \
libicu-devel libffi-devel libuuid-devel openssl-devel \
libicu-devel libyaml-devel libedit-devel libffi-devel libuuid-devel openssl-devel \
ncurses-devel pcre2-devel zlib-devel libstdc++-static \
libevent-devel redhat-lsb-core procps-ng

29
scripts/install-exiftool Executable file
View file

@ -0,0 +1,29 @@
#!/bin/bash
set -xeuo pipefail
mkdir build \
&& curl -fsSL "$EXIFTOOL_DOWNLOAD_URL" -o exiftool.tar.gz \
&& echo "$EXIFTOOL_DOWNLOAD_SHA256 exiftool.tar.gz" | sha256sum -c - \
&& tar -C build -xzf exiftool.tar.gz
cd build/exiftool-$EXIFTOOL_VERSION
# Apply patches
patchdir="/patches/exiftool/${EXIFTOOL_VERSION}"
if [[ -d "${patchdir}" ]]; then
for i in "${patchdir}"/*.patch; do
echo "$i..."
patch -p1 -i "$i"
done
else
echo "!! Missing exiftools patch"
echo "!! Make sure the patch exists for exiftool version ${EXIFTOOL_VERSION} before proceeding."
exit 1
fi
perl Makefile.PL \
&& make install \
&& cd ../.. \
&& rm -rf build \
&& rm exiftool.tar.gz

View file

@ -189,6 +189,19 @@ function print_graphicsmagick_args() {
printf -- "--build-arg GRAPHISMAGICK_DOWNLOAD_SHA256=%s " "$GRAPHISMAGICK_DOWNLOAD_SHA256"
}
function print_exiftool_args() {
case "$1" in
12.60)
EXIFTOOL_VERSION=12.60
EXIFTOOL_DOWNLOAD_SHA256=30f22c28905c7aae46986c41cf1f3635781b336c8183b62348198734ffd33366
;;
*) fail "Unknown exiftool version $1" ;;
esac
printf -- "--build-arg EXIFTOOL_VERSION=%s " "$EXIFTOOL_VERSION"
printf -- "--build-arg EXIFTOOL_DOWNLOAD_SHA256=%s " "$EXIFTOOL_DOWNLOAD_SHA256"
}
function print_bazelisk_args() {
case "$1" in
1.9.0)
@ -358,6 +371,7 @@ function parse_arguments() {
YARN) print_yarn_args $version ;;
POSTGRESQL) print_postgres_args $version ;;
GRAPHICSMAGICK) print_graphicsmagick_args $version ;;
EXIFTOOL) print_exiftool_args $version ;;
BAZELISK) print_bazelisk_args $version ;;
GCLOUD) print_gcloud_args $version ;;
KUBECTL) print_kubectl_args $version ;;

View file

@ -2,7 +2,7 @@
# various variable operations used in this script.
PATH_TOOLS=(DEBIAN OS UBI RUBY GOLANG RUST NODE POSTGRESQL)
TAG_TOOLS=(BUNDLER RUBYGEMS GIT LFS CHROME YARN GRAPHICSMAGICK BAZELISK DOCKER GCLOUD KUBECTL HELM)
TAG_TOOLS=(BUNDLER RUBYGEMS GIT LFS CHROME YARN GRAPHICSMAGICK EXIFTOOL BAZELISK DOCKER GCLOUD KUBECTL HELM)
# Generate the docker image path using the components that were specified via
# variables.