[arch-general] Question about packaging a library (AUR)
Hello, I am the maintainer of the 'transcribe' AUR package. Recently, I have received a request (cc) about also packaging and providing a proprietary library that comes along with 'transcribe'. I quote: * videosection, a special plugin provided by us as part of the download, can be found in the file libgstvideosection.so and it needs to be alongside the transcribe executable.* I tried to provide the videosection library in /usr/lib, but that doesn't work. I don't feel comfortable providing the library in /usr/bin. Do you know an appropriate way to deal with such cases? Is it preferable to install the executable in a separate folder alongside the library? For example, /opt/transcribe? Thanks in advance, Dominik
On Tue, Jul 21, 2020 at 8:25 AM Dominik Schrempf via arch-general <arch-general@archlinux.org> wrote:
I tried to provide the videosection library in /usr/lib, but that doesn't work. I don't feel comfortable providing the library in /usr/bin. Do you know an appropriate way to deal with such cases? Is it preferable to install the executable in a separate folder alongside the library? For example, /opt/transcribe?
Hello, Although I don't know much about this package and it's libraries, I believe an ideal way to put the libraries together is to have transcribe in a seperate folder with all of the libraries, while there are symlinks in /usr/bin and /usr/lib to the libraries.I hope this helps -Aneesh
On 7/21/20 12:16 PM, Aneesh Raghavan via arch-general wrote:
On Tue, Jul 21, 2020 at 8:25 AM Dominik Schrempf via arch-general <arch-general@archlinux.org> wrote:
I tried to provide the videosection library in /usr/lib, but that doesn't work. I don't feel comfortable providing the library in /usr/bin. Do you know an appropriate way to deal with such cases? Is it preferable to install the executable in a separate folder alongside the library? For example, /opt/transcribe?
Hello, Although I don't know much about this package and it's libraries, I believe an ideal way to put the libraries together is to have transcribe in a seperate folder with all of the libraries, while there are symlinks in /usr/bin and /usr/lib to the libraries.I hope this helps
That might *work*, but I would not describe it as *ideal*. Dominik, If this library is indeed a plugin specific to the "transcribe" program, it's traditional for programs to have a special plugins directory e.g. /usr/lib/transcribe/ and attempt to load *.so plugins from there. If it's generally usable by other programs, then it would be appropriate to have it in the general-purpose /usr/lib directory. If it's generally usable by gstreamer, then it would be appropriate to put it in the directory /usr/lib/gstreamer-1.0, as specified by: $ pkg-config gstreamer-1.0 --variable=pluginsdir It's not an option to provide the library in /usr/bin, but a usable workaround would be to symlink the binary in /usr/bin but install it in /opt/transcribe/. Check to see if it correctly picks up the right location, though. ;) You might need to create a wrapper script instead, which invokes it without a symlink. You may wish to clarify with upstream if it can use the more customary location. -- Eli Schwartz Bug Wrangler and Trusted User
On 7/21/20 12:46 PM, Eli Schwartz via arch-general wrote:
Dominik,
$ pkg-config gstreamer-1.0 --variable=pluginsdir
It's not an option to provide the library in /usr/bin, but a usable workaround would be to symlink the binary in /usr/bin but install it in /opt/transcribe/. Check to see if it correctly picks up the right location, though. ;) You might need to create a wrapper script instead, which invokes it without a symlink.
You may wish to clarify with upstream if it can use the more customary location.
This is how I would (and do, for one or two packages I maintain) do it. Note that this was essentially the primary purpose of /opt[0][1]. A symlink may or may not work. If it does not, a wrapper that calls the binary and pass along arguments specified at invocation would work fine. e.g. something like: #!/bin/bash # 3/4 times if this works, a symlink in /usr/bin/ works. /opt/transcribe/transcribe "$@" # OR, if it relies heavily on relative paths, it's safer to do: #cd /opt/transcribe #./transcribe "$@" [0] https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html [1] https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s13.html -- brent saner https://square-r00t.net/ GPG info: https://square-r00t.net/gpg-info
On Tue, Jul 21, 2020 at 05:25:26PM +0200, Dominik Schrempf via arch-general wrote:
Do you know an appropriate way to deal with such cases? Is it preferable to install the executable in a separate folder alongside the library? For example, /opt/transcribe?
It seems your AUR package is distributing an executable blob anyway, so packing the application into /opt/transcribe looks like the cleanest solution to me. Into /usr/bin, install a solid wrapper that calls the application instead, or if it works, a symlink. If you look at the slackbuild from here https://git.slackbuilds.org/slackbuilds/plain/audio/transcribe/transcribe.Sl... you'll see that maybe installing the .so file into the canonical directory for gstreamer plugins might be the correct way to "deconstruct" the distribution: if [ -e libgstvideosection.so ]; then mkdir -p $PKG/usr/lib$LIBDIRSUFFIX/gstreamer-1.0 install -m0755 libgstvideosection.so $PKG/usr/lib$LIBDIRSUFFIX/gstreamer-1.0 fi Perhaps you can get this to work analog to Slack on Arch. You already have a dep gst-plugins-base-libs that provides /usr/lib/gstreamer-1.0.
participants (5)
-
Aneesh Raghavan
-
brent s.
-
Dominik Schrempf
-
Eli Schwartz
-
lists@2ion.de