Bug 29439

Summary: I just made a package for SchildiChat and I am ready to maintain it
Product: Mageia Reporter: christian barranco <chb0>
Component: New RPM package requestAssignee: All Packagers <pkg-bugs>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: Normal CC: fri, marja11
Version: 8   
Target Milestone: ---   
Hardware: x86_64   
OS: Linux   
URL: https://github.com/SchildiChat/schildichat-desktop
Whiteboard:
Source RPM: schildichat-desktop CVE:
Status comment:
Attachments: SPEC for schildichat-desktop-1.7.32-1.squidf.mga8.x86_64.rpm
schildichat-desktop.desktop

Description christian barranco 2021-09-05 17:46:56 CEST
Description of problem:
The choice for Matrix client is limited with Mageia. I have not been convinced by Neochat (don't remember fully why now...) and I have been looking for an alternative.
I recently found SchildiChat (https://schildi.chat or https://github.com/SchildiChat/schildichat-desktop) and just made a package of it.

A couple of persons at MLO have been testing it, and it works well so far.
I have also tested the installation and the login using VMs with MGA8 Cinnamon, Gnome, XFCE and KDE.

I will attach the src.rpm and let me know what you think about it. I am ready to work on any improvement suggestion. I also volunteer to maintain it if you need someone.

What I have not done yet, preventing to rebuild the package from the source, is to create 2 additional packages to install yarn and rustup. It doesn't impact at all the installation and the execution, but it is required to build it. 

It is really quick and easy to install them using 2 command lines. It is the reason why I have spent time to create additional packages:

npm install -g yarn

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh


They have to be run as root, and it is why I have not been able just to add these command into the spec file; at least, I don't know how...
Comment 1 christian barranco 2021-09-05 17:49:52 CEST
Created attachment 12923 [details]
SPEC for schildichat-desktop-1.7.32-1.squidf.mga8.x86_64.rpm

# WARNING: yarn and rustup must be installed prior building
#
# As root:
#   npm install -g yarn
#
#   curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
#
#
#sync with Github
#for debug: %global debug_package %{nil}
%global appid com.github.schildichat-desktop
%global branch master
%global forgesource https://github.com/SchildiChat/schildichat-desktop.git
# App folder in buildroot
%global _appdir %{_libdir}/%{name}
# electron outcome for element-desktop
%global _eledir %_builddir/%{buildsubdir}/element-desktop/dist/linux-unpacked

ExclusiveArch:	x86_64

Summary: Matrix client
Name:       schildichat-desktop
Version:    1.7.32
Release:    %mkrel 1
License:    Apache License 2.0
Group:      Networking/Instant messaging
URL:        https://schildi.chat/
Source0:    https://github.com/SchildiChat/schildichat-desktop/archive/refs/tags/v%{version}-sc1.tar.gz
Patch0:     schildichat-1.7.32-makefile.patch

Source1:    schildichat-desktop.desktop

BuildRequires: bsdtar
BuildRequires: git
BuildRequires: make
BuildRequires: nodejs
BuildRequires: npm
BuildRequires: pkgconfig(libsecret-1)
BuildRequires: pkgconfig(sqlcipher)

#Mageia packages corresponding to debian ones in element-desktop/package.json
Requires: lib64atspi0
Requires: lib64gtk+3_0
Requires: lib64nss3
Requires: lib64uuid1
Requires: lib64xscrnsaver1
Requires: lib64xtst6
Requires: libnotify
Requires: xdg-utils
#For the icons
Requires:       hicolor-icon-theme

%description
A Matrix Client based on Element with messaging interface


%prep
#get the source on Github with the submodules
cd %_sourcedir
if [ ! -f v%{version}-sc1.tar.gz ]; then
    git clone --recurse-submodules %{forgesource} -b v%{version}-sc1 %{name}-%{version}-sc1
    tar -czf v%{version}-sc1.tar.gz %{name}-%{version}-sc1
    rm -rf %{name}-%{version}-sc1
fi
#
%setup -q -n %{name}-%{version}-sc1
%patch0 -p1

%build
%make_build desktop-common

%install
%make_build mageia

# Copy files to buildroot
%{__mkdir_p} %{buildroot}%{_appdir}
cp -rf %{_eledir}/* %{buildroot}%{_appdir}

%{__mkdir_p}  %{buildroot}%{_bindir}
ln -sf %{_appdir}/%{name} %{buildroot}%{_bindir}/

# desktop entry
%{__mkdir_p} %{buildroot}%{_datadir}/applications
%{__install} -m 644 %{SOURCE1} %{buildroot}%{_datadir}/applications/

# icons
for i in 16 24 48 64 96 128 256 512; do
    %{__mkdir_p} %{buildroot}%{_iconsdir}/hicolor/"$i"x"$i"/apps
    %{__install} -m 644 %_builddir/%{buildsubdir}/element-desktop/build/icons/"$i"x"$i".png %{buildroot}%{_iconsdir}/hicolor/"$i"x"$i"/apps/%{name}.png ;
done

%files
%license LICENSE
%doc README.md
%{_bindir}/%{name}
%{_iconsdir}/hicolor/*/apps/*.png
%{_datadir}/applications/*.desktop

%{_appdir}{,.*}

%clean
%make_build clean

%changelog
* Sat Sep 4 2021 squidf <chb0@lavache.com> 1.7.32-1.squidf.mga8
- SchildiChat Desktop version 1.7.32 for Mageia8
Comment 2 christian barranco 2021-09-05 17:50:59 CEST
Created attachment 12924 [details]
schildichat-desktop.desktop
Comment 3 Marja Van Waes 2021-09-05 19:34:51 CEST
Hi Christian,

Great that you want to maintain this package.

Assigning this package request to all packagers collectively. On a voluntary basis, one of them might be willing to mentor you and, if there are no license or other legal issues, want to help you integrate it to the distribution and maintain it for bug and security fixes.

Please read https://wiki.mageia.org/en/Becoming_a_Mageia_Packager and take the steps mentioned there to find a mentor (it is not sure that saying it here is enough, you might need to repeat in different places that you'd like to become a packager) and to start learning about Mageia packaging.

Assignee: bugsquad => pkg-bugs
CC: (none) => marja11
URL: (none) => https://github.com/SchildiChat/schildichat-desktop
Source RPM: (none) => schildichat-desktop

Comment 4 Morgan Leijström 2021-09-06 17:10:20 CEST
Wonderful if we can get this, thank you for the efforts!

Currently i use no "social networks" except forums and email, but intend to start using the https://matrix.org/ network - and from my small investigation see ScildiChat is one of the more competent clients, good choice.

CC: (none) => fri

Comment 5 christian barranco 2021-09-07 07:34:47 CEST
Thanks Morgan

If you want to test it, I have put the rpm in my private depot. 
I can grant you access. Just send me a private message and I will give you the credentials.
Comment 6 christian barranco 2021-09-07 07:41:12 CEST
Note: based on a comment from jybz, the curl command to download and install rustup should not be used, as unsecured. Actually, as I usually don’t use a command I don’t fully master, I have instead downloaded the archive from rustup site and then installed. 

The curl command comes from the GitHub readme. I thought it would be quicker to copy it than explaining to download and install ; my bad…
Comment 7 christian barranco 2021-11-27 17:35:07 CET
Hi
I have improved the spec file in order not to download anything while building.
However, as this software is based on electron, it looks like it will never be compliant with Mageia policy.

If you confirm so, I propose to close this report. Just let me know.

I will still maintain it for the MLO community repo, as this matrix seems to be really appreciated. Plus, we don't have so many fully functional matrix clients.
Comment 8 christian barranco 2023-03-05 22:15:56 CET
Hi. This will work if and only if Electron is package. I have understood it is not compliant with Mageia policy. Then, I close this report.

Status: NEW => RESOLVED
Resolution: (none) => WONTFIX