Using update-alternatives in baselibs.conf post scriptlets
Hi, Could someone kindly explain how one gets update-alternatives to work correctly with baselibs.conf generated packages? The only documentation I have seen [1] is rather sparse and does not go into this specific issue involving running update-alternatives as post(in/un) in baselibs.conf itself. I am trying to take care of the apparently incorrect packaging of *-32bit biarch libraries for lapack, which currently have 0-byte files instead of the intended update-alternatives symlinks. More details in this bug report [2]. My ongoing efforts to resolve this may be seen in my branch project [3]. I have tried to run update-alternatives in the baselibs.conf file itself or even simply running `ln -sf` to create a symlink target to the actual location of the library. None of these work, always ending up with a 0-byte file in place of the intended symlink. This looks to be the case also for some other packages, say, ocl-icd [4] which also uses update-alternatives in its post-scripts and whose -32bit packages also end up with 0-byte files. Consider the difference: sh-5.2$ rpm -qvlp libOpenCL1-32bit-2.3.1-51.14.x86_64.rpm -rw-r--r-- 1 root root 0 Feb 20 03:54 /usr/lib/libOpenCL.so.1 drwxr-xr-x 2 root root 0 Feb 20 03:54 /usr/lib/ocl-icd lrwxrwxrwx 1 root root 18 Feb 20 03:54 /usr/lib/ocl-icd/libOpenCL.so.1 -> libOpenCL.so.1.0.0 -rwxr-xr-x 1 root root 215264 Feb 20 03:54 /usr/lib/ocl-icd/libOpenCL.so.1.0.0 sh-5.2$ rpm -qvlp libOpenCL1-2.3.1-51.14.x86_64.rpm lrwxrwxrwx 1 root root 38 Feb 20 03:57 /etc/alternatives/libOpenCL.so.1 -> ../../usr/lib64/ocl-icd/libOpenCL.so.1 lrwxrwxrwx 1 root root 32 Feb 20 03:57 /usr/lib64/libOpenCL.so.1 -> /etc/alternatives/libOpenCL.so.1 drwxr-xr-x 2 root root 0 Feb 20 03:57 /usr/lib64/ocl-icd lrwxrwxrwx 1 root root 18 Feb 20 03:57 /usr/lib64/ocl-icd/libOpenCL.so.1 -> libOpenCL.so.1.0.0 -rwxr-xr-x 1 root root 192144 Feb 20 03:57 /usr/lib64/ocl-icd/libOpenCL.so.1.0.0 drwxr-xr-x 2 root root 0 Feb 20 03:57 /usr/share/doc/packages/libOpenCL1 -rw-r--r-- 1 root root 1387 Aug 17 2021 /usr/share/doc/packages/libOpenCL1/README Any pointers on how to get the symlinks right for biarch packages would be greatly appreciated. [1] <https://en.opensuse.org/openSUSE:Build_Service_baselibs.conf> [2] <https://bugzilla.opensuse.org/show_bug.cgi?id=1207563> [3] <https://build.opensuse.org/package/show/home:badshah400:lapack2023/lapack> [4] <https://build.opensuse.org/package/show/openSUSE:Factory/ocl-icd> Thanks in advance, -- Atri
Atri Bhattacharya wrote:
I am trying to take care of the apparently incorrect packaging of *-32bit biarch libraries for lapack, which currently have 0-byte files instead of the intended update-alternatives symlinks.
Think I figured it out: it requires one to also create the /etc/alternatives symlink manually as part of post as well! Here is what I ended up with, that seems to work to the extent of my limited testing [1]: ``` libblas3 requires "update-alternatives" postin "ln -sf /etc/alternatives/libblas.so.3_<extension>bit /usr/%_lib/libblas.so.3" postin "/usr/sbin/update-alternatives --force --install /usr/%_lib/libblas.so.3 libblas.so.3_<extension>bit /usr/%_lib/blas/libblas.so.3 50" postun "/usr/sbin/update-alternatives --remove libblas.so.3_<extension>bit /usr/%_lib/blas/libblas.so.3" ``` Still, if anyone can certify this is the correct way, I would be very grateful to you. [1] <https://build.opensuse.org/projects/home:badshah400:lapack2023/packages/lapack/files/baselibs.conf?expand=1&rev=21> Best wishes, -- Atri
participants (1)
-
Atri Bhattacharya