4

PKGBUILD を使用して独自の mariaDB arch linux パッケージを構築しようとしています。インストールが簡単なバイナリがあります。fime を実行して pkg.tar ファイルを作成する bash スクリプト (arch linux PKGBUILD) があります。pacman でインストールしようとすると、次のようになります:-

%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.

これが私のPKGBUILDファイルです:-

# 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 <youremail@domain.com>
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/*
}

私は何をすべきか ?この質問はアーチ フォーラムの方が適していることは知っていますが、bash とシェル スクリプトについて質問できるので、..

4

1 に答える 1

6

Arch Linuxは2013 年にUsrMergeを実装して以来、Arch Linux パッケージは libdir "/usr/lib" と sbindir "/usr/bin" を使用する必要があります。そうしないと、インストールしようとするファイルがディスク上のシンボリックリンクと衝突することになり、pacman はこれを許可しません。

関数内のディレクトリの場所を修正する必要がありますpackage()

ご覧のとおり、これは実際には bash スクリプトとは何の関係もなく、すべて pacman のパッケージ形式とポリシーの性質に関係しています。:)

于 2018-06-25T22:13:37.573 に答える