exists in filesystem (owned by filesystem) in PKGBUILD for arch linux
Asked Answered
C

1

5

I am trying to build my own mariaDB arch linux package with PKGBUILD i have binries which are teady to be installed . I has bash script (arch linux PKGBUILD) which runs fime and creaes the pkg.tar file . When I try to install it with pacman I get this :-

%sudo pacman -U mariadb-bin-10.3.7-1-x86_64.pkg.tar                           :(
loading packages...
resolving dependencies...
looking for conflicting packages...

Packages (1) mariadb-bin-10.3.7-1

Total Installed Size:  539.71 MiB

:: Proceed with installation? [Y/n] y
(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)
mariadb-bin: /usr/lib64 exists in filesystem (owned by filesystem)
mariadb-bin: /usr/sbin exists in filesystem (owned by filesystem)
Errors occurred, no packages were upgraded.

here is my PKGBUILD file :-

# This is an example PKGBUILD file. Use this as a start to creating your own,
# and remove these comments. For more information, see 'man PKGBUILD'.
# NOTE: Please fill out the license field for your package! If it is unknown,
# then please put 'unknown'.

# Maintainer: Your Name <[email protected]>
pkgname='mariadb-bin'
pkgver=10.3.7
pkgrel=1
pkgdesc="MariaDB for arch linux"
arch=('x86_64')
url="http://mirror.truenetwork.ru/mariadb/"
license=('GPL')
groups=()
depends=()
makedepends=()
checkdepends=()
optdepends=()
provides=("mariadb=${pkgver}")
conflicts=('mariadb')
replaces=()
backup=('etc/mysql/my.cnf',
        'etc/mysql/wsrep.cnf')
options=()
install=mariadb-bin.install
changelog=
source=()
noextract=()
md5sums=()
validpgpkeys=()

prepare() {
    echo "I am prepare fn";
    pwd
}


build() {
    echo "I am buid fn ";
    pwd
}

check() {
    echo "I am check fn";
    pwd
}

package() {
    echo "I am package fn";
    cp ../usr ${pkgdir} -r
    cp ../etc ${pkgdir} -r
    pwd
    cd ${pkgdir}
    find ${pkgdir}/ -name *.so -exec chmod 777 {} \;
    chmod 755 ${pkgdir}/usr/bin/*
}

what should I do ? I know this question suites more on arch forum but since we can ask about bash and shell scripting , So ..

Caine answered 7/6, 2018 at 14:20 Comment(0)
A
6

Arch Linux implemented the UsrMerge in 2013 and since then it is required that Arch Linux packages use the libdir "/usr/lib" and sbindir "/usr/bin". If you do not, then the files you try to install will conflict with the symlinks on disk, which pacman does not allow.

You will need to fix the directory locations in your package() function.

As you can see, this really has nothing to do with bash scripting, and everything to do with the nature of pacman's packaging format and policies. :)

Andersonandert answered 25/6, 2018 at 22:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.