diff --git a/Makefile.packaging b/Makefile.packaging index 3962c3d36f7a2dae768a91308fd3a86304672297..2336d94ee78b04ee923dbe5a8d509d72393fee0a 100644 --- a/Makefile.packaging +++ b/Makefile.packaging @@ -113,7 +113,8 @@ package-all: package-debian_9 \ package-fedora_30_i386 \ package-fedora_31 \ package-fedora_31_i386 \ - package-gentoo + package-rhel_8 \ + package-gentoo # Append the output of make-packaging-target to this Makefile # see Makefile.packaging.distro_targets diff --git a/docker/Dockerfile_rhel_8 b/docker/Dockerfile_rhel_8 new file mode 100644 index 0000000000000000000000000000000000000000..9c9ac263d9777f6d89bf5b2e24b024b9eeee3b5f --- /dev/null +++ b/docker/Dockerfile_rhel_8 @@ -0,0 +1,72 @@ +FROM docker.io/roboxes/rhel8 + +RUN subscription-manager register --username=jamisfl --password=swDO9RBtTocv +RUN subscription-manager attach --auto +RUN subscription-manager repos --enable=codeready-builder-for-rhel-8-x86_64-rpms + +RUN dnf clean all +RUN dnf install -y dnf-command\(builddep\) rpmdevtools + +RUN dnf clean all +RUN dnf upgrade -y && \ + dnf install -y mesa-dri-drivers && \ + dnf install -y \ + git \ + rpm-build \ + tar \ + make \ + autoconf \ + automake \ + cmake \ + pulseaudio-libs-devel \ + libcanberra-devel \ + libcurl-devel \ + libtool \ + dbus-devel \ + expat-devel \ + pcre-devel \ + boost-devel \ + dbus-devel \ + libXext-devel \ + libXfixes-devel \ + chrpath \ + check \ + gettext-devel \ + gcc-c++ \ + which \ + alsa-lib-devel \ + systemd-devel \ + libuuid-devel \ + gnutls-devel \ + nettle-devel \ + patch \ + webkitgtk4-devel \ + libva-devel \ + openssl-devel \ + qt5-devel \ + clutter \ + clutter-devel \ + clutter-gtk-devel \ + qrencode-devel \ + yasm \ + opus \ + opus-devel \ + libvdpau-devel \ + libvdpau \ + speexdsp \ + speexdsp-devel \ + cppunit-devel \ + cppunit \ + libsndfile \ + libsndfile-devel \ + gsm-devel \ + evolution-data-server \ + evolution-devel \ + dbus-c++ + +ADD scripts/build-package-rhel.sh /opt/build-package-rhel.sh + +CMD /opt/build-package-rhel.sh + +RUN subscription-manager unregister + diff --git a/make-ring.py b/make-ring.py index d41a00e80292f6069db83c60a08e72fc961e4e90..321936462b5c6d519a4a164b1d1e06d531f5c80a 100755 --- a/make-ring.py +++ b/make-ring.py @@ -27,7 +27,7 @@ APT_BASED_DISTROS = [ ] DNF_BASED_DISTROS = [ - 'fedora', + 'fedora', 'rhel', ] PACMAN_BASED_DISTROS = [ diff --git a/packaging/rules/rhel/jami.spec b/packaging/rules/rhel/jami.spec new file mode 100644 index 0000000000000000000000000000000000000000..a39bfdedb7fda46b360c7e00ca38b83e59e81296 --- /dev/null +++ b/packaging/rules/rhel/jami.spec @@ -0,0 +1,234 @@ +%define name jami +%define version RELEASE_VERSION +%define release 0 + +Name: %{name} +Version: %{version} +Release: %{release}%{?dist} +Summary: Free software for distributed and secured communication. +Group: Applications/Internet +License: GPLv3+ +URL: https://jami.net/ +Source: jami_%{version}.tar.gz +Requires: jami-daemon = %{version} +Obsoletes: ring ring-daemon +Provides: ring +Conflicts: ring ring-daemon + + +BuildRequires: make +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: cmake +BuildRequires: pulseaudio-libs-devel +BuildRequires: libcanberra-devel +BuildRequires: libtool +BuildRequires: expat-devel +BuildRequires: pcre-devel +BuildRequires: boost-devel +BuildRequires: dbus-devel +BuildRequires: libXext-devel +BuildRequires: chrpath +BuildRequires: check +BuildRequires: gettext-devel +BuildRequires: gcc-c++ +BuildRequires: which +BuildRequires: alsa-lib-devel +BuildRequires: systemd-devel +BuildRequires: libuuid-devel +BuildRequires: libXfixes-devel +BuildRequires: gnutls-devel +BuildRequires: nettle-devel +#BuildRequires: jsoncpp-devel +#BuildRequires: json-devel +BuildRequires: gcc-c++ +BuildRequires: glib2-devel +BuildRequires: gtk3-devel +BuildRequires: libva-devel +BuildRequires: webkitgtk4-devel +BuildRequires: qt5-devel +BuildRequires: clutter +BuildRequires: clutter-devel +BuildRequires: clutter-gtk-devel +BuildRequires: qrencode-devel +BuildRequires: yasm +BuildRequires: opus +BuildRequires: opus-devel +BuildRequires: libvdpau-devel +BuildRequires: libvdpau +BuildRequires: speexdsp +BuildRequires: speexdsp-devel +BuildRequires: cppunit-devel +BuildRequires: cppunit +BuildRequires: dbus-c++ + + +%description +Jami is free software for universal communication which respects freedoms +and privacy of its users. +. +This package contains the desktop client: jami-gnome. + +%package daemon +Summary: Free software for distributed and secured communication - daemon + +%description daemon +Jami is free software for universal communication which respects freedoms +and privacy of its users. +. +This package contains the Jami daemon: dring. + +%prep +%setup -n ring-project + +%build +########################### +## Ring Daemon configure ## +########################### +mkdir -p daemon/contrib/native +cd %{_builddir}/ring-project/daemon/contrib/native && \ + ../bootstrap \ + --no-checksums \ + --disable-ogg \ + --disable-flac \ + --disable-vorbis \ + --disable-vorbisenc \ + --disable-speex \ + --disable-sndfile \ + --disable-gsm \ + --disable-speexdsp \ + --disable-natpmp && \ + make list && \ + make fetch && \ + make -j4 V=1 && \ + make -j4 V=1 .ffmpeg + +cd %{_builddir}/ring-project/daemon && \ + ./autogen.sh && \ + ./configure \ + --prefix=%{_prefix} \ + --libdir=%{_libdir} \ + --disable-shared + +############################# +## libringclient configure ## +############################# +cd %{_builddir}/ring-project/lrc && \ + mkdir build && \ + cd build && \ + cmake \ + -DRING_BUILD_DIR=%{_builddir}/ring-project/daemon/src \ + -DCMAKE_INSTALL_PREFIX=%{_prefix} \ + -DCMAKE_INSTALL_LIBDIR=%{_libdir} \ + -DCMAKE_BUILD_TYPE=Debug \ + .. + +############################ +## gnome client configure ## +############################ +cd %{_builddir}/ring-project/client-gnome && \ + mkdir build && \ + cd build && \ + cmake \ + -DCMAKE_INSTALL_PREFIX=%{_prefix} \ + -DCMAKE_INSTALL_LIBDIR=%{_libdir} \ + -DLibRingClient_PROJECT_DIR=%{_builddir}/ring-project/lrc \ + -DGSETTINGS_LOCALCOMPILE=OFF \ + .. + +####################### +## Ring Daemon build ## +####################### +make -C %{_builddir}/ring-project/daemon -j4 V=1 +pod2man %{_builddir}/ring-project/daemon/man/dring.pod > %{_builddir}/ring-project/daemon/dring.1 + +######################### +## libringclient build ## +######################### +make -C %{_builddir}/ring-project/lrc/build -j4 V=1 + +######################## +## gnome client build ## +######################## +make -C %{_builddir}/ring-project/client-gnome/build LDFLAGS="-lpthread" -j4 V=1 + + +%install +######################### +## Ring Daemon install ## +######################### +DESTDIR=%{buildroot} make -C daemon install +cp %{_builddir}/ring-project/daemon/dring.1 %{buildroot}/%{_mandir}/man1/dring.1 +rm -rfv %{buildroot}/%{_prefix}/include +rm -rfv %{buildroot}/%{_libdir}/*.a +rm -rfv %{buildroot}/%{_libdir}/*.la + +########################### +## libringclient install ## +########################### +DESTDIR=%{buildroot} make -C lrc/build install +rm -rfv %{buildroot}/%{_prefix}/include + +# This is a symlink, should be in -dev package +rm -v %{buildroot}/%{_libdir}/libringclient.so + +# cmake files +rm -rfv %{buildroot}/%{_libdir}/cmake + +########################## +## gnome client install ## +########################## +DESTDIR=%{buildroot} make -C client-gnome/build install +ln -sf %{_bindir}/jami %{buildroot}/%{_bindir}/ring.cx + +%files +%defattr(-,root,root,-) +%{_bindir}/jami +%{_bindir}/ring.cx +%{_bindir}/jami-gnome +%{_libdir}/libringclient*.so* +%{_datadir}/glib-2.0/schemas/net.jami.Jami.gschema.xml +%{_datadir}/applications/jami-gnome.desktop +%{_datadir}/jami-gnome/jami-gnome.desktop +%{_datadir}/icons/hicolor/scalable/apps/jami.svg +%{_datadir}/metainfo/jami-gnome.appdata.xml +%{_datadir}/libringclient/* +%{_datadir}/locale/* +%{_datadir}/sounds/jami-gnome/* +%doc %{_mandir}/man1/dring* + +%files daemon +%defattr(-,root,root,-) +%{_libdir}/ring/dring +%{_datadir}/ring/ringtones +%{_datadir}/dbus-1/services/* +%{_datadir}/dbus-1/interfaces/* + +%post +/sbin/ldconfig +/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : + +%postun +/sbin/ldconfig + +#for < f24 we have to update the schema explicitly +%if 0%{?fedora} < 24 + if [ $1 -eq 0 ] ; then + /usr/bin/glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || : + fi +%endif + +if [ $1 -eq 0 ] ; then + /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null + /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : +fi + +%posttrans +#for < f24 we have to update the schema explicitly +%if 0%{?fedora} < 24 + /usr/bin/glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || : +%endif + +/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : + +%changelog diff --git a/scripts/build-package-rhel.sh b/scripts/build-package-rhel.sh new file mode 100755 index 0000000000000000000000000000000000000000..8300cd6e733cb1936a0e7620a3a93582931eee9a --- /dev/null +++ b/scripts/build-package-rhel.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash +# +# Copyright (C) 2016-2019 Savoir-faire Linux Inc. +# +# Author: Alexandre Viau <alexandre.viau@savoirfairelinux.com> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +# This script is used in the packaging containers to build packages on +# rpm-based distros. +# + +set -x + +# import the spec file +mkdir -p /opt/ring-project +cd /opt/ring-project +cp /opt/ring-project-ro/packaging/rules/rhel/jami.spec . + +# place the source +mkdir -p /root/rpmbuild/SOURCES +cp /opt/ring-project-ro/jami_*.tar.gz /root/rpmbuild/SOURCES + +# Set the version +sed -i "s/RELEASE_VERSION/${RELEASE_VERSION}/g" jami.spec +rpmdev-bumpspec --comment="Automatic nightly release" --userstring="Jenkins <ring@lists.savoirfairelinux.net>" jami.spec + +# install build deps +dnf builddep -y jami.spec || echo "ignoring dnf builddep failure" + +# build the package +rpmbuild -ba jami.spec + +# move to output +mv /root/rpmbuild/RPMS/*/* /opt/output +touch /opt/output/.packages-built +chown -R ${CURRENT_UID}:${CURRENT_UID} /opt/output diff --git a/scripts/deploy-packages.sh b/scripts/deploy-packages.sh index d33b3bebe56558d90ceaa5d512d2e55c197a1a06..5d92fa8ac6cfb6cba04dd563ba0028ececa06f8f 100755 --- a/scripts/deploy-packages.sh +++ b/scripts/deploy-packages.sh @@ -128,7 +128,7 @@ function package_rpm() cat << EOF > ${DISTRIBUTION_REPOSITOIRY_FOLDER}/ring-nightly.repo [ring] name=Ring \$releasever - \$basearch - ring -baseurl=https://dl.jami.net/ring-nightly/fedora_\$releasever +baseurl=https://dl.jami.net/ring-nightly/${DISTRIBUTION#*_}_\$releasever gpgcheck=1 gpgkey=https://dl.jami.net/ring.pub.key enabled=1 @@ -211,7 +211,7 @@ function package() if [[ "${DISTRIBUTION:0:6}" == "debian" || "${DISTRIBUTION:0:6}" == "ubuntu" ]]; then package_deb - elif [[ "${DISTRIBUTION:0:6}" == "fedora" ]]; + elif [[ "${DISTRIBUTION:0:6}" == "fedora" || "${DISTRIBUTION:0:4}" == "rhel" ]]; then package_rpm else diff --git a/scripts/make-packaging-target.py b/scripts/make-packaging-target.py index 67d5aa9219c3d9be49a6ad149364f56c6cd7603a..c61d9fc0d92254d324b7e12d44192bbee05f12da 100755 --- a/scripts/make-packaging-target.py +++ b/scripts/make-packaging-target.py @@ -338,7 +338,7 @@ def run_generate_all(parsed_args): "output_file": ".packages-built", "options": "--security-opt seccomp=./docker/profile-seccomp-fedora_28.json --privileged", }, - { + { "distribution": "fedora_31", "debian_packaging_override": "", "output_file": ".packages-built", @@ -350,6 +350,12 @@ def run_generate_all(parsed_args): "output_file": ".packages-built", "options": "--security-opt seccomp=./docker/profile-seccomp-fedora_28.json --privileged", }, + { + "distribution": "rhel_8", + "debian_packaging_override": "", + "output_file": ".packages-built", + "options": "--security-opt seccomp=./docker/profile-seccomp-fedora_28.json --privileged", + }, # Gentoo {