Unverified Commit 94cf1f8b authored by Maxim Cournoyer's avatar Maxim Cournoyer
Browse files

packaging/fedora: Split into multiple packages.

Tackle the growing complexity of the packaging by splitting the
problem into smaller parts.  This change makes the daemon its own
package, along the client library and the GNOME client.

The build script is updated to reflect these changes, and
unused/obsolete spec files are removed from the project.

GitLab: #264
Change-Id: I5813e48e0c1248875a7a8f0ee1ec6fb2b87faef4
parent 00d155f1
%define name jami-all
%define name jami-daemon
%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.
Summary: Daemon component of Jami
Group: Applications/Internet
License: GPLv3+
Vendor: Savoir-faire Linux
URL: https://jami.net/
Source: jami_%{version}.tar.gz
#Requires: jami-daemon = %{version}
Obsoletes: ring ring-daemon
Provides: ring
Conflicts: ring ring-daemon
Requires: jami-daemon = %{version}
BuildRequires: make
# Build dependencies
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: cmake
BuildRequires: pulseaudio-libs-devel
BuildRequires: libcanberra-devel
BuildRequires: libtool
BuildRequires: dbus-devel
BuildRequires: expat-devel
BuildRequires: pcre-devel
BuildRequires: yaml-cpp-devel
BuildRequires: boost-devel
BuildRequires: dbus-c++-devel
BuildRequires: dbus-devel
BuildRequires: libXext-devel
BuildRequires: yasm
BuildRequires: speex-devel
BuildRequires: chrpath
BuildRequires: check
BuildRequires: astyle
BuildRequires: uuid-c++-devel
BuildRequires: gettext-devel
BuildRequires: gcc-c++
BuildRequires: gettext-devel
BuildRequires: libtool
BuildRequires: make
BuildRequires: which
BuildRequires: yasm
# Build and runtime dependencies. Requires directives are
# automatically made to linked shared libraries via RPM, so there's no
# need to explicitly relist them.
BuildRequires: NetworkManager-libnm-devel
BuildRequires: alsa-lib-devel
BuildRequires: systemd-devel
BuildRequires: libuuid-devel
BuildRequires: libXfixes-devel
BuildRequires: uuid-devel
BuildRequires: dbus-devel
BuildRequires: expat-devel
BuildRequires: gnutls-devel
BuildRequires: nettle-devel
BuildRequires: opus-devel
BuildRequires: jsoncpp-devel
BuildRequires: libnatpmp-devel
BuildRequires: gsm-devel
BuildRequires: libXext-devel
BuildRequires: libXfixes-devel
BuildRequires: libupnp-devel
BuildRequires: gcc-c++
BuildRequires: qt5-qtbase-devel
BuildRequires: gnome-icon-theme-symbolic
BuildRequires: clutter-gtk-devel
BuildRequires: clutter-devel
BuildRequires: glib2-devel
BuildRequires: gtk3-devel
BuildRequires: libnotify-devel
BuildRequires: qt5-qttools-devel
BuildRequires: qrencode-devel
BuildRequires: libappindicator-gtk3-devel
BuildRequires: NetworkManager-libnm-devel
BuildRequires: libuuid-devel
BuildRequires: libva-devel
BuildRequires: libvdpau-devel
BuildRequires: nettle-devel
BuildRequires: opus-devel
BuildRequires: pcre-devel
BuildRequires: pulseaudio-libs-devel
BuildRequires: uuid-c++-devel
BuildRequires: uuid-devel
BuildRequires: webkitgtk4-devel
BuildRequires: cryptopp-devel
BuildRequires: yaml-cpp-devel
%description
Jami is free software for universal communication which respects freedoms
and privacy of its users.
.
This package contains the desktop client: jami-gnome.
This package contains the daemon of Jami, a free software for
universal communication which respects the freedoms and privacy of its
users.
%prep
%setup -n ring-project
%build
###########################
## Ring Daemon configure ##
###########################
# Configure the Jami bundled libraries (ffmpeg & pjproject).
mkdir -p daemon/contrib/native
cd %{_builddir}/ring-project/daemon/contrib/native && \
../bootstrap \
......@@ -97,9 +73,10 @@ cd %{_builddir}/ring-project/daemon/contrib/native && \
--disable-natpmp && \
make list && \
make fetch && \
make -j4 V=1 && \
make -j4 V=1 .ffmpeg
make %{_smp_mflags} V=1 && \
make %{_smp_mflags} V=1 .ffmpeg
# Configure the daemon.
cd %{_builddir}/ring-project/daemon && \
./autogen.sh && \
./configure \
......@@ -107,123 +84,38 @@ cd %{_builddir}/ring-project/daemon && \
--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
# Build the daemon.
make -C %{_builddir}/ring-project/daemon %{_smp_mflags} V=1
pod2man %{_builddir}/ring-project/daemon/man/dring.pod \
> %{_builddir}/ring-project/daemon/dring.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
cp %{_builddir}/ring-project/daemon/dring.1 \
%{buildroot}/%{_mandir}/man1/dring.1
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/fedora/%{postinst} %{buildroot}/%{_bindir}
chmod a+x %{buildroot}/%{_bindir}/%{postinst}
%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*
%{_libdir}/ring/dring
%{_datadir}/ring/ringtones
%{_datadir}/dbus-1/services/*
%{_datadir}/dbus-1/interfaces/
%{_bindir}/%{postinst}
%{_datadir}/dbus-1/interfaces/*
%doc %{_mandir}/man1/dring*
%package devel
Summary: Development files of the Jami daemon
%description devel
This package contains the header files for using the Jami daemon as a library.
%files devel
%{_includedir}/dring
%{_includedir}/jami_contact.h
%post
/sbin/ldconfig
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
if [ $1 == 1 ];then
%{_bindir}/%{postinst}
fi
%postun
/sbin/ldconfig
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
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%changelog
%define name jami-gnome
%define version RELEASE_VERSION
%define release 0
Name: %{name}
Version: %{version}
Release: %{release}%{?dist}
Summary: GNOME desktop client for Jami
Group: Applications/Internet
License: GPLv3+
Vendor: Savoir-faire Linux
URL: https://jami.net/
Source: jami_%{version}.tar.gz
Requires: jami-libclient = %{version}
# Build dependencies.
BuildRequires: cmake
BuildRequires: gcc
BuildRequires: make
BuildRequires: gettext-devel
# Build and runtime dependencies.
BuildRequires: glib2-devel
BuildRequires: dbus-devel
BuildRequires: libnotify-devel
BuildRequires: clutter-devel
BuildRequires: clutter-gtk-devel
BuildRequires: gtk3-devel
BuildRequires: libappindicator-gtk3-devel
BuildRequires: libcanberra-devel
BuildRequires: qrencode-devel
BuildRequires: webkitgtk4-devel
%description
This package contains the GNOME desktop client of Jami. Jami is a free
software for universal communication which respects freedoms and
privacy of its users.
%prep %setup -n ring-project
%build
cd %{_builddir}/ring-project/client-gnome && \
mkdir build && cd build && \
cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DCMAKE_INSTALL_LIBDIR=%{_libdir} \
-DCMAKE_BUILD_TYPE=Debug \
-DGSETTINGS_LOCALCOMPILE=OFF \
..
make -C %{_builddir}/ring-project/client-gnome/build \
LDFLAGS="-lpthread" %{_smp_mflags} V=1
%install
DESTDIR=%{buildroot} make -C %{_builddir}/ring-project/client-gnome/build install
# Only keep /bin/jami-gnome for the GNOME client.
rm -rfv %{buildroot}/%{_bindir}/jami
rm -rfv %{buildroot}/%{_bindir}/ring.cx
%files
%defattr(-,root,root,-)
%{_bindir}/jami-gnome
%{_datadir}/applications/jami-gnome.desktop
%{_datadir}/glib-2.0/schemas/net.jami.Jami.gschema.xml
%{_datadir}/icons/hicolor/scalable/apps/jami.svg
%{_datadir}/jami-gnome
%{_datadir}/locale/*
%{_datadir}/metainfo/jami-gnome.appdata.xml
%{_datadir}/sounds/jami-gnome
%define name jami-libclient
%define version RELEASE_VERSION
%define release 0
Name: %{name}
Version: %{version}
Release: %{release}%{?dist}
Summary: Client library for Jami
Group: Applications/Internet
License: GPLv3+
Vendor: Savoir-faire Linux
URL: https://jami.net/
Source: jami_%{version}.tar.gz
Requires: jami-daemon = %{version}
# Build dependencies
BuildRequires: NetworkManager-libnm-devel
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: jami-daemon-devel = %{version}
BuildRequires: make
BuildRequires: qt5-qtbase-devel
BuildRequires: qt5-qttools-devel
%description
This package contains the client library of Jami, a free software for
universal communication which respects freedoms and privacy of its
users.
%prep
%setup -n ring-project
%build
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 \
..
make -C %{_builddir}/ring-project/lrc/build %{_smp_mflags} V=1
%install
DESTDIR=%{buildroot} make -C lrc/build install
%files
%defattr(-,root,root,-)
%{_libdir}/libringclient.so.1.0.0
%{_datadir}/libringclient
%package devel
Summary: Development files of the Jami client library
%description devel
This package contains the header files and the unversioned shared
library for developing with the Jami client library.
%files devel
%{_includedir}/libringclient
%{_libdir}/cmake/LibRingClient
# The following is a symbolic link.
%{_libdir}/libringclient.so
%post
/sbin/ldconfig
%postun
/sbin/ldconfig
%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: dbus-devel
BuildRequires: expat-devel
BuildRequires: pcre-devel
BuildRequires: yaml-cpp-devel
BuildRequires: boost-devel
BuildRequires: dbus-c++-devel
BuildRequires: dbus-devel
BuildRequires: libXext-devel
BuildRequires: yasm
BuildRequires: speex-devel
BuildRequires: chrpath
BuildRequires: check
BuildRequires: astyle
BuildRequires: uuid-c++-devel
BuildRequires: gettext-devel
BuildRequires: gcc-c++
BuildRequires: which
BuildRequires: alsa-lib-devel
BuildRequires: systemd-devel
BuildRequires: libuuid-devel
BuildRequires: libXfixes-devel
BuildRequires: uuid-devel
BuildRequires: gnutls-devel
BuildRequires: nettle-devel
BuildRequires: opus-devel
BuildRequires: jsoncpp-devel
BuildRequires: libnatpmp-devel
BuildRequires: gsm-devel
BuildRequires: libupnp-devel
BuildRequires: gcc-c++
BuildRequires: qt5-qtbase-devel
BuildRequires: gnome-icon-theme-symbolic
BuildRequires: clutter-gtk-devel
BuildRequires: clutter-devel
BuildRequires: glib2-devel
BuildRequires: gtk3-devel
BuildRequires: libnotify-devel
BuildRequires: qt5-qttools-devel
BuildRequires: qrencode-devel
BuildRequires: libappindicator-gtk3-devel
BuildRequires: NetworkManager-libnm-devel
BuildRequires: libva-devel
BuildRequires: webkitgtk4-devel
BuildRequires: cryptopp-devel
BuildRequires: libvdpau-devel
%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
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/*
%files all
%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}/so