Commit fb7d2d31 authored by aviau's avatar aviau

Packaging: Fedora support

Change-Id: Ie65d01f8b18ccf930244c1d8e4cd3ffc73de3c9a
Tuleap: #884
parent 5e8170bb
......@@ -80,7 +80,13 @@ package-all: package-debian_8 \
package-ubuntu_15.10 \
package-ubuntu_15.10_i386 \
package-ubuntu_16.04 \
package-ubuntu_16.04_i386
package-ubuntu_16.04_i386 \
package-fedora_22 \
package-fedora_22_i386 \
package-fedora_23 \
package-fedora_23_i386 \
package-fedora_24 \
package-fedora_24_i386
# Append the output of make-packaging-target to this Makefile
# see Makefile.packaging.distro_targets
......
FROM fedora:22
RUN dnf clean all
RUN dnf install -y yum-utils rpmdevtools
RUN dnf clean all
RUN dnf upgrade -y && \
dnf install -y \
rpm-build \
tar \
make \
autoconf \
automake \
cmake \
speexdsp-devel \
pulseaudio-libs-devel \
libsamplerate-devel \
libtool \
dbus-devel \
expat-devel \
pcre-devel \
yaml-cpp-devel \
boost-devel \
dbus-c++-devel \
dbus-devel \
libsndfile-devel \
libXext-devel \
libXfixes-devel \
yasm \
speex-devel \
gsm-devel \
chrpath \
check \
astyle \
uuid-c++-devel \
libupnp-devel \
gettext-devel \
gcc-c++ \
which \
alsa-lib-devel \
systemd-devel \
libuuid-devel \
uuid-devel \
gnutls-devel \
nettle-devel \
opus-devel \
patch \
jsoncpp-devel \
libnatpmp-devel
ADD scripts/build-package-fedora.sh /opt/build-package-fedora.sh
CMD /opt/build-package-fedora.sh
FROM savoirfairelinux/ring-fedora32:22
RUN dnf clean all
RUN dnf install -y yum-utils rpmdevtools
RUN dnf clean all
RUN dnf upgrade -y && \
dnf install -y \
rpm-build \
tar \
make \
autoconf \
automake \
cmake \
speexdsp-devel \
pulseaudio-libs-devel \
libsamplerate-devel \
libtool \
dbus-devel \
expat-devel \
pcre-devel \
yaml-cpp-devel \
boost-devel \
dbus-c++-devel \
dbus-devel \
libsndfile-devel \
libXext-devel \
libXfixes-devel \
yasm \
speex-devel \
gsm-devel \
chrpath \
check \
astyle \
uuid-c++-devel \
libupnp-devel \
gettext-devel \
gcc-c++ \
which \
alsa-lib-devel \
systemd-devel \
libuuid-devel \
uuid-devel \
gnutls-devel \
nettle-devel \
opus-devel \
patch \
jsoncpp-devel \
libnatpmp-devel
ADD scripts/build-package-fedora.sh /opt/build-package-fedora.sh
CMD /opt/build-package-fedora.sh
FROM fedora:23
RUN dnf clean all
RUN dnf install -y yum-utils rpmdevtools
RUN dnf clean all
RUN dnf upgrade -y && \
dnf install -y \
rpm-build \
tar \
make \
autoconf \
automake \
cmake \
speexdsp-devel \
pulseaudio-libs-devel \
libsamplerate-devel \
libtool \
dbus-devel \
expat-devel \
pcre-devel \
yaml-cpp-devel \
boost-devel \
dbus-c++-devel \
dbus-devel \
libsndfile-devel \
libXext-devel \
libXfixes-devel \
yasm \
speex-devel \
gsm-devel \
chrpath \
check \
astyle \
uuid-c++-devel \
libupnp-devel \
gettext-devel \
gcc-c++ \
which \
alsa-lib-devel \
systemd-devel \
libuuid-devel \
uuid-devel \
gnutls-devel \
nettle-devel \
opus-devel \
patch \
jsoncpp-devel \
libnatpmp-devel
ADD scripts/build-package-fedora.sh /opt/build-package-fedora.sh
CMD /opt/build-package-fedora.sh
FROM savoirfairelinux/ring-fedora32:23
RUN dnf clean all
RUN dnf install -y yum-utils rpmdevtools
RUN dnf clean all
RUN dnf upgrade -y && \
dnf install -y \
rpm-build \
tar \
make \
autoconf \
automake \
cmake \
speexdsp-devel \
pulseaudio-libs-devel \
libsamplerate-devel \
libtool \
dbus-devel \
expat-devel \
pcre-devel \
yaml-cpp-devel \
boost-devel \
dbus-c++-devel \
dbus-devel \
libsndfile-devel \
libXext-devel \
libXfixes-devel \
yasm \
speex-devel \
gsm-devel \
chrpath \
check \
astyle \
uuid-c++-devel \
libupnp-devel \
gettext-devel \
gcc-c++ \
which \
alsa-lib-devel \
systemd-devel \
libuuid-devel \
uuid-devel \
gnutls-devel \
nettle-devel \
opus-devel \
patch \
jsoncpp-devel \
libnatpmp-devel
ADD scripts/build-package-fedora.sh /opt/build-package-fedora.sh
CMD /opt/build-package-fedora.sh
FROM fedora:24
RUN dnf clean all
RUN dnf install -y yum-utils rpmdevtools
RUN dnf clean all
RUN dnf upgrade -y && \
dnf install -y \
rpm-build \
tar \
make \
autoconf \
automake \
cmake \
speexdsp-devel \
pulseaudio-libs-devel \
libsamplerate-devel \
libtool \
dbus-devel \
expat-devel \
pcre-devel \
yaml-cpp-devel \
boost-devel \
dbus-c++-devel \
dbus-devel \
libsndfile-devel \
libXext-devel \
libXfixes-devel \
yasm \
speex-devel \
gsm-devel \
chrpath \
check \
astyle \
uuid-c++-devel \
libupnp-devel \
gettext-devel \
gcc-c++ \
which \
alsa-lib-devel \
systemd-devel \
libuuid-devel \
uuid-devel \
gnutls-devel \
nettle-devel \
opus-devel \
patch \
jsoncpp-devel \
libnatpmp-devel
ADD scripts/build-package-fedora.sh /opt/build-package-fedora.sh
CMD /opt/build-package-fedora.sh
FROM savoirfairelinux/ring-fedora32:24
RUN dnf clean all
RUN dnf install -y yum-utils rpmdevtools
RUN dnf clean all
RUN dnf upgrade -y && \
dnf install -y \
rpm-build \
tar \
make \
autoconf \
automake \
cmake \
speexdsp-devel \
pulseaudio-libs-devel \
libsamplerate-devel \
libtool \
dbus-devel \
expat-devel \
pcre-devel \
yaml-cpp-devel \
boost-devel \
dbus-c++-devel \
dbus-devel \
libsndfile-devel \
libXext-devel \
libXfixes-devel \
yasm \
speex-devel \
gsm-devel \
chrpath \
check \
astyle \
uuid-c++-devel \
libupnp-devel \
gettext-devel \
gcc-c++ \
which \
alsa-lib-devel \
systemd-devel \
libuuid-devel \
uuid-devel \
gnutls-devel \
nettle-devel \
opus-devel \
patch \
jsoncpp-devel \
libnatpmp-devel
ADD scripts/build-package-fedora.sh /opt/build-package-fedora.sh
CMD /opt/build-package-fedora.sh
%define name ring
%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://ring.cx/
Source: ring_%{version}.tar.gz
Requires: ring-daemon = %{version}
Obsoletes: ring-gnome
BuildRequires: make
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: cmake
BuildRequires: pulseaudio-libs-devel
BuildRequires: libsamplerate-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: libsndfile-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: evolution-data-server-devel
BuildRequires: libnotify-devel
BuildRequires: qt5-qttools-devel
BuildRequires: qrencode-devel
BuildRequires: libappindicator-gtk3-devel
BuildRequires: NetworkManager-glib-devel
%description
Ring is free software for universal communication which respects freedoms
and privacy of its users.
.
This package contains the desktop client: gnome-ring.
%package daemon
Summary: Free software for distributed and secured communication - daemon
%description daemon
Ring is free software for universal communication which respects freedoms
and privacy of its users.
.
This package contains the Ring 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 && \
make list && \
make fetch && \
make -j1 V=1
cd %{_builddir}/ring-project/daemon && \
./autogen.sh && \
./configure \
--prefix=%{_prefix} \
--libdir=%{_libdir}
#############################
## 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 \
..
#######################
## 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
%files
%defattr(-,root,root,-)
%{_bindir}/ring.cx
%{_bindir}/gnome-ring
%{_libdir}/libringclient*.so*
%{_datadir}/glib-2.0/schemas/cx.ring.RingGnome.gschema.xml
%{_datadir}/applications/gnome-ring.desktop
%{_datadir}/gnome-ring/gnome-ring.desktop
%{_datadir}/icons/hicolor/scalable/apps/ring.svg
%{_datadir}/appdata/gnome-ring.appdata.xml
%{_datadir}/libringclient/*
%{_datadir}/locale/*
%doc %{_mandir}/man1/dring*
%files daemon
%defattr(-,root,root,-)
%{_libdir}/ring/dring
%{_datadir}/ring/ringtones
%{_datadir}/dbus-1/services/*
%{_datadir}/dbus-1/interfaces/*
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%changelog
#!/usr/bin/env bash
#
# Copyright (C) 2016 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 -e
# import the spec file
mkdir -p /opt/ring-project
cd /opt/ring-project
cp /opt/ring-project-ro/packaging/rules/fedora/ring.spec .
# Set the version
sed -i "s/RELEASE_VERSION/${RELEASE_VERSION}/g" ring.spec
rpmdev-bumpspec --comment="Automatic nightly release" --userstring="Jenkins <ring@lists.savoirfairelinux.net>" ring.spec
# install build deps
yum-builddep -y ring.spec || echo "ignoring yum-builddep failure"
# place the source
mkdir -p /root/rpmbuild/SOURCES
cp /opt/ring-project-ro/ring_*.tar.gz /root/rpmbuild/SOURCES
# build the package
rpmbuild -ba ring.spec
# move to output
mv /root/rpmbuild/RPMS/*/* /opt/output
touch /opt/output/.packages-built
chown -R ${CURRENT_UID}:${CURRENT_UID} /opt/output
#!/bin/bash
#
# Copyright (C) 2016 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 sings and deploys pacakges from packages/distro.
# It should be ran from the project root directory.
#
# Exit immediately if a command exits with a non-zero status
set -e
for i in "$@"
do
case $i in
--distribution=*)
DISTRIBUTION="${i#*=}"
shift
;;
--keyid=*)
KEYID="${i#*=}"
shift
;;
--remote-repository-location=*)
REMOTE_REPOSITORY_LOCATION="${i#*=}"
shift
;;
--remote-manual-download-location=*)
REMOTE_MANUAL_DOWNLOAD_LOCATION="${i#*=}"
shift
;;
*)
echo "Unrecognized option ${i}"
exit 1
;;
esac
done
##################################################
## Create local repository for the given distro ##
##################################################
echo "#########################"
echo "## Creating repository ##"
echo "#########################"
DISTRIBUTION_REPOSITOIRY_FOLDER=$(realpath repositories)/${DISTRIBUTION}
rm -rf ${DISTRIBUTION_REPOSITOIRY_FOLDER}
mkdir -p ${DISTRIBUTION_REPOSITOIRY_FOLDER}
# .repo file
cat << EOF > ${DISTRIBUTION_REPOSITOIRY_FOLDER}/ring-nightly-man.repo
[ring]
name=Ring \$releasever - \$basearch - ring
baseurl=https://dl.ring.cx/ring-nightly/fedora_\$releasever
gpgcheck=1
gpgkey=https://dl.ring.cx/ring.pub.key
enabled=1
EOF
####################################
## Add packages to the repository ##
####################################
# Sign the rpms
echo "##################"
echo "## signing rpms ##"
echo "##################"
# RPM macros
if [ ! -f ~/.rpmmacros ];
then
echo "%_signature gpg" > ~/.rpmmacros
echo "%_gpg_name ${KEYID}" >> ~/.rpmmacros
fi
for package in packages/${DISTRIBUTION}*/*.rpm; do
rpmsign --resign --key-id=${KEYID} ${package}
cp ${package} ${DISTRIBUTION_REPOSITOIRY_FOLDER}
done
# Create the repo
createrepo --update ${DISTRIBUTION_REPOSITOIRY_FOLDER}
#######################################
## create the manual download folder ##
#######################################
DISTRIBUTION_MANUAL_DOWNLOAD_FOLDER=$(realpath manual-download)/${DISTRIBUTION}
mkdir -p ${DISTRIBUTION_MANUAL_DOWNLOAD_FOLDER}
for package in packages/${DISTRIBUTION}*/*.rpm; do
cp ${package} ${DISTRIBUTION_MANUAL_DOWNLOAD_FOLDER}
package_name=$(rpm -qp --queryformat '%{NAME}' ${package})
package_arch=$(rpm -qp --queryformat '%{ARCH}' ${package})
cp ${package} ${DISTRIBUTION_MANUAL_DOWNLOAD_FOLDER}/${package_name}_${package_arch}.rpm
done
############
## deploy ##
############
# Deploy the repository
echo "##########################"
echo "## deploying repository ##"
echo "##########################"
rsync --archive --recursive --verbose --delete ${DISTRIBUTION_REPOSITOIRY_FOLDER} ${REMOTE_REPOSITORY_LOCATION}
# deploy the manual download files
echo "#####################################"
echo "## deploying manual download files ##"
echo "#####################################"
rsync --archive --recursive --verbose --delete ${DISTRIBUTION_MANUAL_DOWNLOAD_FOLDER} ${REMOTE_MANUAL_DOWNLOAD_LOCATION}
# remove deployed files
rm -rf manual-download
rm -rf repositories
......@@ -60,12 +60,12 @@ $(PACKAGE_%(distribution)s_DOCKER_IMAGE_FILE): docker/Dockerfile_%(distribution)
packages/%(distribution)s:
mkdir -p packages/%(distribution)s
packages/%(distribution)s/$(DEBIAN_DSC_FILENAME): $(RELEASE_TARBALL_FILENAME) packages/%(distribution)s $(PACKAGE_%(distribution)s_DOCKER_IMAGE_FILE)
packages/%(distribution)s/%(output_file)s: $(RELEASE_TARBALL_FILENAME) packages/%(distribution)s $(PACKAGE_%(distribution)s_DOCKER_IMAGE_FILE)
$(PACKAGE_%(distribution)s_DOCKER_RUN_COMMAND)
touch packages/%(distribution)s/*
.PHONY: package-%(distribution)s
package-%(distribution)s: packages/%(distribution)s/$(DEBIAN_DSC_FILENAME)
package-%(distribution)s: packages/%(distribution)s/%(output_file)s
.PHONY: package-%(distribution)s-interactive
package-%(distribution)s-interactive: $(RELEASE_TARBALL_FILENAME) packages/%(distribution)s $(PACKAGE_%(distribution)s_DOCKER_IMAGE_FILE)
......@@ -73,10 +73,11 @@ package-%(distribution)s-interactive: $(RELEASE_TARBALL_FILENAME) packages/%(dis
"""
def generate_target(distribution, debian_packaging_override):
def generate_target(distribution, debian_packaging_override, output_file):
return target_template % {
"distribution": distribution,
"debian_packaging_override": debian_packaging_override,
"output_file": output_file,
}
......@@ -91,43 +92,84 @@ def run_generate_all(parsed_args):
{
"distribution": "debian_8",
"debian_packaging_override": "",
"output_file": "$(DEBIAN_DSC_FILENAME)",
},
{
"distribution": "debian_8_i386",
"debian_packaging_override": "",
"output_file": "$(DEBIAN_DSC_FILENAME)",
},