From 7fe46ed51c2e482dee5a464a8452d0da81ee559c Mon Sep 17 00:00:00 2001 From: Heini Date: Sun, 23 Aug 2015 14:18:06 +0200 Subject: [PATCH] Provide RedHat family packaging script. --- build_scripts/RedHat+Fedora/00Readme | 14 +++ build_scripts/RedHat+Fedora/data/24x24 | 1 + build_scripts/RedHat+Fedora/data/48x48 | 1 + build_scripts/RedHat+Fedora/data/64x64 | 1 + .../RedHat+Fedora/data/retroshare.desktop | 9 ++ .../RedHat+Fedora/data/retroshare.png | 1 + .../RedHat+Fedora/data/retroshare.xpm | 1 + build_scripts/RedHat+Fedora/makePackages.sh | 85 +++++++++++++ build_scripts/RedHat+Fedora/retroshare06.spec | 118 ++++++++++++++++++ 9 files changed, 231 insertions(+) create mode 100644 build_scripts/RedHat+Fedora/00Readme create mode 120000 build_scripts/RedHat+Fedora/data/24x24 create mode 120000 build_scripts/RedHat+Fedora/data/48x48 create mode 120000 build_scripts/RedHat+Fedora/data/64x64 create mode 100644 build_scripts/RedHat+Fedora/data/retroshare.desktop create mode 120000 build_scripts/RedHat+Fedora/data/retroshare.png create mode 120000 build_scripts/RedHat+Fedora/data/retroshare.xpm create mode 100755 build_scripts/RedHat+Fedora/makePackages.sh create mode 100644 build_scripts/RedHat+Fedora/retroshare06.spec diff --git a/build_scripts/RedHat+Fedora/00Readme b/build_scripts/RedHat+Fedora/00Readme new file mode 100644 index 000000000..f1b74889c --- /dev/null +++ b/build_scripts/RedHat+Fedora/00Readme @@ -0,0 +1,14 @@ +This is the build directory for RPM based Linux distributions like RedHat +Enterprise Linux and compatible distributions (CentOS, Oracle Linux, ...) or +Fedora. + +To create an RPM package (as well as Source RPM) for your distribution, just +run the makePackages.sh script found in this directory, like so: + + ./makepackages.sh + +The script needs the rpmbuild command, which is part of the rpm-build package. + +In case any build dependency is missing, the rpmbuild command will fail. Just +install the missing package(s) and restart the script (Hint: all needed +packages are listed in the provided retroshare06.spec file.) diff --git a/build_scripts/RedHat+Fedora/data/24x24 b/build_scripts/RedHat+Fedora/data/24x24 new file mode 120000 index 000000000..77a1374cb --- /dev/null +++ b/build_scripts/RedHat+Fedora/data/24x24 @@ -0,0 +1 @@ +../../Debian+Ubuntu/data/24x24 \ No newline at end of file diff --git a/build_scripts/RedHat+Fedora/data/48x48 b/build_scripts/RedHat+Fedora/data/48x48 new file mode 120000 index 000000000..4780cf1bb --- /dev/null +++ b/build_scripts/RedHat+Fedora/data/48x48 @@ -0,0 +1 @@ +../../Debian+Ubuntu/data/48x48 \ No newline at end of file diff --git a/build_scripts/RedHat+Fedora/data/64x64 b/build_scripts/RedHat+Fedora/data/64x64 new file mode 120000 index 000000000..ab693380a --- /dev/null +++ b/build_scripts/RedHat+Fedora/data/64x64 @@ -0,0 +1 @@ +../../Debian+Ubuntu/data/64x64 \ No newline at end of file diff --git a/build_scripts/RedHat+Fedora/data/retroshare.desktop b/build_scripts/RedHat+Fedora/data/retroshare.desktop new file mode 100644 index 000000000..504ca9048 --- /dev/null +++ b/build_scripts/RedHat+Fedora/data/retroshare.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Version=1.0 +Name=RetroShare06 +Comment=Securely share files with your friends +Exec=/usr/bin/RetroShare06 +Icon=/usr/share/pixmaps/retroshare06.xpm +Terminal=false +Type=Application +Categories=Network;P2P; diff --git a/build_scripts/RedHat+Fedora/data/retroshare.png b/build_scripts/RedHat+Fedora/data/retroshare.png new file mode 120000 index 000000000..ec895c801 --- /dev/null +++ b/build_scripts/RedHat+Fedora/data/retroshare.png @@ -0,0 +1 @@ +../../Debian+Ubuntu/data/retroshare.png \ No newline at end of file diff --git a/build_scripts/RedHat+Fedora/data/retroshare.xpm b/build_scripts/RedHat+Fedora/data/retroshare.xpm new file mode 120000 index 000000000..1d158a657 --- /dev/null +++ b/build_scripts/RedHat+Fedora/data/retroshare.xpm @@ -0,0 +1 @@ +../../Debian+Ubuntu/data/retroshare.xpm \ No newline at end of file diff --git a/build_scripts/RedHat+Fedora/makePackages.sh b/build_scripts/RedHat+Fedora/makePackages.sh new file mode 100755 index 000000000..805209895 --- /dev/null +++ b/build_scripts/RedHat+Fedora/makePackages.sh @@ -0,0 +1,85 @@ +#!/bin/bash + +###################### PARAMETERS #################### +VERSION="0.6.0" +###################################################### +dirs -c + +echo "This script is going to build the RedHat family source package for RetroShare, from a clone of the GitHub repository." + +# Parse options +while [[ ${#} > 0 ]] +do + case ${1} in + "-h") shift + echo "Package building script for RedHat family distributions" + echo "Usage:" + echo " ${0}" + exit 1 + ;; + "*") echo "Unknown option" + exit 1 + ;; + esac +done + +GITROOT=$(git rev-parse --show-toplevel) +DATE=$(git log --pretty=format:"%ai" | head -1 | cut -d\ -f1 | sed -e s/-//g) +HASH=$(git log --pretty=format:"%H" | head -1 | cut -c1-8) +REV=${DATE}.${HASH} +FULL_VERSION=${VERSION}.${REV} + +echo "Using version number: ${VERSION}" +echo "Using revision: ${REV}" +echo "Hit ENTER if this is correct. Otherwise hit Ctrl+C" +read tmp + +WORKDIR="retroshare06-${FULL_VERSION}" + +if [[ -d ${WORKDIR} ]] +then + echo "Removing the directory ${WORKDIR}..." + rm -rf ${WORKDIR} +fi +mkdir -p ${WORKDIR}/src + +echo "Copying sources into workdir..." +rsync -rc --exclude build_scripts ${GITROOT}/* ${WORKDIR}/src +rsync -rc --copy-links data ${WORKDIR}/src +pushd ${WORKDIR} >/dev/null + +# Cloning sqlcipher +echo "Cloning sqlcipher repository..." +mkdir lib +pushd lib >/dev/null +git clone https://github.com/sqlcipher/sqlcipher.git +pushd sqlcipher >/dev/null +git checkout v3.3.1 +rm -rf .git +popd >/dev/null +popd >/dev/null + +# VOIP tweak +cp src/retroshare-gui/src/gui/chat/PopupChatDialog.ui src/plugins/VOIP/gui/PopupChatDialog.ui + +# cleaning up protobof generated files +rm -f src/retroshare-nogui/src/rpc/proto/gencc/*.pb.h +rm -f src/retroshare-nogui/src/rpc/proto/gencc/*.pb.cc + +# setup version numbers +echo "Setting version numbers..." +sed -e "s%RS_REVISION_NUMBER.*%RS_REVISION_NUMBER 0x${HASH}%" src/libretroshare/src/retroshare/rsversion.in >src/libretroshare/src/retroshare/rsversion.h +popd >/dev/null + +echo "Creating RPMs..." +[[ -d rpm-build/rpm ]] || mkdir -p rpm-build/rpm +pushd rpm-build/rpm >/dev/null +for DIR in BUILD RPMS SOURCES SPECS SRPMS +do + [[ -d ${DIR} ]] || mkdir ${DIR} +done +popd >/dev/null +tar -zcf rpm-build/rpm/SOURCES/${WORKDIR}.tar.gz ${WORKDIR} +rpmbuild --define="%rev ${REV}" --define="%_usrsrc $PWD/rpm-build" --define="%_topdir %{_usrsrc}/rpm" -ba retroshare06.spec +rm -rf ${WORKDIR} +exit 0 diff --git a/build_scripts/RedHat+Fedora/retroshare06.spec b/build_scripts/RedHat+Fedora/retroshare06.spec new file mode 100644 index 000000000..3004e2fc4 --- /dev/null +++ b/build_scripts/RedHat+Fedora/retroshare06.spec @@ -0,0 +1,118 @@ +Summary: Secure communication with friends +Name: retroshare06 +Version: 0.6.0.%{rev} +Release: 1%{?dist} +License: GPLv3 +Group: Productivity/Networking/Other +URL: http://retroshare.sourceforge.net/ +Source0: %{name}-%{version}.tar.gz +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root +Requires: qt-x11 +BuildRequires: gcc-c++ qt-devel desktop-file-utils libgnome-keyring-devel glib2-devel libssh-devel protobuf-devel libcurl-devel libxml2-devel libxslt-devel openssl-devel libXScrnSaver-devel libupnp-devel bzip2-devel libmicrohttpd-devel +# This is because of sqlcipher: +BuildRequires: tcl + +%description +RetroShare is a decentralized, private and secure commmunication and sharing platform. RetroShare provides filesharing, chat, messages, forums and channels. + +Authors: +see http://retroshare.sourceforge.net/team.html + +%package nogui +Summary: RetroShare cli client +Group: Productivity/Network/Other +Requires: openssl +Conflicts: %name = %{version} + +%description nogui +This is the command-line client for RetroShare network. This client can be contacted and talked-to using SSL. Clients exist for portable devices running e.g. Android. + +%package voip-plugin +Summary: RetroShare VOIP plugin +Group: Productivity/Networking/Other +Requires: %name = %{version} +BuildRequires: opencv-devel speex-devel +%if 0%{?fedora} >= 22 +BuildRequires: speexdsp-devel +%endif + +%description voip-plugin +This package provides a plugin for RetroShare, a secured Friend-to-Friend communication platform. The plugin adds voice-over-IP functionality to the private chat window. Both friends chatting together need the plugin installed to be able to talk together. + +%package feedreader-plugin +Summary: RetroShare FeedReader plugin +Group: Productivity/Networking/Other +Requires: %name = %{version} + +%description feedreader-plugin +This package provides a plugin for RetroShare, a secured Friend-to-Friend communication platform. The plugin adds a RSS feed reader tab to retroshare. + +%prep +%setup -q -a 0 + +%build +cd lib/sqlcipher +./configure --disable-shared --enable-static --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto" +make +cd - +cd src +qmake-qt4 CONFIG=release RetroShare.pro +make +cd - + +%install +rm -rf $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT%{_bindir} +mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps +mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications +mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/24x24/apps +mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps +mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/64x64/apps +mkdir -p $RPM_BUILD_ROOT%{_datadir}/RetroShare06 +mkdir -p $RPM_BUILD_ROOT/usr/lib/retroshare/extensions6 +#bin +install -m 755 src/retroshare-gui/src/RetroShare $RPM_BUILD_ROOT%{_bindir}/RetroShare06 +install -m 755 src/retroshare-nogui/src/retroshare-nogui $RPM_BUILD_ROOT%{_bindir}/RetroShare06-nogui +#icons +install -m 644 src/data/retroshare.xpm $RPM_BUILD_ROOT%{_datadir}/pixmaps/retroshare06.xpm +install -m 644 src/data/24x24/retroshare.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/24x24/apps/retroshare06.png +install -m 644 src/data/48x48/retroshare.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps/retroshare06.png +install -m 644 src/data/64x64/retroshare.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/64x64/apps/retroshare06.png +install -m 644 src/data/retroshare.desktop $RPM_BUILD_ROOT%{_datadir}/applications/retroshare06.desktop +install -m 644 src/libbitdht/src/bitdht/bdboot.txt $RPM_BUILD_ROOT%{_datadir}/RetroShare06/ +#plugins +install -m 755 src/plugins/VOIP/libVOIP.so $RPM_BUILD_ROOT/usr/lib/retroshare/extensions6/ +install -m 755 src/plugins/FeedReader/libFeedReader.so $RPM_BUILD_ROOT/usr/lib/retroshare/extensions6/ +#menu +desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/retroshare06.desktop + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root,-) +%{_bindir}/RetroShare06 +%defattr(644, root, root) +%{_datadir}/pixmaps/%{name}.xpm +%{_datadir}/icons/hicolor +%{_datadir}/applications/%{name}.desktop +%{_datadir}/RetroShare06 + +%files nogui +%defattr(-, root, root) +%{_bindir}/RetroShare06-nogui +%defattr(644, root, root) +%{_datadir}/RetroShare06 + +%files voip-plugin +%defattr(-, root, root) +/usr/lib/retroshare/extensions6/libVOIP.so + +%files feedreader-plugin +%defattr(-, root, root) +/usr/lib/retroshare/extensions6/libFeedReader.so + +%changelog +* Sat Apr 4 2015 Heini - +- Initial build. +