You are not logged in.

#1 2016-09-27 23:42:23

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,132

Specifying source in PKGBUILD without direct URL but open web link

I have been trying to create a PKGBUILD to install CUPS support for a KONICA-MINOLTA printer. I have something which works for me in the sense that I can build and install the package. (Haven't tried the printing yet.)

However, I'm currently relying on a local source file. If I was to submit to AUR, I know I'd need file://, but that's not my immediate concern. My immediate concern is that I'm not clear whether this would be acceptable given that the user does not need to agree to a licence as part of the download process. It is just that I cannot determine a direct link which works.

The download link I get if I navigate to the download page and copy the link's location is http://onyxftp.mykonicaminolta.com/Down … uctid=1630. However, this does not work in a PKGBUILD and does not work if pasted into a new Firefox tab.

The problem, I think, is that http://onyxweb.mykonicaminolta.com/OneS … ode=Public is basically giving me a javascript interface and the download links are actually doing something further to get the location of the file or archive which is opaque to me.

I tried using FTP to connect to onyxftp.mykonicaminolta.com in the hope that I could figure out the directory structure and determine a direct link. However, although it says that anonymous login is permitted, providing an email address as password (as instructed) results in the login being rejected due to lack of a home directory. However, the FTP service is a Microsoft version and I'm not really familiar with it at all, so I might simply be doing something stupid. If I get a list of commands, it looks more like a Windows shell prompt than the FTP servers I'm familiar with.

Is there a way to determine a direct download link in this kind of case? If not, is it acceptable to rely on a locally downloaded source archive?

https://bbs.archlinux.org/viewtopic.php?id=216379 is related but concerns a case where download requires click-through licence agreement, which isn't the case here.

Here's my current attempt at a PKGBUILD:

# Maintainer: Your Name <youremail@domain.com>
pkgname=KMbeuUX
pkgver=1_11
pkgrel=1
pkgdesc="KONICA MINOLTA CUPS Driver"
arch=('any')
url="http://onyxftp.mykonicaminolta.com/DownloadFile/Download.ashx?fileversionid=22712&productid=1630"
license=('custom')
depends=('cups')
install=${pkgname}.install
source=("${pkgname}v${pkgver}_EFIGS.tgz")
sha256sums=("5984c2b7f3067a34a5affce6ab1a4d945724fdb83e98ffdc2ec81f0d6a916f15")

prepare() {
        PPDDir=$(cups-config --datadir)/model
        FilterDir=$(cups-config --serverbin)/filter
}

package() {
        cd "${srcdir}/${pkgname}v${pkgver} EFIGS"
        PPDDir=$(cups-config --datadir)/model
        FilterDir=$(cups-config --serverbin)/filter
        install -dm 755 ${pkgdir}/${PPDDir}
        install -dm 755 ${pkgdir}/${FilterDir}
        install -m 644 *.ppd ${pkgdir}/${PPDDir}
        install -m 755 KMbeuEmpPS.pl KMbeuEnc.pm ${pkgdir}/${FilterDir}
        install -Dm 644 EULA.txt ${pkgdir}/usr/share/licenses/${pkgname}/EULA.txt
        install -dm 755 ${pkgdir}/usr/share/doc/${pkgname}
        install -m 644 'BEU Linux CUPS Driver Guide.pdf' KMdrv.txt ${pkgdir}/usr/share/doc/${pkgname}
}

I know I'm not meant to use upper case in the package name, but I'm also meant to ensure the name matches the start of the source archive which includes upper case.

namcap also tells me that cups is not needed as a dependency, even though the software requires CUPS.

With an install script (currently just a guess - I've been concentrating on the PKGBUILD):

post_install() {
        systemctl restart org.cups.cupsd.service 
}
post_upgrade() {
        systemctl restart org.cups.cupsd.service 
}

Last edited by cfr (2016-09-27 23:47:47)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#2 2016-09-28 00:06:36

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,525
Website

Re: Specifying source in PKGBUILD without direct URL but open web link

I was going to investigate, but most of the links you provide just five a 403 Forbidden error.

One gets me to the company's website where I see a colored bit of text saying "Drivers are just a click away" but that colored text is not a link - and while they may only be a click away, despite a fair amount of time digging around that site, I'm not sure exactly where I can "click" to get the drivers.

Can you give steps that we can repeat in order to get the download you did?


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2016-09-28 01:36:04

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,132

Re: Specifying source in PKGBUILD without direct URL but open web link

Thanks for looking and sorry about the lack of step-by-step. I should have done this in the first place.

And I am sorry that it is so annoying. If drivers are only 'a click away', then that route is well hidden. I needed to do this:

1. Start at http://onyxweb.mykonicaminolta.com/OneS … ode=Public

2. On the left, from the Category drop-down menu, choose 'Colored multifunction printers'.

3. From the Product drop-down menu, choose 'bizhub C654e'.

4. On the right under 'Select a Category', click the blue 'Drivers' button. This took a while for me while a blue circle-like thing whirled a lot.

5. Click Linux to expand the drop-down list of 5 items.

6. The download I think I need is the third one down: 3/30/2016 1.29 MB KMbeuUXv1 11 EFIGS.tgz

However, if I copy the link and try to use it directly, I get the http://onyxftp.mykonicaminolta.com/Down … uctid=1630 which returns a 403 error on the command line or nothing at all if pasted into a new Firefox tab. (It doesn't show anything and it doesn't download anything.)

I tried to look at the HTML source to see if I could figure out how it was assembling the URL, but I'm not sure whether it is even doing that. (At any rate, I couldn't work it out.)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#4 2016-09-28 02:10:57

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,525
Website

Re: Specifying source in PKGBUILD without direct URL but open web link

That is a hideous website.  But the problem is just that it checks the referrer header.  As long as you set that to their own site, curl can download it:

curl -e http://onyxweb.mykonicaminolta.com "http://onyxftp.mykonicaminolta.com/DownloadFile/Download.ashx?fileversionid=22712&productid=1630" > file.tgz

I'm not sure how (or whether) this can be done with makepkg in a PKGBUILD.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2016-09-28 02:39:40

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,132

Re: Specifying source in PKGBUILD without direct URL but open web link

Thank you Trilby!

May I ask how you figured that out? I really did try to work out what it was doing, even if the problem seems obvious to you wink.

I agree it is hideous. I don't think much of their documentation or software either. Or their hardware, for that matter.

However, I'm currently hostage to an IT person who routinely 'forgets' to install the drivers on the Windows boxes. If I can get this working on my laptop, I will be a bit less dependent on stuff I have no control over.

I have been told that I cannot print from Linux to the photocopier. However, I was also told I couldn't print wirelessly to the networked HPs and that turned out to be completely straightforward. (Initially, I believed them and didn't try. But it made no sense to me ....) I now interpret 'it can't be done except on Windows' to mean 'I only know how to do it on Windows' and proceed accordingly.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#6 2016-09-28 11:45:54

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,525
Website

Re: Specifying source in PKGBUILD without direct URL but open web link

cfr wrote:

May I ask how you figured that out?

Not very systematically.  I just knew that referer header settings other than what the target "wants" were a common cause of 403 errors.  Basically their site tries to prevent anyone from downloading the file unless they were just looking at their website.  But they use one of the most idiotic ways of enforcing this as one can set the http request headers to anything they want (request headers really can never be trusted to be accurate anything other than what the *sender* wants them to be).

cfr wrote:

I have been told that I cannot print from Linux to the photocopier...

I've been told many such things at my workplace.  Actually not quite so elloquently.  They look at my computer and recognize that it is not apple hardware.  So they tell me to go to the "windows" menu ...  I say I'm running linux.  They stare blankly for a minute and then say "ok, close linux to get back to your desktop, then go to the windows menu ..."

Luckily our printer has a web interface that people can submit jobs from.  I hacked together a curl script so I can print from the command line (or our headless servers) directly to the printer with no drivers smile

Last edited by Trilby (2016-09-28 12:35:59)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB