From 6096e314e44d3f8c33a7b5c50f88e34360823dc1 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com> Date: Wed, 2 Jun 2021 09:52:47 -0400 Subject: [PATCH] Build jami-libclient (LRC) with libwrap enabled. * packaging/rules/debian/rules (override_dh_auto_configure): Move recipes to ... (override_dh_auto_configure_build): ... here. This is necessary as the LRC now must find the share library of the daemon, hence it must be built before the LRC configuration occurs. <-DENABLE_LIBWRAP=true>: New option when configuring the LRC. * packaging/rules/rpm/jami-libclient.spec (%build): Likewise. * scripts/install.sh (lrc_cmake_flags): Likewise. (OSTYPE): Remove variable. (sharedLib): Remove variable. The Jami daemon shared library is needed when dynamically linking against it when libwrap is enabled. * packaging/rules/rpm/jami-daemon.spec (%build): Drop the --disable-shared option. (%files): Register the libring.so dynamic library. * packaging/rules/debian/rules (override_dh_auto_configure): Drop the --disable-shared option. GitLab: https://git.jami.net/savoirfairelinux/jami-packaging/-/issues/101 Change-Id: Id1acaaf15a0f3d561c73bf34dde48f4eaf058eed --- packaging/rules/debian/rules | 67 ++++++++----------------- packaging/rules/rpm/jami-daemon.spec | 4 +- packaging/rules/rpm/jami-libclient.spec | 1 + scripts/install.sh | 13 ++--- 4 files changed, 29 insertions(+), 56 deletions(-) diff --git a/packaging/rules/debian/rules b/packaging/rules/debian/rules index 276f2f87..a1fd53bb 100755 --- a/packaging/rules/debian/rules +++ b/packaging/rules/debian/rules @@ -55,9 +55,9 @@ OCI_INSTALL_DIR = $(CURDIR)/debian/$(JAMI_ALL_IN_ONE_PKG_NAME) dh $@ override_dh_auto_configure: - ########################### - ## Daemon configure ## - ########################### + +override_dh_auto_build: + # Daemon contribs build + configure mkdir -p daemon/contrib/native cd daemon/contrib/native && \ ../bootstrap \ @@ -79,64 +79,41 @@ override_dh_auto_configure: cd daemon && \ ./autogen.sh && \ ./configure \ - --disable-shared \ --prefix=/usr \ --host=${HOST_ARCH} - ############################# - ## libringclient configure ## - ############################# + # Daemon build + make -C daemon -j$(NO_CPUS) V=1 + pod2man daemon/man/jamid.pod > daemon/jamid.1 + + # Libringclient configure cd lrc && \ mkdir build && \ cd build && \ cmake \ -DRING_BUILD_DIR=$(CURDIR)/daemon/src \ - -DENABLE_LIBWRAP=false \ + -DENABLE_LIBWRAP=true \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_LIBDIR=lib \ $(CMAKE_OPTIONS) .. - ############################ - ## gnome client configure ## - ############################ - cd client-gnome && \ - mkdir build && \ - cd build && \ - cmake \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DCMAKE_INSTALL_LIBDIR=lib \ - -DLibRingClient_PROJECT_DIR=/$(CURDIR)/lrc \ - -DGSETTINGS_LOCALCOMPILE=OFF \ - $(CMAKE_OPTIONS) \ - .. - - ######################### - ## qt client configure ## - ######################### - # needs to be done after lrc is built; see below - - dh_auto_configure - -override_dh_auto_build: - ####################### - ## Daemon build ## - ####################### - make -C daemon -j$(NO_CPUS) V=1 - pod2man daemon/man/jamid.pod > daemon/jamid.1 - - ######################### - ## libringclient build ## - ######################### + # libringclient build make -C lrc/build -j$(NO_CPUS) V=1 - ######################## - ## gnome client build ## - ######################## + # GNOME client configure + cd client-gnome && \ + mkdir build && \ + cd build && \ + cmake -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DLibRingClient_PROJECT_DIR=/$(CURDIR)/lrc \ + -DGSETTINGS_LOCALCOMPILE=OFF \ + $(CMAKE_OPTIONS) .. + + # GNOME client build make -C client-gnome/build LDFLAGS="-lpthread" -j$(NO_CPUS) V=1 - ################################### - ## qt client configure and build ## - ################################### + # Qt client configure and build cd client-qt && \ mkdir build && \ cd build && \ diff --git a/packaging/rules/rpm/jami-daemon.spec b/packaging/rules/rpm/jami-daemon.spec index 82be069c..ec16bac0 100644 --- a/packaging/rules/rpm/jami-daemon.spec +++ b/packaging/rules/rpm/jami-daemon.spec @@ -85,8 +85,7 @@ cd %{_builddir}/ring-project/daemon && \ ./autogen.sh && \ ./configure \ --prefix=%{_prefix} \ - --libdir=%{_libdir} \ - --disable-shared + --libdir=%{_libdir} # Build the daemon. make -C %{_builddir}/ring-project/daemon %{_smp_mflags} V=1 @@ -102,6 +101,7 @@ rm -rfv %{buildroot}/%{_libdir}/*.la %files %defattr(-,root,root,-) +%{_libdir}/libring.so* # XXX: Use %%{_libexecdir}/jamid after there's no more OpenSUSE Leap # < 16 (see https://en.opensuse.org/openSUSE:Specfile_guidelines). /usr/libexec/jamid diff --git a/packaging/rules/rpm/jami-libclient.spec b/packaging/rules/rpm/jami-libclient.spec index 55556bc3..e8052629 100644 --- a/packaging/rules/rpm/jami-libclient.spec +++ b/packaging/rules/rpm/jami-libclient.spec @@ -34,6 +34,7 @@ users. cd %{_builddir}/ring-project/lrc && \ mkdir build && cd build && \ cmake -DRING_BUILD_DIR=%{_builddir}/ring-project/daemon/src \ + -DENABLE_LIBWRAP=true \ -DCMAKE_INSTALL_PREFIX=%{_prefix} \ -DCMAKE_INSTALL_LIBDIR=%{_libdir} \ -DCMAKE_BUILD_TYPE=Debug \ diff --git a/scripts/install.sh b/scripts/install.sh index 5c2b8020..b053090e 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -1,7 +1,6 @@ #!/usr/bin/env bash # Build and install to a local prefix under this repository. -export OSTYPE # Flags: @@ -81,7 +80,7 @@ else BUILDDIR="build-local" fi -# dring +# jamid DAEMON=${TOP}/daemon cd "$DAEMON" @@ -96,15 +95,10 @@ mkdir -p contrib/native # Build the daemon itself. test -f configure || ./autogen.sh -if [[ "$OSTYPE" != "darwin"* ]]; then - # Keep the shared libaries on MAC OSX. - sharedLib="--disable-shared" -fi - if [ "${global}" = "true" ]; then - ./configure $sharedLib "$CONFIGURE_FLAGS" ${prefix:+"--prefix=$prefix"} + ./configure "$CONFIGURE_FLAGS" ${prefix:+"--prefix=$prefix"} else - ./configure $sharedLib "$CONFIGURE_FLAGS" --prefix="${INSTALL}/daemon" + ./configure "$CONFIGURE_FLAGS" --prefix="${INSTALL}/daemon" fi make -j"${proc}" V=1 make_install "${global}" "${priv_install}" @@ -144,6 +138,7 @@ lrc_cmake_flags=(-DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" -DCMAKE_BUILD_TYPE=Debug -DQT5_VER="${qt5ver}" -DQT5_PATH="${qt5path}" + -DENABLE_LIBWRAP=true $static) if [ "${global}" = "true" ]; then lrc_cmake_flags+=(${prefix:+"-DCMAKE_INSTALL_PREFIX=$prefix"}) -- GitLab