修正する

修正する

Arch LinuxにBrother QL-1060Nラベルプリンタ用のCUPSドライバをインストールしたいと思います。幸いなことに、AURパッケージを使用することができます。 (アーチは本当に素敵です。)

しかし、AURパッケージは少し古いです。私の質問は、最新のドライババージョンをインストールするためにPKGBUILDファイルをどのように編集しますか?

ここAURパッケージです。バージョン1.0.1r0に適用可能

ここブラザードライバーダウンロードリンクです。現在のバージョンは1.0.5-0です。

PKGBUILDは次のとおりです。

# Maintainer: Karol Babioch <[email protected]>
# Inspired by package brother-dcp130c

pkgname='brother-ql1060n'
pkgver=1.0.1r0
pkgrel=1
pkgdesc='LPR and CUPS driver for Brother QL-1060N label printer'
url='http://solutions.brother.com/linux/en_us/'
arch=('i686' 'x86_64')
license=('custom')
depends='cups'
if [ "$CARCH" = 'x86_64' ]; then
depends+=('lib32-glibc')
fi
install="$pkgname.install"
source=("http://download.brother.com/welcome/dlfp002231/ql1060nlpr-${pkgver/r/-}.i386.rpm"
        "http://download.brother.com/welcome/dlfp002233/ql1060ncupswrapper-${pkgver/r/-}.i386.rpm"
        'LICENSE')
sha256sums=('f2c2f919ec15b6159e13bfec60bb2d515f8c77a812e349a0ed1ec68ac29f5a25'
            'bf7a1d86234d643547fc9052df55524a5e4ddbd4bf07799988c18666e7d2d3eb'
            'cdd1955a9996bc246ba54e84f0a5ccbfdf6623962b668188762389aa79ef9811')

prepare()
{
#  do not install in '/usr/local'
if [ -d $srcdir/usr/local/Brother ]; then
    install -d $srcdir/usr/share
    mv $srcdir/usr/local/Brother/ $srcdir/usr/share/brother
    rm -rf $srcdir/usr/local
    sed -i 's|/usr/local/Brother|/usr/share/brother|g' `grep -lr '/usr/local/Brother' ./`
fi

# setup cups directories
install -d "$srcdir/usr/share/cups/model"
install -d "$srcdir/usr/lib/cups/filter"

#  go to the cupswrapper directory and find the source file from wich to generate a ppd- and wrapper-file
cd `find . -type d -name 'cupswrapper'`
if [ -f cupswrapper* ]; then
    _wrapper_source=`ls cupswrapper*`
    sed -i '/^\/etc\/init.d\/cups/d' $_wrapper_source
    sed -i '/^sleep/d' $_wrapper_source
    sed -i '/^echo lpadmin/d' $_wrapper_source
    sed -i '/^lpadmin/d' $_wrapper_source
    sed -i 's|/usr|$srcdir/usr|g' $_wrapper_source
    sed -i 's|/opt|$srcdir/opt|g' $_wrapper_source
    sed -i 's|/model/Brother|/model|g' $_wrapper_source
    sed -i 's|lpinfo|echo|g' $_wrapper_source
    export srcdir=$srcdir
    ./$_wrapper_source
    sed -i 's|$srcdir||' $srcdir/usr/lib/cups/filter/*lpdwrapper*
    sed -i "s|$srcdir||" $srcdir/usr/lib/cups/filter/*lpdwrapper*
    rm $_wrapper_source
fi

#  /etc/printcap is managed by cups
rm `find $srcdir -type f -name 'setupPrintcap*'`
}

package() {
cd "$srcdir"

cp -R usr $pkgdir
if [ -d opt ]; then cp -R opt $pkgdir; fi

install -Dm0644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

パッケージアーカイブの.installファイルには、次のコンテンツのみが含まれています。

post_install() {
post_upgrade;
}

post_upgrade() {
echo "Restart CUPS to load the new files"
echo "You can now register your new printer using the web interface at:"
echo "  http://localhost:631/"
}

いくつかの質問は次のとおりです。

なぜできないのrpm抽出コードにPKGBUILDが必要ですか?パッケージはRPMであり、これはArchなので、インストールがどのように機能するのか理解できません。

sha256sumについては、Brotherダウンロードページにそのファイルがリストされていないため(私が知っている限り)、rpmファイルを手動でダウンロードしてその合計を計算するとします。

私が思いついた価値は次のとおりです。

05d786b9a5b2cf374d5c286ae8feb77e2a79619cc5b2f6ca2695dbd549eec0a3  ql1060ncupswrapper-1.0.5-0.i386.rpm
bf20a00f723d0e12cf055ae359d0e03e2c1bd839bacd52f02b3cc5a63bc652e5  ql1060nlpr-1.0.5-0.i386.rpm

ライセンスファイルと対応するsha256sumは変更されていないと想定されます。

それでは、sha256sumsを置き換えてこの値を更新するのと同じように、PKGBUILDを更新するのは簡単ですか?

pkgver=1.0.1r0

そして

pkgver=1.0.5-0

修正する

パッケージマネージャがパッケージを更新しました。違いは次のとおりです。

5c5
< pkgver=1.0.1r0
---
> pkgver=1.0.5r0
19,20c19,20
< sha256sums=('f2c2f919ec15b6159e13bfec60bb2d515f8c77a812e349a0ed1ec68ac29f5a25'
<             'bf7a1d86234d643547fc9052df55524a5e4ddbd4bf07799988c18666e7d2d3eb'
---
> sha256sums=('bf20a00f723d0e12cf055ae359d0e03e2c1bd839bacd52f02b3cc5a63bc652e5'
>             '05d786b9a5b2cf374d5c286ae8feb77e2a79619cc5b2f6ca2695dbd549eec0a3'

しかし、このPKGBUILDの仕組みとこの方法を使用してRPMパッケージをインストールする方法を理解したいので、この質問を開いておきます。

ベストアンサー1

おすすめ記事