Unverified Commit df39309d authored by Sébastien Blin's avatar Sébastien Blin Committed by Maxim Cournoyer
Browse files

packaging: client-qt on rhel8

Change-Id: Ied0febeca35f3d39724401669427bdfecc8f093c
parent 045ee5bb
......@@ -8,70 +8,77 @@ 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 install -y dnf-command\(builddep\) rpmdevtools && \
dnf install -y mock
RUN dnf clean all
RUN dnf upgrade -y && \
dnf install -y mesa-dri-drivers && \
dnf install -y \
RUN dnf install -y \
git \
rpm-build \
tar \
make \
autoconf \
automake \
cmake \
nasm \
cmake \
speexdsp-devel \
pulseaudio-libs-devel \
libcanberra-devel \
libcurl-devel \
libtool \
mesa-libgbm-devel \
mesa-dri-drivers \
dbus-devel \
expat-devel \
pcre-devel \
boost-devel \
yaml-cpp-devel \
dbus-c++-devel \
dbus-devel \
libXext-devel \
libXfixes-devel \
yasm \
speex-devel \
gsm-devel \
chrpath \
check \
astyle \
gettext-devel \
gcc-c++ \
libstdc++-static \
which \
alsa-lib-devel \
systemd-devel \
libuuid-devel \
uuid-devel \
gnutls-devel \
nettle-devel \
opus-devel \
patch \
jsoncpp-devel \
libnatpmp-devel \
webkitgtk4-devel \
cryptopp-devel \
libva-devel \
libvdpau-devel \
msgpack-devel \
NetworkManager-libnm-devel \
openssl-devel \
qt5-devel \
clutter \
clutter-devel \
clutter-gtk-devel \
libappindicator-gtk3-devel \
libnotify-devel \
libupnp-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 \
qt5-qtbase-5.11.1-7.el8.i686 \
dbus-c++ \
jsoncpp-devel
ADD scripts/build-package-rhel.sh /opt/build-package-rhel.sh
sqlite-devel \
libdrm \
gperf \
bison \
flex \
nodejs \
nss-devel \
kernel-headers \
python2 \
wget
CMD /opt/build-package-rhel.sh
ADD scripts/build-package-rpm.sh /opt/build-package-rpm.sh
RUN subscription-manager unregister
CMD /opt/build-package-rpm.sh
\ No newline at end of file
#!/bin/sh -e
###############################################################################
# JAMI PACKAGE POSTINST #
# #
# Install Jami's package repository to the trusted sources and add Jami's #
# release key to trusted keyring. #
# #
###############################################################################
###############################################################################
# [1] Configuration #
###############################################################################
# All package repo urls are expected to start with this string, regardless
# of the distribution or version. The end tag is automatically appended,
# depending on the system the postinst script is run on.
#
# To update the appended end tags, modify the switch in [2].
JAMI_REPO_BASE="https://dl.jami.net/nightly"
# Jami release key.
JAMI_KEY_FINGERPRINT="A295D773307D25A33AE72F2F64CD5FA175348F84"
JAMI_KEY="\
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2
mQENBFVSdlcBCAC9zC1rp12O2K08PGozI14Y+t4qC931eHicvkuEMF1B9gAhjdRF
aIJS+UXwgQzoamDIHenxz1Q3fXUjKCMXytjGymB/0LUKccSbtH0Rcsl8kZ2z57KN
E+GLS7SvlP93ZOxco7eAEBWF/fvMrCsm10sNI6bW7UK0bgql9iIetd6Wrp9xXFVs
gmoV8Av714OlswsthSNtN+xQls3ozQ/dVGsOkZEyDbBzi88/rQEtuIDztTSWyD0V
x7WaY5+mVRwsJKzyPlgvsXpbP7A41IFykeOzPKh+vYz3k7dcLIRdOwse79oT2RXt
2VYEyTyTZIQlCJjGNTJYsU7GVffU4LnI7p/bABEBAAG0QFJpbmcgLSBTYXZvaXIt
RmFpcmUgTGludXgsIEluYyA8cmluZ0BsaXN0cy5zYXZvaXJmYWlyZWxpbnV4Lm5l
dD6JATkEEwEIACMFAlVSdlcCGwMHCwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAK
CRBkzV+hdTSPhMqSB/9aaKXVByoE7zwPM8DDSntS/jYhhaV1CcZ78WeC1LY2UnHL
R/yvABnDMikgqbMHBDu1R9dnjgZNntp7p0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y7YOK3gdnNm57jemJRz6Cum7RTUiqCQ8ivSmEgv1KmMIqMpjmnKKP43iHO
mR4i7XDml6RBGynPys6cQcAlBWSuhOv9PGpRCaGyjJ4vmQUsYhyD/+tCDZVdBuGg
CxteSMbawxtMHESqX7dDlctc+njDjBcbcGj73sj36qoFIjorjymZlT5IdK39oXVM
Hi1TssiWPOU0hQgn4BIreYnEZUA6xuFX10C7k2DVRFZrXF7lpNgPQ8eNZTnQBIuw
HUFCGSHO3/kzxSlkE1PBUX3IZ8PSFijyopBnWUhlSXuyRjte8OR7Fl/Rlf0IaOD1
4sRdAfS333T4Uifq4uOu
=s2aQ
-----END PGP PUBLIC KEY BLOCK-----"
# System paths and generated variables
# In general: you will not need to modify these variables.
# WARNING: When modifying the paths, keep in mind that the corresponding
# postrm paths should be modified as well
YUM_FILE="/etc/yum.repos.d/jami-main.repo"
GPG_FILE="/etc/pki/rpm-gpg/RPM-GPG-KEY-JAMI"
JAMI_UPDATE_MANAGER_ID="jami-main"
JAMI_UPDATE_MANAGER_CFG="${JAMI_UPDATE_MANAGER_ID}.cfg"
###############################################################################
# [2] Set package repo url depending on distribution and version #
###############################################################################
CAN_ADD_YUM_SOURCE=true
# Detect currently running system using /etc/os-release
# Redhat-based systems are supposed to provide /etc/os-release so if it's not
# the case then we simply don't want to provide automatic updates
if [ -f /etc/os-release ]; then
. /etc/os-release
JAMI_REPO='
[jami]
name=Jami $releasever - $basearch - jami
baseurl='"${JAMI_REPO_BASE}"/"${ID}"'_$releasever
gpgcheck=1
gpgkey=https://dl.jami.net/jami.pub.key
enabled=1'
# Set-up Jami repository end tag
if [ "${PLATFORM_ID}" = "platform:el8" ] || [ "${ID}_${VERSION_ID%.*}" = "rhel_8" ]; then
ENDTAG="rhel_8"
elif [ "${PLATFORM_ID}" = "platform:f32" ] || [ "${ID}_${VERSION_ID}" = "fedora_32" ]; then
ENDTAG="fedora_32"
elif [ "${PLATFORM_ID}" = "platform:f33" ] || [ "${ID}_${VERSION_ID}" = "fedora_33" ]; then
ENDTAG="fedora_33"
elif [ "${PLATFORM_ID}" = "platform:f34" ] || [ "${ID}_${VERSION_ID}" = "fedora_34" ]; then
ENDTAG="fedora_34"
else
# Distribution is not supported. Don't provide automatic updates.
CAN_ADD_YUM_SOURCE=false
fi
else
CAN_ADD_YUM_SOURCE=false
fi
###############################################################################
# [3] Maintainer script main switch #
###############################################################################
if [ "`command -v rpm`" = "" ]; then
# we can only add key if rpm is present
CAN_ADD_YUM_SOURCE=false
fi
if [ "${CAN_ADD_YUM_SOURCE}" = "true" ]; then
# # We first add the key to the trusted keyring.
cat > $GPG_FILE <<EOF
$JAMI_KEY
EOF
/usr/bin/rm -f /var/lib/rpm/.rpm.lock > /dev/null 2>&1
/usr/bin/rpm --import $GPG_FILE > /dev/null 2>&1
# Add an entry for the package repository to the trusted package
# FIXME As soon as we rename the repo use ring instead of jami
cat > $YUM_FILE <<EOF
$JAMI_REPO
EOF
fi
exit 0
%define name jami-all
%define version RELEASE_VERSION
%define release 0
%define postinst jami-all.postinst
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: 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: nasm
BuildRequires: yasm
BuildRequires: opus
BuildRequires: opus-devel
BuildRequires: libvdpau-devel
BuildRequires: libvdpau
BuildRequires: speexdsp
BuildRequires: speexdsp-devel
BuildRequires: cppunit-devel
BuildRequires: cppunit
BuildRequires: qt5-qtbase
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.
%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 .gnutls
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
##########################
## post install script ##
##########################
#mkdir -p %{buildroot}/opt/repo-package/
cp %{_builddir}/ring-project/packaging/rules/rhel/%{postinst} %{buildroot}/%{_bindir}
chmod a+x %{buildroot}/%{_bindir}/%{postinst}
%files
%{_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*
%{_libdir}/ring/dring
%{_datadir}/ring/ringtones
%{_datadir}/dbus-1/services/*
%{_datadir}/dbus-1/interfaces/*
%{_bindir}/%{postinst}
%post
/sbin/ldconfig
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
if [ $1 == 1 ];then
%{_bindir}/%{postinst}
fi
%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
%define spec_install_pre %{___build_pre} ; mkdir -p `dirname "$RPM_BUILD_ROOT"`; mkdir "$RPM_BUILD_ROOT" %{nil}
%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
#ENVRA: 01
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: 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: nasm
BuildRequires: yasm
BuildRequires: opus
BuildRequires: opus-devel
BuildRequires: libvdpau-devel
BuildRequires: libvdpau
BuildRequires: speexdsp
BuildRequires: speexdsp-devel
BuildRequires: cppunit-devel
BuildRequires: cppunit
BuildRequires: qt5-qtbase
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.
%package all
Summary: Free software for distributed and secured communication - daemon
%description all
Jami is free software for universal communication which respects freedoms
and privacy of its users.
%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 .gnutls
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