You are not logged in.
Hi All,
I'm trying to build my own package for my printer, and being honest I'm not an expert...
But of course I would like to share it in AUR! I would also mantain if there are any future updates.
Please find the package here: http://we.tl/rchFJpW2EO
I'm just not familiar with sed.
Any inputs?
Thanks
ogghi
Offline
Please use a simple plain text hosting service (there is a list on the wiki): I have no intention of accepting some random T&C's just to view a PKGBUILD...
Offline
A PKGBUILD & additional text files can be posted directly on the forum:
# Contributor: ogghi < schmidt [at] linux [dot] com >
pkgname=dcp385c
pkgver=1.1.2
pkgrel=1
pkgdesc="CUPS driver for Brother DCP-385C printer"
arch=('i686' 'x86_64')
license=('custom:Brother Industries')
depends=('cups' 'foomatic-filters' 'a2ps')
makedepends=('rpmextract')
url="http://solutions.brother.com/linux/en_us/index.html"
source=(http://www.brother.com/pub/bsc/linux/dlf/${pkgname}lpr-${pkgver}-2.i386.rpm \
http://www.brother.com/pub/bsc/linux/dlf/${pkgname}cupswrapper-${pkgver}-2.i386.rpm)
md5sums=('e227cdf1f37cf21ffcafe9d97a252b6f'
'fef7da3b2c8897dd008f2c14a8ac4be3')
install=$pkgname.install
[ "$CARCH" = "x86_64" ] && depends=('cups' 'foomatic-filters' 'lib32-glibc' 'a2ps')
build() {
cd "$startdir/pkg" || return 1
for n in $startdir/src/*.rpm; do
rpmextract.sh "$n" || return 1
done
sed -i 's|/etc/init.d|/etc/rc.d|' $pkgdir/usr/local/Brother/Printer/${pkgname}/cupswrapper/cupswrapper${pkgname}
}dcp385c.install:
post_install() {
cat <<EOT
==============================================================================
==> To complete the installation process, you should now add a new printer in
==> the CUPS Web Interface:
==> http://localhost:631.
==>
==> If you want to use the scanner feature of your Brother DCP-385C,
==> you should install the following packages from AUR:
==> brscan3
==> brscan-skey
==============================================================================
EOT
/usr/local/Brother/Printer/dcp385c/cupswrapper/cupswrapperdcp385c
}
post_upgrade() {
post_install
}
post_remove() {
/bin/true
}
op=$1
shift
$op $*Offline
Thanks karol for posting the content ![]()
Anybody ideas for why it's not working?
When I do makepkg I get this at the end:
sed: can't read /home/ogghi/Downloads/dcp385c/pkg/dcp385c/usr/local/Brother/Printer/dcp385c/cupswrapper/cupswrapperdcp385c: No such file or directory
==> ERROR: A failure occurred in build().
Aborting...Offline
No input here? It might be stupid, but I can't get it!
Offline
According to sed it looks like something got lost. But then again the call to sed in the build function seems quite useless to me, since the rc.d stuff is long gone.
Also, this https://wiki.archlinux.org/index.php/Fo … te#Bumping
Offline
Sorry for bumping!
I did the following:
- Changed the sed line to this:
sed -i 's|/etc/init.d|/etc/rc.d|' $startdir/src/usr/local/Brother/Printer/${pkgname}/cupswrapper/cupswrapper${pkgname}Still I get an error during installation of the package, he can't find /usr/local/Brother/Printer/dcp385c/cupswrapper/cupswrapperdcp385c
Of course because it's not going to be copied there...ideas why?
I copied them there manually and the printer works, but which is the clean solution to do so in the pkg?
Offline
Okay, I changed the sed line, got it to build and had an empty package. So I started digging and got this:
build() {
cd $pkgdir || return 1
for n in $startdir/src/*.rpm; do
rpmextract.sh "$n" || return 1
done
sed -i 's|/etc/init.d|/etc/rc.d|' $pkgdir/usr/local/Brother/Printer/${pkgname}/cupswrapper/cupswrapper${pkgname}
}Now it builds.
And BTW $pkgdir != $startdir/pkg, that was the initial problem.
Offline
that look more a prepare() than a uild
the 'return 1' ... men this is the 22 century, that is not need to by added
package gidelines encourage use of /usr and discourage and unsupport use of /usr/local for packages
you can extract the source whit makepkg --nobuild and look the locations of files, maybe you need change things in other dirs ot whit other names
Lenovo ThinkPad L420 modified
:: Intel i7 2560QM :: 8 GB RAM :: SSD 256 GB ::
:: DVD read+Writter :: 3 USB 3.0 Expresa Card ::
:: a Favulous 1 mins lasting Io-Li battery ::cry::
Offline
Thanks for the help! ![]()
Maybe it already helps some other user like me having this printer. Of course we can improve that as needed!
Offline
Some tips:
You shouldn't be doing anything in $pkgdir during the build stage, so rename build() as package(), as that's what it is, and a PKGBUILD without a package() function is unsupported (or at least depreciated).
Change $startdir/src into $srcdir. You shouldn't be using $startdir at all.
As Jristz said, you don't need "|| return 1" at the end of lines, makepkg knows when something hasn't worked, you don't need to abort manually.
Arch also hasn't used /etc/rc.d for a while now, so I don't know what your sed line is trying to accomplish.
Your post_remove() function in your .install file also does nothing. I assume you just left the /bin/true there as a placeholder for something and forgot to fill it in?
The bottom of your install file also makes no sense to me, could you explain what you were trying to do?
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.
Online
I did not create this, it was from dcp387c package in AUR adapted to dcp385c...
If I find some time to do so I'll check what you said, thanks for the input!
Offline