You are not logged in.

#1 2020-11-11 22:31:53

MountainX
Member
Registered: 2016-02-08
Posts: 371

PKGBUILD help request: filecloudsync

I do not find an existing AUR package for filecloudsync. I can help create a PKGBUILD. I will also volunteer to be a maintainer because I use filecloudsync and plan to keep up with updates.

The first issues I'm running into are:

1. The company does not version the source tar files, nor do they list versions on the download page. I asked them to start providing some version info for releases, but of course I don't know if or when they actually will. I can get version info from the running app and I think I can get it by grepping on the binary. Knowing the current version, I found it at the end of the binary file:

grep -a '20.2.0.4766$' filecloudsync_linux_amd64/filecloudsync

--Show Statussyncindicator50201BadSSLCertificateAccount not configured Sync Appv20.2.0.4766

From that, does it looks like I can search for the string "Sync Appv" near the end of the binary and reliably get the version number?  (I'd like to know the version independently from running the app.)

2. They don't mention a license type anywhere that I found. (Not exactly related, but they allow unlimited free limited guest accounts for paying customers like me. This allows me to share files with colleagues without those people paying for any filecloud services.)

3. They (filecloud devs) install the application into a user's home directory instead of to the system directories. See my questions below abotu where the files should be installed.

4. The dependencies are Ubuntu-specific packages:

# Install prerequisites: libpng12, libdbusmenu-gtk-dev
echo -e "Extracting required libpng12 libraries to '$installdir'."
ar x libpng12-0_1.2.54-1ubuntu1.1_amd64.deb
tar -xf data.tar.xz --wildcards ./lib/x86_64-linux-gnu/libpng12.so.0* -C . --strip-components 3
mv libpng12.so.0* $installdir

The Arch packages required are:
- Arch Linux - libdbusmenu-gtk2 16.04.0-4 (x86_64)
- Arch Linux - libpng12 1.2.59-2 (x86_64)

Here are my questions about file locations.

Binaries: Should these be installed into "/usr/bin"?

filecloudsync
filecloudsynccon

Certificates: Should these be installed into "/var/lib/filecloud"?

clientca.pem
clientcert.pem

bundled libraries. Should these be installed into "/usr/lib/filecloud"?

libappindicator.so.1
libcrypto.so
libcrypto.so.1.0.0
libindicator.so.7
libPocoCrypto.so
libPocoCrypto.so.31
libPocoFoundation.so
libPocoFoundation.so.31
libPocoJSON.so
libPocoJSON.so.31
libPocoNet.so
libPocoNet.so.31
libPocoNetSSL.so
libPocoNetSSL.so.31
libPocoUtil.so
libPocoUtil.so.31
libPocoXML.so
libPocoXML.so.31
libPocoZip.so
libPocoZip.so.31
libssl.so
libssl.so.1.0.0
libwx_baseu-2.9.so.5
libwx_gtk2u_adv-2.9.so.5
libwx_gtk2u_aui-2.9.so.5
libwx_gtk2u_core-2.9.so.5

Is it a concern that they are bundling these libraries this way? For example, the filecloud dev's bundle libcrypto.so.1.0.0 and libssl.so.1.0.0, while my system has the newer versions that are part of openssl (as I expect any Arch system will).

Translation info: Should this be installed into "/usr/share/filecloud"? Or "/var/lib/filecloud"?

translationsdc.zip

They also include a simple startup script, which I will mention in more detail below.

Dependencies:
In my testing, libpng12.so.0* does not need to be moved to $installdir. I was able to install the Arch package for libpng12 normally and proceed. However I have some questions about the proper use of /etc/ld.so.conf.d/ and ldconfig (below).

The installation steps consist of:
- make installation directory under $HOME (which should be changed to a standard system location IMO)
- downloading prequisites, which the PKGBUILD can take care of using depends array.
- extracting and installing dependencies, which we can do the Arch way (no installer code needed for this)
- copying filecloudsync program files (which the PKGBUILD will need to specify). They simply do `cp -vfR * -d $installdir`.
- changing permissions
- install .desktop file (they use echo to spit one out, which I don't think is a good approach, right?)
- they also do this step, which I actually did not do yet (and the client runs fine given the caveat below):

# Create link for shared libraries (included in .zip),
    echo -e "Adding '$installdir' to shared libraries directory, requires sudo..."
    echo -e "# Filecloud shared libraries\n$installdir" | sudo tee /etc/ld.so.conf.d/filecloud.conf &> /dev/null && sudo ldconfig

In /filecloudsyncstart.sh, they have this content.

#!/bin/sh -e

export LD_LIBRARY_PATH=.
./filecloudsync 2> /dev/null 1>&2

For my testing, I changed LD_LIBRARY_PATH to the absolute location of the filecloudsync binary. I assume I won't need to do that if I add a .conf file to /etc/ld.so.conf.d, right? I didn't do anything related to ldconfig yet because I don't know the preferred Arch way of doing it.

Here is their complete Ubuntu installer. I appreciate any suggestions for making the PKGBUILD.

#!/bin/bash

# Variables
libpng12="libpng12-0_1.2.54-1ubuntu1.1_amd64.deb"
thearg="$1"
valid="install|uninstall"
installdir=$HOME/apps/filecloudsync

if [ $# -eq 0 ]; then
    echo -e "Please provide an argument, use 'install' or 'uninstall'."
    exit 1
elif [[ ! ${thearg} =~ ${valid} ]]; then
    echo -e "$thearg: Invalid argument, use 'install' or 'uninstall'."
    exit 1
elif [ $thearg = "install" ]; then
    # Create $HOME/apps/filecloudsync for file storage.
    echo -e "Creating installation directory: $installdir"
    mkdir -p $HOME/apps/filecloudsync
    chmod +x $HOME/apps/filecloudsync

    # Create .tmp folder
    echo -e "Creating './tmp' folder for file storage."
    mkdir tmp && cd tmp

    # Download libpng12
    echo -e "Downloading prequisite (security.ubuntu.com>libpng12) to './tmp'."
    wget -q http://security.ubuntu.com/ubuntu/pool/main/libp/libpng/$libpng12

    # Install prerequisites: libpng12, libdbusmenu-gtk-dev
    echo -e "Extracting required libpng12 libraries to '$installdir'."
    ar x libpng12-0_1.2.54-1ubuntu1.1_amd64.deb
    tar -xf data.tar.xz --wildcards ./lib/x86_64-linux-gnu/libpng12.so.0* -C . --strip-components 3
    mv libpng12.so.0* $installdir

    echo -e "Installing libdbusmenu-gtk-dev, requires sudo..."
    sudo apt install libdbusmenu-gtk-dev
    echo -e "Prerequisite installation complete..."


    # Remove .tmp folder
    cd .. && rm -rf ./tmp

    #echo -e "Copying Filecloud sync client to '$installdir/'."
    cp -vfR * -d $installdir

    # Make filecloudsync and filecloudsyncstart.sh executable
    echo -e "Making files executable ($installdir/): filecloudsync, filecloudsyncstart.sh"
    chmod +x $installdir/filecloudsyncstart.sh && chmod +x $installdir/filecloudsync

    # Create $HOME/.local/share/applications/filecloudsync.desktop file (app menu launcher)
    echo -e "Creating desktop entry file (app menu) '$HOME/.local/share/applications/filecloudsync.desktop'."
    mkdir -p $HOME/.local/share/applications
    echo -e "[Desktop Entry]\nType=Application\nVersion=1.0\nName=FileCloud Sync\nGenericName=File Synchronization\nComment=FileCloud sync client\nCategories=Network;System;\nKeywords=sync;\nTerminal=false\nNoDisplay=false\nStartupNotify=false\nPath=$installdir/\nExec=$installdir/filecloudsyncstart.sh\nIcon=$installdir/filecloudsyncicon.png" | tee $HOME/.local/share/applications/filecloudsync.desktop &> /dev/null

    # Create link for shared libraries (included in .zip),
    echo -e "Adding '$installdir' to shared libraries directory, requires sudo..."
    echo -e "# Filecloud shared libraries\n$installdir" | sudo tee /etc/ld.so.conf.d/filecloud.conf &> /dev/null && sudo ldconfig

    echo -e "\nInstallation complete, launch 'FileCloud Sync' from app menu.\n"
elif [ $thearg = "uninstall" ]; then
    echo -e "Removing [d]irectories and [f]iles:\n[d] $installdir\n[d] $HOME/FileCloudSyncData\n[f] $HOME/syncclientconfig.xml\n[f] $HOME/.local/share/applications/filecloudsync.desktop\n[f] /etc/ld.so.conf.d/filecloud.conf"
    rm -rf $installdir $HOME/FileCloudSyncData $HOME/syncclientconfig.xml $HOME/.local/share/applications/filecloudsync.desktop

    echo -e "Removing '$installdir' from shared libraries directory, requires sudo..."
    sudo rm -f /etc/ld.so.conf.d/filecloud.conf && sudo ldconfig

    echo -e "\nFileCloud Sync Client has been uninstalled, synced files have *not* been deleted.\n"
fi

Last edited by MountainX (2020-11-11 22:51:22)

Offline

#2 2020-11-12 00:04:03

loqs
Member
Registered: 2014-03-06
Posts: 17,195

Re: PKGBUILD help request: filecloudsync

Ask the developers to provide a license.

You could also use symlinks in  /usr/bin to somewhere else for the binaries or shell scripts of the form:

#!/bin/sh
exec /full/path/to/executable "$@"

What locations do the binaries search for the certificates?  You may need to use strace if this is not documented.

The libraries are only going to be used by this package so I would suggest keeping LD_LIBRARY_PATH in the shell file and not use an ldconfig snippet.
This prevents issues such as the libcrypto provided by filecloudsync being used instead of the one provided by the openssl-1.0 package.

Offline

#3 2020-11-12 02:29:34

MountainX
Member
Registered: 2016-02-08
Posts: 371

Re: PKGBUILD help request: filecloudsync

loqs wrote:

Ask the developers to provide a license.

I did.

loqs wrote:

You could also use symlinks in  /usr/bin to somewhere else for the binaries or shell scripts of the form:

#!/bin/sh
exec /full/path/to/executable "$@"

Where else? Maybe /opt/filecloud?

loqs wrote:

What locations do the binaries search for the certificates?  You may need to use strace if this is not documented.

It is not documented, but currently those certs are in ".". Every file belonging to this package is in a single directory, at the location where one installs it. Maybe that's a good argument for installing it at /opt. Do you agree?

loqs wrote:

The libraries are only going to be used by this package so I would suggest keeping LD_LIBRARY_PATH in the shell file and not use an ldconfig snippet.
This prevents issues such as the libcrypto provided by filecloudsync being used instead of the one provided by the openssl-1.0 package.

OK, I will not use the ldconfig snippet. I don't use it now and the app works fine. But I did hardcode the path into that shell script. And that brings me back to wondering where to put these files. I tested it under /usr/local/bin/filecloud, but that's a non-standard location for an Arch package. I could split the files into /usr/share/filecloud, /usr/lib/filecloud, but since it starts off as a self-contained package, it sounds like maybe I should respect that and put everything into /opt/filecloud. Thoughts?

Last edited by MountainX (2020-11-12 02:34:11)

Offline

#4 2020-11-12 02:54:19

loqs
Member
Registered: 2014-03-06
Posts: 17,195

Re: PKGBUILD help request: filecloudsync

Putting everything in /opt/filecloud and symlink or shell scripts in /usr/bin seems reasonable to me.
Edit:
The desktop file should be installed in /usr/share/applications/

Last edited by loqs (2020-11-12 02:56:38)

Offline

#5 2020-11-12 03:09:29

MountainX
Member
Registered: 2016-02-08
Posts: 371

Re: PKGBUILD help request: filecloudsync

loqs wrote:

Putting everything in /opt/filecloud and symlink or shell scripts in /usr/bin seems reasonable to me.
Edit:
The desktop file should be installed in /usr/share/applications/

Thank you. But now that I have investigated the filecloud app in more detail, I see that the app has no concept of multiple users. What the filecloud devs are actually doing is installing the whole entire app into each user's home directory. Then the app runs as that user and all the sync'd files have that user as owner and they are stored under that user's home directory.

Are there any AUR packages that get installed into the user's home folder? Maybe I could look at one of those for an example.

EDIT: I will also test to see if more than one user can use the app if it is installed into /opt/filecloud.

Last edited by MountainX (2020-11-12 04:09:10)

Offline

#6 2020-11-12 04:19:22

loqs
Member
Registered: 2014-03-06
Posts: 17,195

Re: PKGBUILD help request: filecloudsync

No AUR packages should be installing files under /home see Arch_package_guidelines#Directories

Offline

#7 2020-11-12 04:41:28

MountainX
Member
Registered: 2016-02-08
Posts: 371

Re: PKGBUILD help request: filecloudsync

loqs wrote:

No AUR packages should be installing files under /home see Arch_package_guidelines#Directories

Yeah, that's what I thought. The app does seem to work when installed into /opt. I'll make a PKGBUILD using that approach and test it further.

Am I creating these symlinks in the correct way?

pkgname=filecloudsync
pkgver=20.2.0.4766
pkgrel=1
pkgdesc="FileCloud Sync for Linux: targeted for Ubuntu (12.04 and higher). Uses GTK2."
arch=('x86_64')
url="https://www.getfilecloud.com/additional-downloads"
license=('custom')
depends=('libdbusmenu-gtk2' 'libpng12') 
source=('http://patch.codelathe.com/tonido/live/installer/x86-linux/filecloudsync_linux_amd64.zip' 'FileCloud.desktop' 'LICENSE')
sha256sums=(.)

package() {
  cd "$srcdir/${pkgname}"
  install -D751 "$pkgdir/opt/filecloudsync"
  install -Dm640 -t "$pkgdir/opt/filecloudsync" src/*.pem
  install -Dm644 -t "$pkgdir/opt/filecloudsync" src/lib*
  install -Dm644 -t "$pkgdir/opt/filecloudsync" src/*.{png,zip}
  install -Dm755 -t "$pkgdir/opt/filecloudsync" src/filecloudsync
  install -Dm644 -t "$pkgdir/opt/filecloudsync" src/filecloudsynccon
  install -Dm755 -t "$pkgdir/opt/filecloudsync" src/filecloudsyncstart.sh
  install -Dm644 -t "$pkgdir/usr/share/applications/ src/FileCloud.desktop
  install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname"  src/LICENSE
  install -D "$pkgdir/usr/bin"
  ln -s "$pkgdir/opt/filecloudsync/filecloudsyncstart.sh" "$pkgdir/usr/bin/filecloudsyncstart.sh"
  ln -s "$pkgdir/opt/filecloudsync/filecloudsync" "$pkgdir/usr/bin/filecloudsync"
}

Offline

#8 2020-11-12 05:13:26

loqs
Member
Registered: 2014-03-06
Posts: 17,195

Re: PKGBUILD help request: filecloudsync

  ln -s "$pkgdir/opt/filecloudsync/filecloudsyncstart.sh" "$pkgdir/usr/bin/filecloudsyncstart.sh"
  ln -s "$pkgdir/opt/filecloudsync/filecloudsync" "$pkgdir/usr/bin/filecloudsync"

Drop $pkgdir from the symlinks target to avoid them pointing to locations such as /build/filecloudsync/pkg/filecloudsync/opt/filecloudsync/filecloudsync

  ln -s "/opt/filecloudsync/filecloudsyncstart.sh" "$pkgdir/usr/bin/filecloudsyncstart.sh"
  ln -s "/opt/filecloudsync/filecloudsync" "$pkgdir/usr/bin/filecloudsync"

Last edited by loqs (2020-11-12 05:13:57)

Offline

#9 2020-11-12 05:43:06

MountainX
Member
Registered: 2016-02-08
Posts: 371

Re: PKGBUILD help request: filecloudsync

loqs wrote:

Drop $pkgdir from the symlinks target to avoid them pointing to locations such as /build/filecloudsync/pkg/filecloudsync/opt/filecloudsync/filecloudsync

Thank you.

Offline

#10 2020-11-12 06:43:27

progandy
Member
Registered: 2012-05-17
Posts: 5,184

Re: PKGBUILD help request: filecloudsync

For the version, you could probably look at the output of "strings". Do not use a pkgver() function, but manually (or with a script) change the version number only when you have to update the sha256sums.

strings filecloudsync | grep "^v[0-9.]"

| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#11 2020-11-12 06:50:12

MountainX
Member
Registered: 2016-02-08
Posts: 371

Re: PKGBUILD help request: filecloudsync

Here's a working PKGBUILD. It looks like a few things still need fixing.

pkgname=filecloudsync
pkgver=20.2.0.4766
pkgrel=1
pkgdesc="FileCloud Sync for Linux: targeted for Ubuntu (12.04 and higher). Uses GTK2."
arch=('x86_64')
url="https://www.getfilecloud.com/additional-downloads"
license=('custom')
depends=('libdbusmenu-gtk2' 'libpng12') 
source=("http://patch.codelathe.com/tonido/live/installer/x86-linux/filecloudsync_linux_amd64.zip" 'FileCloud.desktop' 'LICENSE')
sha256sums=('b187efd4f7876062f8fa8efbd9178b6a27e0e879ae4072645d07f637bb7e2e4a'
            'd49842fa6ccc183a141b25a571500b7a6ccf3cefbc93c1778c452a230c94a77e'
            '88f410fd76e832d280285ce2e1955340df5b99ced7622e50cdcafffb837d1816')
install=${pkgname}.install

package() {
  cd "$srcdir/"
  install -dm751 "$pkgdir/opt/filecloudsync"
  install -Dm640 -t "$pkgdir/opt/filecloudsync" *.pem
  install -Dm644 -t "$pkgdir/opt/filecloudsync" lib*
  install -Dm644 -t "$pkgdir/opt/filecloudsync" *.{png,zip}
  install -Dm755 -t "$pkgdir/opt/filecloudsync" filecloudsync
  install -Dm644 -t "$pkgdir/opt/filecloudsync" filecloudsynccon
  install -Dm755 -t "$pkgdir/opt/filecloudsync" filecloudsyncstart.sh
  install -Dm644 -t "$pkgdir/usr/share/applications/" FileCloud.desktop
  install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
  install -d "$pkgdir/usr/bin"
  ln -s "/opt/filecloudsync/filecloudsyncstart.sh" "$pkgdir/usr/bin/filecloudsyncstart.sh"
  ln -s "/opt/filecloudsync/filecloudsync" "$pkgdir/usr/bin/filecloudsync"
}

namcap reports:

filecloudsync W: Dependency included and not needed ('libdbusmenu-gtk2')
filecloudsync W: Dependency included and not needed ('libpng12')

However, in my prior experience those were needed. Now that I'm testing the PKGBUILD file, libx11 is being installed and maybe this pulls those dependencies in?

Should I add these dependencies?

filecloudsync E: Dependency libx11 detected and not included (libraries ['usr/lib/libX11.so.6'] needed in files ['opt/filecloudsync/libwx_gtk2u_core-2.9.so.5'])
filecloudsync E: Dependency libsm detected and not included (libraries ['usr/lib/libSM.so.6'] needed in files ['opt/filecloudsync/libwx_gtk2u_core-2.9.so.5'])
filecloudsync E: Dependency glib2 detected and not included (libraries ['usr/lib/libgobject-2.0.so.0', 'usr/lib/libgmodule-2.0.so.0', 'usr/lib/libglib-2.0.so.0', 'usr/lib/libgio-2.0.so.0'] needed in files ['opt/filecloudsync/libwx_gtk2u_core-2.9.so.5', 'opt/filecloudsync/libindicator.so.7'])
filecloudsync E: Dependency libjpeg-turbo detected and not included (libraries ['usr/lib/libjpeg.so.8'] needed in files ['opt/filecloudsync/libwx_gtk2u_core-2.9.so.5'])

When building in a clean chroot, pacman is pulling in all these packages:

Packages (46) atk-2.36.0-1  avahi-0.8+15+ge8a3dd0-1  cairo-1.17.2+25+gaee96d175-1  dbus-1.12.20-1  desktop-file-utils-0.26-1  fontconfig-2:2.13.91+48+gfcb0420-2  freetype2-2.10.4-1
              fribidi-1.0.10-1  gdk-pixbuf2-2.42.0-2  graphite-1:1.3.14-1  gtk-update-icon-cache-1:3.24.23-4  gtk2-2.24.32-2  harfbuzz-2.7.2-1  hicolor-icon-theme-0.17-2  libcups-2.3.3-3
              libdaemon-0.14-5  libdatrie-0.2.12-2  libdbusmenu-glib-16.04.0-4  libjpeg-turbo-2.0.5-3  libpng-1.6.37-3  librsvg-2:2.50.1-1  libthai-0.1.28-2  libtiff-4.1.0-2  libusb-1.0.23-3
              libx11-1.6.12-1  libxau-1.0.9-3  libxcb-1.14-1  libxcomposite-0.4.5-3  libxcursor-1.2.0-2  libxdamage-1.1.5-3  libxdmcp-1.1.3-3  libxext-1.3.4-3  libxfixes-5.0.3-4
              libxft-2.3.3-2  libxi-1.7.10-3  libxinerama-1.1.4-3  libxrandr-1.5.2-3  libxrender-0.9.10-4  lzo-2.10-3  pango-1:1.48.0-1  pixman-0.40.0-1  shared-mime-info-2.0+1+g6bf9e4f-2
              xcb-proto-1.14.1-1  xorgproto-2020.1-1  libdbusmenu-gtk2-16.04.0-4  libpng12-1.2.59-2

Here's what I'm using for the LICENSE until upstream replies.

© CodeLathe 
Please request license from https://help.codelathe.com/support/index.php/

The .desktop file is:

[Desktop Entry]
Comment=FileCloud Sync Client
Exec=/opt/filecloudsync/filecloudsyncstart.sh
GenericName=File Synchronization
Icon=/opt/filecloud/filecloudsyncicon.png
Name=FileCloud Sync
NoDisplay=false
Path[]=/opt/filecloudsync
StartupNotify=true
Terminal=false
NoDisplay=false
TerminalOptions=
Type=Application
Categories=Network;System;
StartupWMClass=filecloud

I made an installer script, although all it does if offer some tips:

post_install() {
	echo "You may want to have the app autostart. In KDE, see System Settings > Startup and Shutdown. You can set a custom sync folder location for each user by editing syncclientconfig.xml in their home directory."
}

post_remove() {
	echo "Each user of FileCloud Sync will have these directories and files in their home folder: FileCloudSyncData/, syncclientconfig.xml"
	echo "Additionally, each user of FileCloud Sync will have their own copy of files at the location defined in their syncclientconfig.xml"
	echo "Recommended steps are to: grep -irA 2 'syncfolderlocation' /home/*/syncclientconfig.xml"
	echo "Then remove the synced files at those locations. Then remove the directories and files mentioned above."
	echo "See output that follows: "
	grep -irA 2 'syncfolderlocation' /home/*/syncclientconfig.xml
	cat /home/*/syncclientconfig.xml
	tree -a /home/*/FileCloudSyncData/
}

I reported the lack of the "read-only relocation" link flag to upstream. They are neglecting this linux client.

Offline

#12 2020-11-12 06:53:43

MountainX
Member
Registered: 2016-02-08
Posts: 371

Re: PKGBUILD help request: filecloudsync

progandy wrote:
strings filecloudsync | grep "^v[0-9.]"

Thank you. That's exactly what I needed.

$ strings filecloudsync | grep "^v[0-9.]"
v4E!
v20.2.0.4766

Offline

#13 2020-11-12 07:22:27

MountainX
Member
Registered: 2016-02-08
Posts: 371

Re: PKGBUILD help request: filecloudsync

The package() function needed to be changed a bit:

package() {
  cd "$srcdir/"
  install -dm751 "$pkgdir/opt/filecloudsync"
  install -Dm644 -t "$pkgdir/opt/filecloudsync" lib*
  install -Dm644 -t "$pkgdir/opt/filecloudsync" *.{png,pem}
  install -Dm644 -t "$pkgdir/opt/filecloudsync" translationsdc.zip
  install -Dm755 -t "$pkgdir/opt/filecloudsync" filecloudsync
  install -Dm644 -t "$pkgdir/opt/filecloudsync" filecloudsynccon
  install -Dm755 -t "$pkgdir/opt/filecloudsync" filecloudsyncstart.sh
  install -Dm644 -t "$pkgdir/usr/share/applications/" FileCloud.desktop
  install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
  install -d "$pkgdir/usr/bin"
  ln -s "/opt/filecloudsync/filecloudsyncstart.sh" "$pkgdir/usr/bin/filecloudsyncstart.sh"
  ln -s "/opt/filecloudsync/filecloudsync" "$pkgdir/usr/bin/filecloudsync"
}

Also, the installer needs to do this:

sed -i 's|\./filecloudsync 2> /dev/null 1>&2|/opt/filecloudsync/filecloudsync|' /opt/filecloudsync/filecloudsyncstart.sh
sed -i 's|export LD_LIBRARY_PATH=\.|export LD_LIBRARY_PATH=/opt/filecloudsync/|' /opt/filecloudsync/filecloudsyncstart.sh

Is that the right approach?

Last edited by MountainX (2020-11-12 07:40:38)

Offline

#14 2020-11-12 22:37:48

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: PKGBUILD help request: filecloudsync

MountainX wrote:

1. The company does not version the source tar files, nor do they list versions on the download page. I asked them to start providing some version info for releases, but of course I don't know if or when they actually will. I can get version info from the running app and I think I can get it by grepping on the binary. Knowing the current version, I found it at the end of the binary file:

You can and should still rename the file yourself.

source_x86_64=("filecloudsync_$pkgver_linux_amd64.zip::http://patch.codelathe.com/tonido/live/installer/x86-linux/filecloudsync_linux_amd64.zip")

Then the user doesn't see the old, incorrect file when you update the PKGBUILD checksums, and get an error that the source download failed to verify.

(Also, since this contains an amd64 binary, use architecture-specific source arrays. Even if you only support the x86_64 arch, it is still more technically correct to be specific here.)

MountainX wrote:
grep -a '20.2.0.4766$' filecloudsync_linux_amd64/filecloudsync

--Show Statussyncindicator50201BadSSLCertificateAccount not configured Sync Appv20.2.0.4766

From that, does it looks like I can search for the string "Sync Appv" near the end of the binary and reliably get the version number?  (I'd like to know the version independently from running the app.)

You only need this when you update the pkgver and checksums, but it seems like you've got a good way now anyway.

MountainX wrote:

2. They don't mention a license type anywhere that I found. (Not exactly related, but they allow unlimited free limited guest accounts for paying customers like me. This allows me to share files with colleagues without those people paying for any filecloud services.)

Do they have an EULA? Ultimately, I'm sure their license is "Proprietary" in the license=() variable, but you should still find the most suitable legalese on their website for "use of the software", and distribute it as a file.

MountainX wrote:

bundled libraries. Should these be installed into "/usr/lib/filecloud"?

libappindicator.so.1
libcrypto.so
libcrypto.so.1.0.0
libindicator.so.7
libPocoCrypto.so
libPocoCrypto.so.31
libPocoFoundation.so
libPocoFoundation.so.31
libPocoJSON.so
libPocoJSON.so.31
libPocoNet.so
libPocoNet.so.31
libPocoNetSSL.so
libPocoNetSSL.so.31
libPocoUtil.so
libPocoUtil.so.31
libPocoXML.so
libPocoXML.so.31
libPocoZip.so
libPocoZip.so.31
libssl.so
libssl.so.1.0.0
libwx_baseu-2.9.so.5
libwx_gtk2u_adv-2.9.so.5
libwx_gtk2u_aui-2.9.so.5
libwx_gtk2u_core-2.9.so.5

Is it a concern that they are bundling these libraries this way? For example, the filecloud dev's bundle libcrypto.so.1.0.0 and libssl.so.1.0.0, while my system has the newer versions that are part of openssl (as I expect any Arch system will).

Try to delete libssl and libcrypto, and add a depends=('openssl-1.0')
It should work.

MountainX wrote:

- they also do this step, which I actually did not do yet (and the client runs fine given the caveat below):

# Create link for shared libraries (included in .zip),
    echo -e "Adding '$installdir' to shared libraries directory, requires sudo..."
    echo -e "# Filecloud shared libraries\n$installdir" | sudo tee /etc/ld.so.conf.d/filecloud.conf &> /dev/null && sudo ldconfig

In /filecloudsyncstart.sh, they have this content.

#!/bin/sh -e

export LD_LIBRARY_PATH=.
./filecloudsync 2> /dev/null 1>&2

For my testing, I changed LD_LIBRARY_PATH to the absolute location of the filecloudsync binary. I assume I won't need to do that if I add a .conf file to /etc/ld.so.conf.d, right? I didn't do anything related to ldconfig yet because I don't know the preferred Arch way of doing it.

This is totally weird, both do the same thing but one for every program on the system and one for only this program.

I'd stick with juts the script using LD_LIBRARY_PATH, not ld.so.conf.d trickery.

However really they should learn to build software properly, and use gcc '-Wl,-rpath,$ORIGIN/' to add this info directly to the binary. Then they would not need the wrapper script as the binary would already know to look in the same directory it was run from, in order to find additional support libraries.

...

Actually, it is more common to use '-Wl,-rpath,$ORIGIN/lib/' and store libraries in a dedicated lib/ directory. So:

./myprogram
./lib/
./lib/libmyprogramsupport.so
MountainX wrote:

Thank you. But now that I have investigated the filecloud app in more detail, I see that the app has no concept of multiple users. What the filecloud devs are actually doing is installing the whole entire app into each user's home directory. Then the app runs as that user and all the sync'd files have that user as owner and they are stored under that user's home directory.

Are there any AUR packages that get installed into the user's home folder? Maybe I could look at one of those for an example.

EDIT: I will also test to see if more than one user can use the app if it is installed into /opt/filecloud.

I'm not really sure what you mean by this. Most programs don't have the concept of multiple users. They only run as the current user.

However, they don't store the user info next to the program. Instead they store user data in some kind of dotfile, e.g. $HOME/.config/program_name/

Some few (mercifully rare) programs, often Java programs, only read and write user data in the same directory as the program binaries. In this case if you install the program to /opt/ then the program will try to write to /opt and fail if the user doesn't have the ability to edit files there.

Is filecloud doing like the Java programs do?


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#15 2020-11-21 19:32:33

MountainX
Member
Registered: 2016-02-08
Posts: 371

Re: PKGBUILD help request: filecloudsync

Current status. This software seems to be governed by their TOS. It contains this text:

Distribution: You are not allowed to distribute the FileCloud software without the express written consent of an authorized officer of CodeLathe. If you want to make use of the possibility to distribute FileCloud software, send an email containing Your name, address, phone number and email address to support@codelathe.com, stating Your intentions to distribute the FileCloud Software and defining the applicable media.

Ten days ago I wrote to support and asked if I could put the software on the AUR (and gave them the URL to AUR). They asked me:

1. Once you list the sync, will you able to keep the list updated when a new release happens?
2. Is it possible for us to remove the list when the listing becomes too outdated?
3. Your plans to maintain the FileCloud Sync listing.

I said:

1. Once you list the sync, will you able to keep the list updated when a new release happens?
A. Yes, as long as we remain a FileCloud customer, I can keep the AUR listing updated and working. I have already created the PKGBUILD and installer, and I have tested it.

2. Is it possible for us to remove the list when the listing becomes too outdated?
A. Your team is welcome to managing the listing instead of me. Now that I have created the PKGBUILD, you won't have to do hardly anything to keep it up to date. Updating the PKBGUILD for a new release is super simple. I can explain how if your team wants to be able to keep the listing up to date.

3. Your plans to maintain the FileCloud Sync listing.
A. As long as we remain a FileCloud customer I plan to maintain the listing, updating it for each new release. However, even if I am doing that, your team be be a co-maintainer. That way, you will retain control.

After this, they said they would review the request and get back to me. I'm still waiting. However, our team seems ready to decide that we don't want to keep using FileCloud ... so I probably will not go any further with this.

Offline

#16 2020-12-15 00:37:13

MountainX
Member
Registered: 2016-02-08
Posts: 371

Re: PKGBUILD help request: filecloudsync

The company replied to me, so I am going to try to push this across the finish line. They said:

Thank you for your interest and support in leveraging the reach of FileCloud Sync Application to the Arch Linux Community.

We can go ahead with submission to AUR. Please add us as maintainer and contributor, and also send the PKGBUILD file for us to verify.

I am going to send them the PKGBUILD we created in this thread. I'll post my final version below. I will also send them a message telling them the next steps:

1. create an account at https://aur.archlinux.org/
2. add your public ssh key(s) to AUR as described here: https://wiki.archlinux.org/index.php/AU … entication
3. submit the package:
AUR submission guidelines - ArchWiki
https://wiki.archlinux.org/index.php/AU … guidelines

The attached PKGBUILD meets the submission guidelines.

PKGBUILD:

# Maintainer: CodeLathe <itservices@codelathe.com>
# Contributor: CodeLathe <itservices@codelathe.com>

pkgname=filecloudsync
pkgver=20.2.0.4766
pkgrel=1
pkgdesc="FileCloud Sync for Linux: targeted for Ubuntu (12.04 and higher). Uses GTK2."
arch=('x86_64')
url="https://www.getfilecloud.com/additional-downloads"
license=('proprietary')
depends=('libdbusmenu-gtk2' 'libpng12' 'openssl-1.0' 'wxgtk2') # 'openssl' 'wxgtk2') just use what upstream bundle

source_x86_64=("filecloudsync_${pkgver}_linux_amd64.zip::http://patch.codelathe.com/tonido/live/installer/x86-linux/filecloudsync_linux_amd64.zip" 'FileCloud.desktop' 'LICENSE')

sha256sums_x86_64=('b187efd4f7876062f8fa8efbd9178b6a27e0e879ae4072645d07f637bb7e2e4a'
                   '61c24c278efe01caa4722ae250d8d06aa5a522d7127e7593275905e17bf5f5dc'
                   'a397573d54734349929b3572875577073c3aeab6d9e4d6dbae4400a6954a61ed')
install=${pkgname}.install

package() {
  cd "$srcdir/"
  install -dm751 "$pkgdir/opt/filecloudsync"
  install -Dm644 -t "$pkgdir/opt/filecloudsync" lib*
  install -Dm644 -t "$pkgdir/opt/filecloudsync" *.{png,pem}
  install -Dm644 -t "$pkgdir/opt/filecloudsync" translationsdc.zip
  install -Dm755 -t "$pkgdir/opt/filecloudsync" filecloudsync
  install -Dm644 -t "$pkgdir/opt/filecloudsync" filecloudsynccon
  install -Dm755 -t "$pkgdir/opt/filecloudsync" filecloudsyncstart.sh
  install -Dm644 -t "$pkgdir/usr/share/applications/" FileCloud.desktop
  install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
  install -d "$pkgdir/usr/bin"
  ln -s "/opt/filecloudsync/filecloudsyncstart.sh" "$pkgdir/usr/bin/filecloudsyncstart.sh"
  ln -s "/opt/filecloudsync/filecloudsync" "$pkgdir/usr/bin/filecloudsync"
}

proposed installer script (probably needs to be less wordy?)

# arg 1:  the new package version
post_install() {

  sed -i 's|\./filecloudsync 2> /dev/null 1>&2|/opt/filecloudsync/filecloudsync|' /opt/filecloudsync/filecloudsyncstart.sh
  sed -i 's|export LD_LIBRARY_PATH=\.|export LD_LIBRARY_PATH=/opt/filecloudsync/|' /opt/filecloudsync/filecloudsyncstart.sh

	echo "Each user will need to log into the app. Furthermore, you may want to have the app autostart.	In KDE, see System Settings > Startup and Shutdown. You can set a custom sync folder location for each user by editing syncclientconfig.xml in their home directory."
}

# arg 1:  the new package version
# arg 2:  the old package version
post_upgrade() {
  sed -i 's|\./filecloudsync 2> /dev/null 1>&2|/opt/filecloudsync/filecloudsync|' /opt/filecloudsync/filecloudsyncstart.sh
  sed -i 's|export LD_LIBRARY_PATH=\.|export LD_LIBRARY_PATH=/opt/filecloudsync/|' /opt/filecloudsync/filecloudsyncstart.sh
}

# arg 1:  the old package version
post_remove() {

	echo "Each user of FileCloud Sync will have these directories and files in their home folder: FileCloudSyncData/, syncclientconfig.xml"
	echo "Additionally, each user of FileCloud Sync will have their own copy of files at the location defined in their syncclientconfig.xml"
	echo "Recommended steps are to: grep -irA 2 'syncfolderlocation' /home/*/syncclientconfig.xml"
	echo "Then remove the synced files at those locations. Then remove the directories and files mentioned above."
	echo "See output that follows: "

  grep -irA 2 'syncfolderlocation' /home/*/syncclientconfig.xml

	cat /home/*/syncclientconfig.xml
  tree -a /home/*/FileCloudSyncData/
}

Offline

#17 2020-12-15 00:44:32

MountainX
Member
Registered: 2016-02-08
Posts: 371

Re: PKGBUILD help request: filecloudsync

In addition to any feedback on the final (hopefully) PKGBUILD in my last message, I also have a question about the steps I use to build this package. The way I am doing it, the source zip file gets downloaded twice, which wastes bandwidth.

I download it first to get the version info. I know of no other way to get the version info because they don't publish it on the download page. (I could email them, but they are often slow to respond so this is not practical.) Then I put that version info into the PKGBUILD and run updpkgsums, which downloads the same file again. Is there a way to eliminate the duplicate downloading?

These are my steps:

1. wget http://patch.codelathe.com/tonido/live/installer/x86-linux/filecloudsync_linux_amd64.zip

2. extract the file "filecloudsync" from the archive.

3. execute this command on the above file: 
strings filecloudsync | grep "^v[0-9.]"

4. put that version number into PKGBUILD without the "v" like this:

pkgver=20.2.0.4766
pkgrel=1

5. rm filecloudsync

6. run updpkgsums

7. makepkg --printsrcinfo > .SRCINFO

8. makepkg -s

Offline

#18 2020-12-15 02:44:07

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: PKGBUILD help request: filecloudsync

Do not edit the installed files after the fact in post_install() or post_upgrade(), do so at the end of package() in the PKGBUILD.

Once you know the version, simply

mv filecloudsync_linux_amd64.zip filecloudsync_${pkgver}_linux_amd64.zip

makepkg will then pick it up in the same directory as the PKGBUILD.
(Even if you use $SRCDEST to store files centrally, it will always find a copy in the same directory first.)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#19 2020-12-15 05:09:10

MountainX
Member
Registered: 2016-02-08
Posts: 371

Re: PKGBUILD help request: filecloudsync

Thank you @eschwartz. Comment deleted while I do more testing.

Last edited by MountainX (2020-12-15 20:10:11)

Offline

#20 2020-12-16 18:01:10

MountainX
Member
Registered: 2016-02-08
Posts: 371

Re: PKGBUILD help request: filecloudsync

updated PKGBUILD:

# Maintainer: CodeLathe <itservices@codelathe.com>
# Contributor: CodeLathe <itservices@codelathe.com>

pkgname=filecloudsync
pkgver=20.2.0.4766
pkgrel=3
pkgdesc="FileCloud Sync for Linux: targeted for Ubuntu (12.04 and higher). Uses GTK2."
arch=('x86_64')
url="https://www.getfilecloud.com/additional-downloads"
license=('proprietary')
depends=('libdbusmenu-gtk2' 'libpng12' 'openssl-1.0' 'wxgtk2')

#https://bugs.archlinux.org/task/65042
source_x86_64=("filecloudsync_${pkgver}_linux_amd64.zip::http://patch.codelathe.com/tonido/live/installer/x86-linux/filecloudsync_linux_amd64.zip" 'FileCloud.desktop' 'LICENSE')

sha256sums_x86_64=('b187efd4f7876062f8fa8efbd9178b6a27e0e879ae4072645d07f637bb7e2e4a'
                   '61c24c278efe01caa4722ae250d8d06aa5a522d7127e7593275905e17bf5f5dc'
                   'a397573d54734349929b3572875577073c3aeab6d9e4d6dbae4400a6954a61ed')
install=${pkgname}.install

package() {
  cd "$srcdir/"
  install -dm751 "$pkgdir/opt/filecloudsync"
  install -Dm644 -t "$pkgdir/opt/filecloudsync" lib*
  install -Dm644 -t "$pkgdir/opt/filecloudsync" *.{png,pem}
  install -Dm644 -t "$pkgdir/opt/filecloudsync" translationsdc.zip
  install -Dm755 -t "$pkgdir/opt/filecloudsync" filecloudsync
  install -Dm644 -t "$pkgdir/opt/filecloudsync" filecloudsynccon
  install -Dm755 -t "$pkgdir/opt/filecloudsync" filecloudsyncstart.sh
  install -Dm644 -t "$pkgdir/usr/share/applications/" FileCloud.desktop
  install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
  install -d "$pkgdir/usr/bin"
  sed -i 's|\./filecloudsync 2> /dev/null 1>&2|/opt/filecloudsync/filecloudsync|' "$pkgdir/opt/filecloudsync/filecloudsyncstart.sh"
  sed -i 's|export LD_LIBRARY_PATH=\.|export LD_LIBRARY_PATH=/opt/filecloudsync/|' "$pkgdir/opt/filecloudsync/filecloudsyncstart.sh"
  ln -s "/opt/filecloudsync/filecloudsyncstart.sh" "$pkgdir/usr/bin/filecloudsyncstart.sh"
  ln -s "/opt/filecloudsync/filecloudsync" "$pkgdir/usr/bin/filecloudsync"
}

install script:

# arg 1:  the old package version
post_remove() {

	echo "Each user of FileCloud Sync will have these directories and files in their home folder: FileCloudSyncData/, syncclientconfig.xml"
	echo "Additionally, each user of FileCloud Sync will have their own copy of files at the location defined in their syncclientconfig.xml"
	echo "Recommended steps are to: grep -irA 2 'syncfolderlocation' /home/*/syncclientconfig.xml"
	echo "Then remove the synced files at those locations. Then remove the directories and files mentioned above."
	echo "See output that follows: "

  grep -irA 2 'syncfolderlocation' /home/*/syncclientconfig.xml

	cat /home/*/syncclientconfig.xml
  tree -a /home/*/FileCloudSyncData/
}

Offline

Board footer

Powered by FluxBB