You are not logged in.

#1 2015-09-01 16:43:50

caroga
Member
Registered: 2015-09-01
Posts: 7

[Solved] How to correct misconfigured PKGBUILD

Hi,

I've searched and found a few topics covering this error, but I still do not understand how to resolve this issue. I've also asked on the IRC channel #archlinux, but that wasn't very helpful.

Problem:

error: failed to commit transaction (conflicting files)
vaiopower: /lib exists in filesystem
vaiopower: /usr/sbin exists in filesystem
Errors occurred, no packages were upgraded.
==> WARNING: Your packages are saved in /tmp/yaourt-tmp-caroga

So in the IRC channel someone said I had to do `pacman -Qo /usr/sbin`. This only showed me that the directory was owned by filesystems: `/lib is owned by filesystem 2015.02-1 and /usr/sbin is owned by filesystem 2015.02-1`. Not really helpful.

In the forums I've found the following two topics:
https://bbs.archlinux.org/viewtopic.php?id=192018
and
https://bbs.archlinux.org/viewtopic.php?id=164312

It basically consists of replacing `/lib` with `/usr/lib`. Now I do not understand where to do that in the PKGBUILD file.

# Maintainer: David Jurenka <arch.box NO-SP@M imx.jurenka DOT cz>
# Contributor: Danilo Kuehn <dk at nogo-software dot de>

pkgname=vaiopower
pkgver=0.5.0
pkgrel=3
pkgdesc="Tool for power management of Sony Vaio laptop devices"
arch=(any)
url="http://vaio-utils.org/power/"
license=('custom:ISC')
depends=(pciutils udev dmidecode)
optdepends=('pm-utils: restore settings on hibernate or suspend')
backup=(etc/vaiopower.conf)
install=vaiopower.install
source=(http://vaio-utils.org/download/$pkgname-$pkgver.tar.xz)
md5sums=(959fea9b89747fc25d017b3bef75da9c)
sha256sums=(3b48cbf57c635fc7e0c84dd33202984025ed09008452a5b68eb2d68216986259)

package() {
  cd ${srcdir}/${pkgname}-${pkgver}
  make prefix=/usr DESTDIR=${pkgdir} copy-exec
  make prefix=/usr DESTDIR=${pkgdir} copy-conf
  make prefix=/usr UDEVDIR=/lib/udev/rules.d DESTDIR=${pkgdir} copy-udev
  make prefix=/usr DESTDIR=${pkgdir} copy-bash
  make prefix=/usr DESTDIR=${pkgdir} copy-sleep
  make prefix=/usr DESTDIR=${pkgdir} copy-man
  make prefix=/usr DESTDIR=${pkgdir} copy-doc

  # systemd script
  install -d "${pkgdir}/usr/lib/systemd/system"
  install "init-scripts/systemd/${pkgname}.service" "${pkgdir}/usr/lib/systemd/system/${pkgname}.service"

  # license
  install -d "${pkgdir}/usr/share/licenses/${pkgname}"
  install -m 0644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

Now, I also need to have this done for the `/usr/sbin` reference, which I cannot find.

Could anyone explain me how and where to change this ?
Many thanks in advance!

Kind regards,
Caroga

Last edited by caroga (2015-09-02 19:13:58)

Offline

#2 2015-09-01 17:34:35

ugjka
Member
From: Latvia
Registered: 2014-04-01
Posts: 1,796
Website

Re: [Solved] How to correct misconfigured PKGBUILD

Dunno, use at your own risk.
Basically /lib and /usr/sbin have become symlinks, you can't install there anymore so you need to point to /usr/lib and /usr/bin instead.
Please also share your vaiopower.install file, maybe it needs some changes too

# Maintainer: David Jurenka <arch.box NO-SP@M imx.jurenka DOT cz>
# Contributor: Danilo Kuehn <dk at nogo-software dot de>

pkgname=vaiopower
pkgver=0.5.0
pkgrel=3
pkgdesc="Tool for power management of Sony Vaio laptop devices"
arch=(any)
url="http://vaio-utils.org/power/"
license=('custom:ISC')
depends=(pciutils udev dmidecode)
optdepends=('pm-utils: restore settings on hibernate or suspend')
backup=(etc/vaiopower.conf)
source=(http://vaio-utils.org/download/$pkgname-$pkgver.tar.xz)
md5sums=(959fea9b89747fc25d017b3bef75da9c)
sha256sums=(3b48cbf57c635fc7e0c84dd33202984025ed09008452a5b68eb2d68216986259)
install=vaiopower.install

package() {
  cd ${srcdir}/${pkgname}-${pkgver}
  make prefix=/usr DESTDIR=${pkgdir} copy-exec
  make prefix=/usr DESTDIR=${pkgdir} copy-conf
  make prefix=/usr UDEVDIR=/usr/lib/udev/rules.d DESTDIR=${pkgdir} copy-udev
  make prefix=/usr DESTDIR=${pkgdir} copy-bash
  make prefix=/usr DESTDIR=${pkgdir} copy-sleep
  make prefix=/usr DESTDIR=${pkgdir} copy-man
  make prefix=/usr DESTDIR=${pkgdir} copy-doc

  # systemd script
  install -d "${pkgdir}/usr/lib/systemd/system"
  install "init-scripts/systemd/${pkgname}.service" "${pkgdir}/usr/lib/systemd/system/${pkgname}.service"

  # license
  install -d "${pkgdir}/usr/share/licenses/${pkgname}"
  install -m 0644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  mv "${pkgdir}/usr/sbin" "${pkgdir}/usr/bin"
}

Last edited by ugjka (2015-09-01 18:19:53)


https://ugjka.net
paru > yay | webcord > discord
pacman -S spotify-launcher
mount /dev/disk/by-...

Offline

#3 2015-09-01 19:47:13

Steef435
Member
Registered: 2013-08-29
Posts: 577
Website

Re: [Solved] How to correct misconfigured PKGBUILD

Please save yourself some time and build the package manually. Don't use yaourt, it'll probably only be harder to inspect your issue.

When you run makepkg, in essence, you create a fake root folder in which you "install" the software. This and some other stuff gets thrown together and forms a package file. When you install this package, pacman will copy the files in the package file over to your "real" root folder. Before that though, it'll make sure there are no file conflicts: you don't want an existing file to get overwritten by a file in the package. You probably already know this. You probably also know that /lib and /usr/sbin are symbolic links and there's a file conflict between directories in your package with the same paths as the symbolic links in your filesystem package.

What you need to do: make sure that everything that currently gets installed in /lib and /usr/bin in the package instead go to /usr/lib and /usr/bin, so that the two directories causing the conflict can get out of the package too.

Download the AUR tarball and unpack it. Enter it and run makepkg. It will create the package file. It will also create the folder "pkg/vaiopower". You may want to have a look inside this folder, it will show you the fake root and its contents (what is the /usr/sbin?)

Take a look at the src folder. It contains the source files makepkg downloaded as instructed in the PKGBUILD. There's a makefile in there, this file handles most of the installing of the files (see all the "make" commands in the PKGBUILD?). Fat chance this makefile needs some adjustments.

Can you get it to work? If not, share the makefile and I'm sure someone can help you out.

Offline

#4 2015-09-01 19:59:12

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,788
Website

Re: [Solved] How to correct misconfigured PKGBUILD

Ew. Someone actually submitted that broken PKGBUILD to the new AUR? hmm

Pass "sbindir=/usr/bin" to all the make commands, or use sed to replace the instance of "sbin" with "bin" in the Makefile, in a prepare function.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#5 2015-09-01 20:28:24

caroga
Member
Registered: 2015-09-01
Posts: 7

Re: [Solved] How to correct misconfigured PKGBUILD

ugjka wrote:

...Please also share your vaiopower.install file, maybe it needs some changes too...

Yes, see below:

post_install() {
  echo ">>> Disable the devices set in /etc/vaiopower.conf."
  echo ">>> Activate service systemctl enable vaiopower.service"
}

post_remove() {
  # System is unable to resume if it has been suspended with DVD off.
  # So make sure DVD is on when we remove the package.
  DEVICE="/sys/devices/platform/sony-laptop"
  [ -w $DEVICE/cdpower ] && [ "$(cat $DEVICE/cdpower)" = 0 ] && echo 1 > $DEVICE/cdpower
}
WorMzy wrote:

Ew. Someone actually submitted that broken PKGBUILD to the new AUR? hmm

Pass "sbindir=/usr/bin" to all the make commands, or use sed to replace the instance of "sbin" with "bin" in the Makefile, in a prepare function.

I think it hasnt been updated since 2011 and everyone build it from source, speaking of which...

Steef435 wrote:

Please save yourself some time and build the package manually. Don't use yaourt, it'll probably only be harder to inspect your issue....

I will do so sir. I have already tried it with makepkg, but it was complaing about a missing PKGBUILD file, but I hope that with your comments I now know on what to do.
I noticed that './configure' and 'make' etc do not apply to this source package, so I will google on it first.

Thank all of you for your help so far, I will report back soon.

Offline

#6 2015-09-01 20:44:30

Steef435
Member
Registered: 2013-08-29
Posts: 577
Website

Re: [Solved] How to correct misconfigured PKGBUILD

Good luck! I think that WorMzy already spoiled all the fun though ^^

If you get stuck using makepkg, maybe this wiki page can help you out.

I don't see anything wrong with the install file by the way.

Offline

#7 2015-09-02 19:12:55

caroga
Member
Registered: 2015-09-01
Posts: 7

Re: [Solved] How to correct misconfigured PKGBUILD

Steef435 wrote:

Good luck! I think that WorMzy already spoiled all the fun though ^^

If you get stuck using makepkg, maybe this wiki page can help you out.

I don't see anything wrong with the install file by the way.

Thanks for all the help. Good news is that I've successfully installed the package. Bad news is, it's not working as I hoped it would... I ques I'll start a next topic for that as this is mainly a hardware issue and this topic has been covered and solved. I will mark it so. Thanks once again!

Offline

Board footer

Powered by FluxBB