hackerschoice / gsocket

Connect like there is no firewall. Securely.
https://www.gsocket.io
BSD 2-Clause "Simplified" License
1.53k stars 129 forks source link

DSO files are distributed wrongly in bin dir used for executables #32

Closed anthraxx closed 3 years ago

anthraxx commented 3 years ago

gs_so and gs_uchroot_so are not executables but in fact DSO libs. They should be distributed in the matching FHS directories like /usr/lib instead of putting them in the bin directory.

This would be welcoming for distro folks :cat:

Edit: I believe it would also make sense to move pure helper scripts as gs_funcs to the same place. Either the location can be probed or some of the scripts should be converted to .in files that autotools substitutes with configured libdir etc.

rootTHC commented 3 years ago

Can't use .in files for the shell script as this is a nightmare for development & testing (requires a ./configure before testing/development). So not happening that way.

Could probe in PREFIX/../lib etc but that gets tricky if the user specifies another libdir during ./configure. Risk of mismatching versions is huge. Easiest is to have everything in PREFIX/bin. Does packaging require this to be different (go with it until they complain and then see how this problem can be solved without hassle?)

anthraxx commented 3 years ago

Yes, distro packaging requires to only dist executables in the bin directories, such libs must be put somewhere else like /usr/ib. I've seen code in the shell scripts that already probe for certain directories, can't that be used in a similar way? the probe can check for all valid FHS compliant directories, those include /usr/local etc? If you think you don't want to solve this, I will need to provide downstream patches but I don't think that's a good approach and we try to cooperate as a distro policy with upstream instead of going nuts with downstream patches.

Maybe a middle way would be a configure switch like --fhs or similar just changes the way where which part of the toolchain is distributed. The probe function can then just prefere to search in the same directory as the binary to preserve the status quo and if its not found it continues to probe the FHS directories. This would imo solve all cases without the need to have .in shell scripts.

xaitax commented 3 years ago

I will change it for the next deb files old man.

SkyperTHC commented 3 years ago

Yes, distro packaging requires to only dist executables in the bin directories, such libs must be put somewhere else like /usr/ib.

Where would include files for the bash scripts go? PREFIX/share/gsocket or PREFIX/lib?

Ok. I will put it in the next release. Are you packaging for ArchLinux?

anthraxx commented 3 years ago

Yes, distro packaging requires to only dist executables in the bin directories, such libs must be put somewhere else like /usr/ib.

Where would include files for the bash scripts go? PREFIX/share/gsocket or PREFIX/lib?

I guess PREFIX/share/gsocket would work well :)

Ok. I will put it in the next release. Are you packaging for ArchLinux?

Yes, was about to add gsocket to the repositories hence my earlier contributions as well. This is the last piece i would love to get solved before pushing :cat:

Happy to test and review any changes :)

rootTHC commented 3 years ago

I've pushed this change to 'unstable' branch.

  1. dynamically loaded objects are now called *.so and installed to ${PREFIX}/lib/. (and on cygwin .so.exe).
  2. gs_funcs is now in ${PREFIX}/share/gsocket. A config is installed to ${PREFIX}/etc/gsocket.conf. It's FHS compliant and --sysconfdir=/etc should be used to install /etc/gsocket.conf instead (it's not allowed to default to /etc/gsocket.conf even if this is what most people likely want...)

p.s. thanks for the packaging effort. Like to find out how you did it and what the process is.

skyper

rootTHC commented 3 years ago

Also changed gs.so to gsocket_dso.so and gs_uchroot.so to gsocket_uchroot_dso.so.

Installed files:

./usr/bin/gs-sftp
./usr/bin/gs-mount
./usr/bin/blitz
./usr/bin/gsocket
./usr/bin/gs-netcat

./usr/etc/gsocket.conf

./usr/lib/gsocket_dso.so
./usr/lib/gsocket_uchroot_dso.so

./usr/share/man/man1/gs-netcat.1
./usr/share/man/man1/gs-sftp.1
./usr/share/man/man1/blitz.1
./usr/share/man/man1/gsocket.1
./usr/share/man/man1/gs-mount.1

./usr/share/gsocket/gs_funcs
rootTHC commented 3 years ago

make distcheck completes without errors now as well. Pushed to unstable. Will merge to master in a few days.

====================================================
gsocket-1.4.28-dev archives ready for distribution:
gsocket-1.4.28-dev.tar.gz
====================================================
rootTHC commented 3 years ago

This has now been release in 1.4.28 (and master branch).

UnlimitedCookies commented 3 years ago

Ok. I will put it in the next release. Are you packaging for ArchLinux?

Yes, was about to add gsocket to the repositories hence my earlier contributions as well. This is the last piece i would love to get solved before pushing cat

@anthraxx Not trying to annoy, but what is the current status of an official arch package? I would be very interested in that. Currently, I am still using the gsocket-git package from the AUR.

SkyperTHC commented 3 years ago

gsocket is included in debian now: https://tracker.debian.org/pkg/gsocket

Would be awesome to have it in ARCH linux as well. @anthraxx can you help please?

anthraxx commented 3 years ago

@SkyperTHC urgh, I actually forgot to put it into the repo and just used my local one :joy_cat: I will handle this most likely today evening.

UnlimitedCookies commented 3 years ago

@anthraxx 🕵️ Gentle ping.

UnlimitedCookies commented 3 years ago

@SkyperTHC Since your pings seem to have more impact than mine, perhaps you could nicely ask anthraxx again, whether he could be so prudent to add the gsocket package to the official arch repos. [Because I still cannot find it]

anthraxx commented 3 years ago

@UnlimitedCookies https://archlinux.org/packages/community/x86_64/gsocket/

UnlimitedCookies commented 3 years ago

@UnlimitedCookies https://archlinux.org/packages/community/x86_64/gsocket/

Much appreciated -Thanks!