RPM: update build scripts for opensuse tumbleweed

Signed-off-by: François Andriot <albator78@libertysurf.fr>
pull/257/head
François Andriot 2 years ago
parent 8ab4d3920b
commit 6783a326d4

@ -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 \
\
..

@ -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

@ -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

@ -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

@ -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

@ -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"

@ -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 $(</packages)
# Add non-root user to build packages
RUN useradd -m -s /bin/bash -u 1000 trinity \
&& echo "trinity ALL=(ALL) NOPASSWD: ALL" >>/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"

@ -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 $(</packages)
&& zypper -n install --allow-vendor-change $(</packages)
# Add non-root user to build packages
RUN useradd -m -s /bin/bash -u 1000 trinity \
@ -25,6 +25,9 @@ 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 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|^|#|" \
&& rpmbuild -bc ${HOME}/rpmbuild/SPECS/libheimdal.spec \
&& sudo make -C ${HOME}/rpmbuild/BUILD/heimdal-7.8.0/tools/ install

@ -33,6 +33,7 @@ docbook-xsl-stylesheets
doxygen GraphicsMagick
docbook2x
dssi-devel
extractpdfmark
fdupes
ffmpeg-4-libavcodec-devel
ffmpeg-4-libavdevice-devel
@ -158,6 +159,7 @@ libyaz-devel
lirc-devel
make
makeinfo
mc
meanwhile-devel
Mesa-devel
Mesa-libGL-devel
@ -178,10 +180,13 @@ patch
pciutils-devel
pcre-devel
pcsc-lite-devel
perl-JSON
perl-PAR-Packer
perl-pcsc
pkcs11-helper-devel
pkgconfig(bdw-gc)
pkgconfig(guile-1.8)
pkgconfig(guile-3.0)
polkit-devel
postgresql
postgresql-devel

@ -1,4 +1,4 @@
%dist .osstw
%_smp_mflags -j8
%jobs 8
%__python %__python2
%__python %__python3

@ -164,7 +164,7 @@ Requires: trinity-konversation
Requires: trinity-kooldock
Requires: trinity-kopete-otr
Requires: trinity-kpicosim
%if 0%{?sle_version} <= 150300 && 0%{?suse_version} != 1599
%if 0%{?sle_version} <= 150300 && 0%{?suse_version} != 1599 && 0%{?suse_version} != 1699
%if 0%{?suse_version} || 0%{?mgaversion} || 0%{?mdkversion} || 0%{?pclinuxos} || 0%{?fedora} || 0%{?rhel} >= 6
Requires: trinity-kpilot
%endif

Loading…
Cancel
Save