From 6783a326d4d2fe5d801183a16243d9f82489f26a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Andriot?= Date: Tue, 9 May 2023 12:14:41 +0200 Subject: RPM: update build scripts for opensuse tumbleweed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: François Andriot --- redhat/applications/internet/tork/tork.spec | 4 ++ redhat/applications/misc/kcmldap/kcmldap.spec | 10 +---- .../misc/kcmldapcontroller/kcmldapcontroller.spec | 10 +---- .../misc/kcmldapmanager/kcmldapmanager.spec | 10 +---- .../misc/kerberostray/kerberostray.spec | 10 +---- redhat/docker/opensuse32.sh | 52 ++++++++++++++++------ redhat/docker/osstw/Dockerfile.i686 | 22 ++++----- redhat/docker/osstw/Dockerfile.x86_64 | 15 ++++--- redhat/docker/osstw/packages | 5 +++ redhat/docker/osstw/rpmmacros | 2 +- redhat/extras/trinity-desktop/trinity-desktop.spec | 2 +- 11 files changed, 73 insertions(+), 69 deletions(-) diff --git a/redhat/applications/internet/tork/tork.spec b/redhat/applications/internet/tork/tork.spec index 66d721f6b..ef1ae5bb9 100644 --- a/redhat/applications/internet/tork/tork.spec +++ b/redhat/applications/internet/tork/tork.spec @@ -86,6 +86,8 @@ BuildRequires: openssl-devel %if 0%{?suse_version} %if 0%{?suse_version} < 1550 BuildRequires: libGeoIP-devel +%else +%define with_embedded_geoip 1 %endif %else BuildRequires: geoip-devel @@ -135,6 +137,8 @@ fi \ -DBUILD_ALL=ON \ -DWITH_ALL_OPTIONS=ON \ + -DWITH_EMBEDDED_GEOIP=%{?with_embedded_geoip:ON}%{?!with_embedded_geoip:OFF} \ + -DWITH_GNUTLS=ON \ \ .. diff --git a/redhat/applications/misc/kcmldap/kcmldap.spec b/redhat/applications/misc/kcmldap/kcmldap.spec index 68af31207..c5bdb79e3 100644 --- a/redhat/applications/misc/kcmldap/kcmldap.spec +++ b/redhat/applications/misc/kcmldap/kcmldap.spec @@ -102,15 +102,7 @@ BuildRequires: openldap24-libs-devel %endif # KRB5 support -#BuildRequires: krb5-devel - -# HEIMDAL support -%if 0%{?rhel} >= 6 || 0%{?fedora} || 0%{?mdkversion} || 0%{?mgaversion} -BuildRequires: heimdal-devel -%endif -%if 0%{?suse_version} -BuildRequires: libheimdal-devel -%endif +BuildRequires: krb5-devel # UDEV support %if 0%{?fedora} || 0%{?mdkversion} || 0%{?mgaversion} || 0%{?suse_version} || 0%{?rhel} >= 6 diff --git a/redhat/applications/misc/kcmldapcontroller/kcmldapcontroller.spec b/redhat/applications/misc/kcmldapcontroller/kcmldapcontroller.spec index c99c0b685..e89b41917 100644 --- a/redhat/applications/misc/kcmldapcontroller/kcmldapcontroller.spec +++ b/redhat/applications/misc/kcmldapcontroller/kcmldapcontroller.spec @@ -92,15 +92,7 @@ BuildRequires: openldap24-libs-devel %endif # KRB5 support -#BuildRequires: krb5-devel - -# HEIMDAL support -%if 0%{?rhel} >= 6 || 0%{?fedora} || 0%{?mdkversion} || 0%{?mgaversion} -BuildRequires: heimdal-devel -%endif -%if 0%{?suse_version} -BuildRequires: libheimdal-devel -%endif +BuildRequires: krb5-devel # UDEV support %if 0%{?fedora} || 0%{?mdkversion} || 0%{?mgaversion} || 0%{?suse_version} || 0%{?rhel} >= 6 diff --git a/redhat/applications/misc/kcmldapmanager/kcmldapmanager.spec b/redhat/applications/misc/kcmldapmanager/kcmldapmanager.spec index bbe317e3d..181530823 100644 --- a/redhat/applications/misc/kcmldapmanager/kcmldapmanager.spec +++ b/redhat/applications/misc/kcmldapmanager/kcmldapmanager.spec @@ -89,15 +89,7 @@ BuildRequires: openldap24-libs-devel %endif # KRB5 support -#BuildRequires: krb5-devel - -# HEIMDAL support -%if 0%{?rhel} >= 6 || 0%{?fedora} || 0%{?mdkversion} || 0%{?mgaversion} -BuildRequires: heimdal-devel -%endif -%if 0%{?suse_version} -BuildRequires: libheimdal-devel -%endif +BuildRequires: krb5-devel # UDEV support %if 0%{?fedora} || 0%{?mdkversion} || 0%{?mgaversion} || 0%{?suse_version} || 0%{?rhel} >= 6 diff --git a/redhat/applications/misc/kerberostray/kerberostray.spec b/redhat/applications/misc/kerberostray/kerberostray.spec index 38e159c48..cd6644d93 100644 --- a/redhat/applications/misc/kerberostray/kerberostray.spec +++ b/redhat/applications/misc/kerberostray/kerberostray.spec @@ -89,15 +89,7 @@ BuildRequires: openldap24-libs-devel %endif # KRB5 support -#BuildRequires: krb5-devel - -# HEIMDAL support -%if 0%{?rhel} >= 6 || 0%{?fedora} || 0%{?mdkversion} || 0%{?mgaversion} -BuildRequires: heimdal-devel -%endif -%if 0%{?suse_version} -BuildRequires: libheimdal-devel -%endif +BuildRequires: krb5-devel # UDEV support %if 0%{?fedora} || 0%{?mdkversion} || 0%{?mgaversion} || 0%{?suse_version} || 0%{?rhel} >= 6 diff --git a/redhat/docker/opensuse32.sh b/redhat/docker/opensuse32.sh index 1a78e6340..82d315ed9 100755 --- a/redhat/docker/opensuse32.sh +++ b/redhat/docker/opensuse32.sh @@ -1,9 +1,13 @@ #!/bin/bash -e +if [ "$(whoami)" != "root" ]; then + sudo exec $0 $@ +fi + VERSION="$1" # E.g: '42.3' if [ "${VERSION}" = "tumbleweed" ]; then - URL="http://download.opensuse.org/tumbleweed" + URL="https://download.opensuse.org/ports/i586/tumbleweed" NAME="opensuse32/tumbleweed" else URL="http://download.opensuse.org/distribution/leap/${VERSION}" @@ -13,25 +17,38 @@ fi IMAGE="${NAME}:latest" INSTALLROOT="/dev/shm/${IMAGE}" -sudo rm -rf "${INSTALLROOT}" -sudo mkdir -p "${INSTALLROOT}" +for dir in dev proc sys; do + if [ -d "${INSTALLROOT}/${dir}" ]; then + umount "${INSTALLROOT}/${dir}" + fi +done + +rm -rf "${INSTALLROOT}" +mkdir -p "${INSTALLROOT}" -sudo zypper --root "${INSTALLROOT}" \ +for dir in dev proc sys; do + mkdir -p "${INSTALLROOT}/${dir}" + mount --bind "/${dir}" "${INSTALLROOT}/${dir}" +done + +zypper --root "${INSTALLROOT}" \ ar "${URL}/repo/oss/" "oss" -sudo zypper --root "${INSTALLROOT}" \ +zypper --root "${INSTALLROOT}" \ ar "${URL}/repo/non-oss/" "non-oss" if [ "${VERSION}" != "tumbleweed" ]; then - sudo zypper --root "${INSTALLROOT}" \ + zypper --root "${INSTALLROOT}" \ ar "http://download.opensuse.org/update/leap/${VERSION}/oss/" "update-oss" - sudo zypper --root "${INSTALLROOT}" \ + zypper --root "${INSTALLROOT}" \ ar "http://download.opensuse.org/update/leap/${VERSION}/non-oss/" "update-non-oss" fi -sudo zypper --root "${INSTALLROOT}" \ +zypper --root "${INSTALLROOT}" \ --gpg-auto-import-keys ref -sudo setarch i686 zypper --root "${INSTALLROOT}" \ +setarch i686 zypper --root "${INSTALLROOT}" \ install --download-only -y \ bash \ + ca-certificates \ + curl \ docbook-utils \ filesystem \ gawk \ @@ -47,16 +64,23 @@ sudo setarch i686 zypper --root "${INSTALLROOT}" \ xz \ zlib \ zypper -sudo rpm -Uvh --root "${INSTALLROOT}" "${INSTALLROOT}/var/cache/zypp/packages/oss/"*"/"*".rpm" +rpm -Uvh --root "${INSTALLROOT}" "${INSTALLROOT}/var/cache/zypp/packages/oss/"*"/"*".rpm" + +chroot "${INSTALLROOT}" rpmdb --rebuilddb + +for dir in dev proc sys; do + umount "${INSTALLROOT}/${dir}" +done -sudo chroot "${INSTALLROOT}" rpmdb --rebuilddb +rm -rfv "${INSTALLROOT}//var/cache/zypp/packages/"* FILE="${IMAGE//\//_}.tar" -sudo tar -C "${INSTALLROOT}" -c . >"${FILE}" -sudo rm -rf "${INSTALLROOT}" +tar -C "${INSTALLROOT}" -c . >"${FILE}" +rm -rf "${INSTALLROOT}" docker rmi -f "${IMAGE}" docker import "${FILE}" "${IMAGE}" pigz "${FILE}" -mv -fv "${FILE}.gz" "${HOME}/tde/docker" +mkdir -p "/home/${SUDO_USER}/tde/docker" +mv -fv "${FILE}.gz" "/home/${SUDO_USER}/tde/docker" diff --git a/redhat/docker/osstw/Dockerfile.i686 b/redhat/docker/osstw/Dockerfile.i686 index ec076eabd..9a0593c0d 100644 --- a/redhat/docker/osstw/Dockerfile.i686 +++ b/redhat/docker/osstw/Dockerfile.i686 @@ -5,20 +5,17 @@ ARG ARCH=i686 # Add PACKMAN repository COPY packages /packages -RUN zypper ar -f -G -n packman http://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Tumbleweed/ packman \ - && zypper ar -f -G -n gnome http://ftp.lysator.liu.se/pub/opensuse/repositories/GNOME:/Next/openSUSE_Factory gnome \ +RUN set -x \ + && zypper ar -f -G -n packman http://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Tumbleweed/ packman \ && setarch ${ARCH} zypper -n refresh \ - && setarch ${ARCH} zypper -n dup \ && setarch ${ARCH} zypper -n update \ + && setarch ${ARCH} zypper -n dup \ && setarch ${ARCH} zypper -n install --allow-vendor-change $(>/etc/sudoers -# Fix postgresql -RUN ln -sfv /usr/lib/postgresql10/bin/pg_config /usr/bin/pg_config - USER trinity COPY rpmmacros /home/trinity/.rpmmacros @@ -28,12 +25,15 @@ RUN mkdir -p /home/trinity/rpmbuild/RPMS.tde-${TDE_VERSION}/${ARCH} \ && mkdir -p /home/trinity/rpmbuild/RPMS.tde-${TDE_VERSION}/noarch \ && sudo zypper ar -C -G /home/trinity/rpmbuild/RPMS.tde-${TDE_VERSION}/noarch rpmbuild.noarch -# Add GeoIP -RUN setarch ${ARCH} rpmbuild --rebuild https://ftp.lysator.liu.se/pub/opensuse/source/distribution/leap/15.3/repo/oss/src/GeoIP-1.6.12-6.3.1.src.rpm \ - && sudo rpm -Uvh ${HOME}/rpmbuild/RPMS/*/*GeoIP*.rpm +# Install heimdal development files +RUN rpm -Uvh https://ftp.lysator.liu.se/pub/opensuse/source/tumbleweed/repo/oss/src/libheimdal-7.8.0-3.1.src.rpm \ + && wget -nv -O "${HOME}/rpmbuild/SOURCES/heimdal-7.8.0.tar.gz" "https://github.com/heimdal/heimdal/releases/download/heimdal-7.8.0/heimdal-7.8.0.tar.gz" \ + && sed -i "${HOME}/rpmbuild/SPECS/libheimdal.spec" -e "/^Source0:/ s|.*|Source0: heimdal-7.8.0.tar.gz|" -e "/^Patch0/ s|^|#|" \ + && setarch ${ARCH} rpmbuild -bc ${HOME}/rpmbuild/SPECS/libheimdal.spec \ + && sudo make -C ${HOME}/rpmbuild/BUILD/heimdal-7.8.0/tools/ install # Add lilypond (i686 only) -RUN rpm -Uvh https://ftp.lysator.liu.se/pub/opensuse/source/tumbleweed/repo/oss/src/lilypond-2.23.3-3.9.src.rpm \ +RUN rpm -Uvh https://ftp.lysator.liu.se/pub/opensuse/source/tumbleweed/repo/oss/src/lilypond-2.24.1-2.2.src.rpm \ && sed -i "${HOME}/rpmbuild/SPECS/lilypond.spec" -e "/^ExcludeArch/d" \ && setarch ${ARCH} rpmbuild -ba "${HOME}/rpmbuild/SPECS/lilypond.spec" \ - && sudo rpm -Uvh "${HOME}/rpmbuild/RPMS/"*"/lilypond"{,-fonts-common,-texgy-fonts,-emmentaler-fonts}"-2"*".rpm" + && sudo rpm -Uvh "${HOME}/rpmbuild/RPMS/"*"/lilypond"{,-fonts-common,-emmentaler-fonts}"-2"*".rpm" diff --git a/redhat/docker/osstw/Dockerfile.x86_64 b/redhat/docker/osstw/Dockerfile.x86_64 index d708590cd..1e9205626 100644 --- a/redhat/docker/osstw/Dockerfile.x86_64 +++ b/redhat/docker/osstw/Dockerfile.x86_64 @@ -5,12 +5,12 @@ ARG ARCH=x86_64 # Add PACKMAN repository COPY packages /packages -RUN zypper ar -f -G -n packman http://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Tumbleweed/ packman \ +RUN set -x \ + && zypper ar -f -G -n packman http://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Tumbleweed/ packman \ && zypper -n refresh \ - && zypper -n install busybox perl shadow \ && zypper -n dup \ && zypper -n update \ - && zypper -n install $(= 6 Requires: trinity-kpilot %endif -- cgit v1.2.1