You are not logged in.

#1 2018-02-04 10:49:11

eichan
Member
Registered: 2018-01-08
Posts: 31

[SOLVED] Need help creating a package - conflict with '/lib'

Hi all,

I'm struggling a bit to create a package for libindi_3rdarty and could do with a bit of advice. The problem happens when trying to install the created package with 'pacman -U': "libindi_3rdparty: /lib exists in filesystem" (see below). I may add to this message some details that are absolutely irrelevant. Sorry in advance.

First off, the raw package does not compile because there's a missing file (log4z.h) in the indi-qhy folder. I could find that same file online, add it in the right folder and recompress the whole thing. This is the reason why my PKGBUILD points to a local source.

Secondly, I had to create the package using 'makepkg --skipinteg', because running simply 'makepkg' gives me this:

tan@bobby ~/bin/pkg/libindi_3rdparty$ makepkg
==> Making package: libindi_3rdparty 1.6.2-1 (Sun Feb  4 23:19:38 NZDT 2018)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found libindi_3rdparty-1.6.2.tar.gz
==> ERROR: Integrity checks are missing for: source

Thirdly, there is an outdated version of that same package on AUR, but I need to use the latest version (which has the correct driver for my CCD camera).

Now, here is my PKGBUILD:

# Maintainer: Adrien Vilquin-Barrajon <avilqu@gmail.com>
# Author: Jasem Mutlaq <indilib.org>

pkgname=libindi_3rdparty
pkgver=1.6.2
pkgrel=1
pkgdesc="3rd party drivers for INDI, a distributed control protocol designed to operate 
astronomical instrumentation"
url="http://www.indilib.org/index.php?title=Main_Page"
license=(LGPL2.1)
arch=(i686 x86_64)
depends=(libvorbis libusb openal libnova libjpeg libindi libgphoto2 libftdi-compat cfitsio 
dcraw libqhy-git)
makedepends=(cmake boost)
source=("$pkgname-$pkgver.tar.gz")

build() {
	cd "$pkgname-$pkgver"
	cmake -DCMAKE_INSTALL_PREFIX=/usr .
	make
}

package() {
	cd "$pkgname-$pkgver"
	make DESTDIR="$pkgdir/" install
}

After running 'makepkg --skipinteg', I get a package, but that package isn't installable:

tan@bobby ~/bin/pkg/libindi_3rdparty$ sudo pacman -U libindi_3rdparty-1.6.2-1-x86_64.pkg.tar.xz 
[sudo] password for tan: 
loading packages...
resolving dependencies...
looking for conflicting packages...

Packages (1) libindi_3rdparty-1.6.2-1

Total Installed Size:  5.13 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                                 [##################################] 100%
(1/1) checking package integrity                               [##################################] 100%
(1/1) loading package files                                    [##################################] 100%
(1/1) checking for file conflicts                              [##################################] 100%
error: failed to commit transaction (conflicting files)
libindi_3rdparty: /lib exists in filesystem
Errors occurred, no packages were upgraded.

Note that if I don't create a package and install directly from source (with the added log4z.h), the whole thing works fine. I just want to "cleanly" install it and leard a few things about packages on the way.

I found this thread that seems to be an answer to my problem, but I'm far from being a developer, and this is my very first experience creating a package, so I'm a bit lost. Not sure what a bind mount is, and how to apply that solution to my current problem. I understand the issue I'm having is that my package tries to install stuff in /lib/* but in Arch, /lib is a symlink. Therefore, I should get those files to be downloaded in /usr/lib instead. But how can I do this? Is it as simple as editing a file in the source? Or editing the 'make DESTDIR="$pkgdir/" install' line of my PKGBUILD (note that I tried 'make DESTDIR="$pkgdir/usr/" install', which allowed 'pacman -U' to run without errors, but didn't install the package properly as the softwares relying on it couldn't find it).

You'll probably get from the outputs and language that I'm quite new to Arch. So there's very likely something quite simple that I'm missing here!

Thanks a lot.

EDIT: Found that commit on the libindi GitHub. Could this be the fix to my problem?

Last edited by eichan (2018-02-04 11:15:09)

Offline

#2 2018-02-04 10:53:50

ayekat
Member
Registered: 2011-01-17
Posts: 1,632

Re: [SOLVED] Need help creating a package - conflict with '/lib'

Please post the list of files of the package after you build it:

find pkg

I suspect the issue lies with DESTDIR (as in, it might expect something like /usr), but I'd like to have a look at the list of files first to be sure.


pkgshackscfgblag

Offline

#3 2018-02-04 10:55:44

eichan
Member
Registered: 2018-01-08
Posts: 31

Re: [SOLVED] Need help creating a package - conflict with '/lib'

There it is:

tan@bobby ~/bin/pkg/libindi_3rdparty$ find pkg
pkg
pkg/libindi_3rdparty
pkg/libindi_3rdparty/usr
pkg/libindi_3rdparty/usr/share
pkg/libindi_3rdparty/usr/share/indi
pkg/libindi_3rdparty/usr/share/indi/digital_inputs_sk.xml
pkg/libindi_3rdparty/usr/share/indi/switcher_sk.xml
pkg/libindi_3rdparty/usr/share/indi/indi_spectracyber.xml
pkg/libindi_3rdparty/usr/share/indi/meteostation_sk.xml
pkg/libindi_3rdparty/usr/share/indi/servo_sk.xml
pkg/libindi_3rdparty/usr/share/indi/indi_sx.xml
pkg/libindi_3rdparty/usr/share/indi/various_sk.xml
pkg/libindi_3rdparty/usr/share/indi/stepper_sk.xml
pkg/libindi_3rdparty/usr/share/indi/indi_qhy.xml
pkg/libindi_3rdparty/usr/share/indi/indi_align_sk.xml
pkg/libindi_3rdparty/usr/share/indi/indi_fishcamp.xml
pkg/libindi_3rdparty/usr/share/indi/indi_eqmod_simulator_sk.xml
pkg/libindi_3rdparty/usr/share/indi/indi_radiosim.xml
pkg/libindi_3rdparty/usr/share/indi/indi_eqmod_sk.xml
pkg/libindi_3rdparty/usr/share/indi/indi_gpsd.xml
pkg/libindi_3rdparty/usr/share/indi/simple_switcher_sk.xml
pkg/libindi_3rdparty/usr/share/indi/indi_dsi.xml
pkg/libindi_3rdparty/usr/share/indi/indi_qsi.xml
pkg/libindi_3rdparty/usr/share/indi/indi_duino.xml
pkg/libindi_3rdparty/usr/share/indi/indi_maxdomeii.xml
pkg/libindi_3rdparty/usr/share/indi/indi_sbig.xml
pkg/libindi_3rdparty/usr/share/indi/cosmos_sk.xml
pkg/libindi_3rdparty/usr/share/indi/indi_fli.xml
pkg/libindi_3rdparty/usr/share/indi/indi_eqmod.xml
pkg/libindi_3rdparty/usr/share/indi/indi_eqmod_scope_limits_sk.xml
pkg/libindi_3rdparty/usr/share/indi/focuser_sk.xml
pkg/libindi_3rdparty/usr/share/indi/indi_spectracyber_sk.xml
pkg/libindi_3rdparty/usr/share/indi/indi_aagcloudwatcher_sk.xml
pkg/libindi_3rdparty/usr/share/indi/indi_apogee.xml
pkg/libindi_3rdparty/usr/share/indi/indi_inovaplx_ccd.xml
pkg/libindi_3rdparty/usr/share/indi/indi_mgenautoguider.xml
pkg/libindi_3rdparty/usr/share/indi/indi_gpsnmea.xml
pkg/libindi_3rdparty/usr/share/indi/indi_aagcloudwatcher.xml
pkg/libindi_3rdparty/usr/share/indi/indi_nexstarevo.xml
pkg/libindi_3rdparty/usr/share/indi/indi_nexdome.xml
pkg/libindi_3rdparty/usr/share/indi/indi_gphoto.xml
pkg/libindi_3rdparty/usr/share/indi/indi_asi.xml
pkg/libindi_3rdparty/usr/share/indi/indi_rtlsdr.xml
pkg/libindi_3rdparty/usr/bin
pkg/libindi_3rdparty/usr/bin/indi_asi_ccd
pkg/libindi_3rdparty/usr/bin/indi_gphoto_ccd
pkg/libindi_3rdparty/usr/bin/indi_maxdomeii
pkg/libindi_3rdparty/usr/bin/indi_asi_wheel
pkg/libindi_3rdparty/usr/bin/indi_nexdome
pkg/libindi_3rdparty/usr/bin/indi_mgenautoguider
pkg/libindi_3rdparty/usr/bin/indi_aagcloudwatcher
pkg/libindi_3rdparty/usr/bin/indi_sx_wheel
pkg/libindi_3rdparty/usr/bin/indi_nikon_ccd
pkg/libindi_3rdparty/usr/bin/indi_fishcamp_ccd
pkg/libindi_3rdparty/usr/bin/indi_fli_focus
pkg/libindi_3rdparty/usr/bin/indi_inovaplx_ccd
pkg/libindi_3rdparty/usr/bin/indi_gpsd
pkg/libindi_3rdparty/usr/bin/aagcloudwatcher_test
pkg/libindi_3rdparty/usr/bin/indi_spectracyber
pkg/libindi_3rdparty/usr/bin/fxload-libusb
pkg/libindi_3rdparty/usr/bin/indi_canon_ccd
pkg/libindi_3rdparty/usr/bin/indi_apogee_ccd
pkg/libindi_3rdparty/usr/bin/indi_radiosim_detector
pkg/libindi_3rdparty/usr/bin/indi_sx_ccd
pkg/libindi_3rdparty/usr/bin/indi_rtlsdr_detector
pkg/libindi_3rdparty/usr/bin/indi_fli_ccd
pkg/libindi_3rdparty/usr/bin/indi_nexstarevo_telescope
pkg/libindi_3rdparty/usr/bin/indi_eqmod_telescope
pkg/libindi_3rdparty/usr/bin/indi_sbig_ccd
pkg/libindi_3rdparty/usr/bin/indi_fli_wheel
pkg/libindi_3rdparty/usr/bin/indi_duino
pkg/libindi_3rdparty/usr/bin/sx_ccd_test
pkg/libindi_3rdparty/usr/bin/indi_gpsnmea
pkg/libindi_3rdparty/usr/bin/indi_qhy_ccd
pkg/libindi_3rdparty/usr/bin/indi_qsi_ccd
pkg/libindi_3rdparty/usr/bin/qhy_ccd_test
pkg/libindi_3rdparty/usr/bin/indi_sx_ao
pkg/libindi_3rdparty/usr/bin/indi_dsi_ccd
pkg/libindi_3rdparty/.BUILDINFO
pkg/libindi_3rdparty/.PKGINFO
pkg/libindi_3rdparty/.MTREE
pkg/libindi_3rdparty/lib
pkg/libindi_3rdparty/lib/udev
pkg/libindi_3rdparty/lib/udev/rules.d
pkg/libindi_3rdparty/lib/udev/rules.d/99-qsi.rules
pkg/libindi_3rdparty/lib/udev/rules.d/99-sx.rules
pkg/libindi_3rdparty/lib/udev/rules.d/85-disable-dslr-automout.rules
pkg/libindi_3rdparty/lib/udev/rules.d/99-asi.rules
pkg/libindi_3rdparty/lib/udev/rules.d/99-fli.rules
pkg/libindi_3rdparty/lib/firmware
pkg/libindi_3rdparty/lib/firmware/meade-deepskyimager.hex
pkg/libindi_3rdparty/etc
pkg/libindi_3rdparty/etc/udev
pkg/libindi_3rdparty/etc/udev/rules.d
pkg/libindi_3rdparty/etc/udev/rules.d/99-meadedsi.rules

Offline

#4 2018-02-04 11:05:24

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

Re: [SOLVED] Need help creating a package - conflict with '/lib'

You can try to set CMAKE_INSTALL_LIBDIR similar to the prefix.

-DCMAKE_INSTALL_LIBDIR=/usr/lib

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

Offline

#5 2018-02-04 11:08:50

ayekat
Member
Registered: 2011-01-17
Posts: 1,632

Re: [SOLVED] Need help creating a package - conflict with '/lib'

OK, it's not a DESTDIR problem then smile

I think that the link to the GitHub issue you've found might indeed be the right fix.
For now, I would probably just modify the PKGBUILD to move the files from lib into usr/lib after the `make install`:

...
make DESTDIR="$pkgdir/" install
mv "$pkgdir/"{lib,usr/lib}
...

And once upstream fixes the CMAKE_INSTALL_LIBDIR "bug", you can remove that workaround again.


EDIT: Actually, eschwartz's approach (comment below) is better.

Last edited by ayekat (2018-02-04 12:51:41)


pkgshackscfgblag

Offline

#6 2018-02-04 11:14:47

eichan
Member
Registered: 2018-01-08
Posts: 31

Re: [SOLVED] Need help creating a package - conflict with '/lib'

Tried with 'DCMAKE_INSTALL_LIBDIR=/usr/lib' but same problem.

ayekat's fix worked just fine.

Problem solved in about 20mn. Best. Community. Ever.

Many thanks.

Offline

#7 2018-02-04 12:47:36

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

Re: [SOLVED] Need help creating a package - conflict with '/lib'

Random aside: I would much prefer to add https://github.com/indilib/indi/commit/ … 18fe.patch to the source array, and apply this patch in prepare()

This serves 2 goals: 1) document what you are doing, and why, and that the fix is upstreamed. 2) You will immediately know when to remove the workaround, as the patch will fail to apply.

...

Also, consider submitting an orphan request for the AUR package, if it is not being updated by the maintainer. Then you can upload the fixed, updated version for everyone.


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

Offline

Board footer

Powered by FluxBB