You are not logged in.

#1 2013-09-05 20:29:07

ogghi
Member
Registered: 2013-09-05
Posts: 17

Trying to build package fails, brother dcp385c

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

#2 2013-09-05 20:35:25

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Trying to build package fails, brother dcp385c

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


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2013-09-05 21:26:53

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Trying to build package fails, brother dcp385c

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

#4 2013-09-10 18:48:34

ogghi
Member
Registered: 2013-09-05
Posts: 17

Re: Trying to build package fails, brother dcp385c

Thanks karol for posting the content smile
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

#5 2013-09-13 18:27:42

ogghi
Member
Registered: 2013-09-05
Posts: 17

Re: Trying to build package fails, brother dcp385c

No input here? It might be stupid, but I can't get it!

Offline

#6 2013-09-13 18:54:59

cookies
Member
Registered: 2013-01-17
Posts: 253

Re: Trying to build package fails, brother dcp385c

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

#7 2013-09-14 07:37:10

ogghi
Member
Registered: 2013-09-05
Posts: 17

Re: Trying to build package fails, brother dcp385c

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

#8 2013-09-16 10:29:59

cookies
Member
Registered: 2013-01-17
Posts: 253

Re: Trying to build package fails, brother dcp385c

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

#9 2013-09-16 20:28:01

Jristz
Member
From: America/Santiago
Registered: 2011-06-11
Posts: 1,048

Re: Trying to build package fails, brother dcp385c

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

#10 2013-09-16 21:30:22

ogghi
Member
Registered: 2013-09-05
Posts: 17

Re: Trying to build package fails, brother dcp385c

Thanks for the help! smile
Maybe it already helps some other user like me having this printer. Of course we can improve that as needed!

Offline

#11 2013-09-16 22:33:37

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,653
Website

Re: Trying to build package fails, brother dcp385c

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.

Offline

#12 2013-09-18 20:36:12

ogghi
Member
Registered: 2013-09-05
Posts: 17

Re: Trying to build package fails, brother dcp385c

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

Board footer

Powered by FluxBB