diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 21f009c..8a5493c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,7 +46,7 @@ jobs: echo "imagemagick_release=$(cat ./release-version)" >> $GITHUB_OUTPUT - name: Prepare image - run: docker build . -t buildenv --build-arg BASE_IMAGE=${{ matrix.base_image }} + run: docker build . -t buildenv --build-arg BASE_IMAGE=${{ matrix.base_image }} --build-arg NOAGPL=true working-directory: rpms - name: Build and Install diff --git a/README.md b/README.md index a7bc988..f39d09d 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ This repo is building ImageMagick v7 deb/rpm packages for multiple distributions * RockyLinux 9 (x86_64 and aarch64) * RockyLinux 8 (x86_64 and aarch64) +* RockyLinux 8 (x86_64 without AGPL licensed dependencies) * Ubuntu 22.04 (x86_64 only) * Ubuntu 20.04 (x86_64 only) * Ubuntu 18.04 (x86_64 only) diff --git a/debs/config.json b/debs/config.json index 6a68a01..478832a 100755 --- a/debs/config.json +++ b/debs/config.json @@ -5,30 +5,15 @@ "target_arch": "x86_64", "nexus_classifier": "ub2204-amd64" }, - { - "base_image": "ubuntu:22.04", - "target_arch": "aarch64", - "nexus_classifier": "ub2204-arm64" - }, { "base_image": "ubuntu:20.04", "target_arch": "x86_64", "nexus_classifier": "ub2004-amd64" }, - { - "base_image": "ubuntu:20.04", - "target_arch": "aarch64", - "nexus_classifier": "ub2004-arm64" - }, { "base_image": "ubuntu:18.04", "target_arch": "x86_64", "nexus_classifier": "ub1804-amd64" - }, - { - "base_image": "ubuntu:18.04", - "target_arch": "aarch64", - "nexus_classifier": "ub1804-arm64" } ] -} \ No newline at end of file +} diff --git a/release-version b/release-version index f599e28..b4de394 100644 --- a/release-version +++ b/release-version @@ -1 +1 @@ -10 +11 diff --git a/rpms/Dockerfile b/rpms/Dockerfile index 62704c7..605180b 100644 --- a/rpms/Dockerfile +++ b/rpms/Dockerfile @@ -2,8 +2,22 @@ ARG BASE_IMAGE FROM ${BASE_IMAGE} -RUN yum install -y epel-release git make yum-utils rpm-build && \ - yum group install -y "Development Tools" && \ +ARG NOAGPL +ENV NOAGPL=${NOAGPL:-true} + +RUN if [ "$BASE_IMAGE" = "redhat/ubi8" ]; then \ + rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm; \ + else \ + yum install -y epel-release; \ + fi && \ + + yum install -y git make yum-utils rpm-build && \ + + if [ "$NOAGPL" = "true" ]; then \ + yum group install -y "Development Tools" --exclude asciidoc --exclude graphviz; \ + else \ + yum group install -y "Development Tools"; \ + fi && \ yum clean all ARG BASE_IMAGE diff --git a/rpms/config.json b/rpms/config.json index d86f570..6f2467e 100755 --- a/rpms/config.json +++ b/rpms/config.json @@ -5,20 +5,15 @@ "target_arch": "x86_64", "nexus_classifier": "el9" }, - { - "base_image": "rockylinux:9", - "target_arch": "aarch64", - "nexus_classifier": "el9-aarch64" - }, { "base_image": "rockylinux:8", "target_arch": "x86_64", "nexus_classifier": "el8" }, { - "base_image": "rockylinux:8", - "target_arch": "aarch64", - "nexus_classifier": "el8-aarch64" + "base_image": "redhat/ubi8", + "target_arch": "x86_64", + "nexus_classifier": "el8-noagpl" } ] } diff --git a/rpms/entrypoint.sh b/rpms/entrypoint.sh index 98f81bd..a8cd689 100755 --- a/rpms/entrypoint.sh +++ b/rpms/entrypoint.sh @@ -36,18 +36,33 @@ sed -i '/BuildRequires.*ghostscript-devel/d; s/--with-gslib/--without-gslib/' Im # Drop LibRaw support which is not compatible with the current version of ImageMagick sed -i '/BuildRequires.*LibRaw/d; /--with-raw/d' ImageMagick.spec.in +if ["${NOAGPL:-false}" == "true" ]; then + # Drop urw-base35-fonts support, which has AGPL license. + sed -i '/BuildRequires.*urw-base35-fonts/d; /--with-urw-base35-fonts/d; /urw-base35-fonts/d' ImageMagick.spec.in + # Drop graphviz, since it requires urw-base35-fonts + sed -i '/BuildRequires.*graphviz/d' ImageMagick.spec.in +fi; + AFTER_CHECKOUT_HOOK_SCRIPT="../after-checkout-${BASE_IMAGE//:/}-$IMAGEMAGICK_VERSION.sh" if [ -x "$AFTER_CHECKOUT_HOOK_SCRIPT" ]; then "$AFTER_CHECKOUT_HOOK_SCRIPT" fi # Generate updated src.rpm -./configure +if ["${NOAGPL:-false}" == "true" ]; then + ./configure --with-gvc=no +else + ./configure +fi make dist-xz make srpm # Build it -yum-builddep -y "ImageMagick-$IMAGEMAGICK_VERSION.src.rpm" +if ["${NOAGPL:-false}" == "true" ]; then + yum-builddep -y "ImageMagick-$IMAGEMAGICK_VERSION.src.rpm" --exclude urw-base35-fonts --exclude graphviz +else + yum-builddep -y "ImageMagick-$IMAGEMAGICK_VERSION.src.rpm" +fi rpmbuild --rebuild --nocheck --target "$TARGET_ARCH" "ImageMagick-$IMAGEMAGICK_VERSION.src.rpm" echo "Imagemagick $IMAGEMAGICK_VERSION for $TARGET_ARCH built successfully." @@ -58,4 +73,9 @@ cd "/root/rpmbuild/RPMS/$TARGET_ARCH" echo "Testing package for unexpected dependencies" rpm -qp --requires ImageMagick-libs-$IMAGEMAGICK_VERSION.$TARGET_ARCH.rpm | grep -qEv 'libgs' +if ["${NOAGPL:-false}" == "true" ]; then + rpm -qp --requires ImageMagick-libs-$IMAGEMAGICK_VERSION.$TARGET_ARCH.rpm | grep -qEv 'urw-base35-fonts' + rpm -qp --requires ImageMagick-libs-$IMAGEMAGICK_VERSION.$TARGET_ARCH.rpm | grep -qEv 'graphviz' +fi; + exec /tests.sh $IMAGEMAGICK_VERSION $TARGET_ARCH