You are not logged in.

#1 2022-07-02 13:53:08

Morta
Member
Registered: 2019-07-07
Posts: 655

Unable to mv binary to /usr/bin

# Maintainer: Joël Müller <mail@joelmueller.ch>
pkgname=mediainfo-rar
pkgver=1.2.0
pkgrel=1
epoch=
pkgdesc="MediaInfo-rar get mediainfos from rar file"
arch=("x86_64")
url="http://www.lundman.net/wiki/index.php/Mediainfo-rar"
license=('GPL')
groups=()
depends=('unrar')
makedepends=()
checkdepends=()
optdepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=
changelog=
source=(http://www.lundman.net/ftp/mediainfo-rar/mediainfo-rar-Linux-x86-$pkgver.tar.gz)
noextract=()
sha256sums=('7c1cb7aff7c36d1e434f5863ba2cd5fa13e72f35acb69d6a4e618bbab735b7f2')

prepare() {
        tar xfvz $pkgname-Linux-x86-$pkgver.tar.gz
	cd "$pkgname"
}

package() {
	cd "$pkgname"
	cp -f "$pkgname"  "/usr/bin/$pkgname" #How can I do this command with root rights?
}

There is a binary file named mediainfo-rar which I want to move one to one to /usr/bin/

Last edited by Morta (2022-07-02 13:54:11)

Offline

#2 2022-07-02 13:59:56

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: Unable to mv binary to /usr/bin

You want to install stuff to $pkgdir and not /. 

cp -f "$pkgname"  "$pkgdir/usr/bin/$pkgname"

and using "install" instead of "cp" is a good idea to ensure correct permissions.

Offline

#3 2022-07-02 14:09:21

Morta
Member
Registered: 2019-07-07
Posts: 655

Re: Unable to mv binary to /usr/bin

Allan wrote:

You want to install stuff to $pkgdir and not /. 

cp -f "$pkgname"  "$pkgdir/usr/bin/$pkgname"

and using "install" instead of "cp" is a good idea to ensure correct permissions.

install: reguläre Datei '/usr/binmediainfo-rar' kann nicht angelegt werden: Keine Berechtigung

install: regular File '/usr/bin/mediainfo-rar' can't be created

install "$pkgname"  "/usr/bin$pkgname"

I want install a binary which I extracted from tar.gz to /usr/bin. I don't wanna install to $pkgdir

Offline

#4 2022-07-02 14:11:06

seth
Member
Registered: 2012-09-03
Posts: 49,968

Re: Unable to mv binary to /usr/bin

I want install a binary which I extracted from tar.gz to /usr/bin. I don't wanna install to $pkgdir

No you don't and you cant.
Why do you *think* you want to do that? It's contrary to the very concept of a "package".

Online

#5 2022-07-02 14:16:42

Morta
Member
Registered: 2019-07-07
Posts: 655

Re: Unable to mv binary to /usr/bin

Ok. And How I have to say that I want install the binary of the archive tar.gz to /usr/bin?

install "$pkgname"  "$pkgdir/usr/bin/$pkgname"

doesn't work

Offline

#6 2022-07-02 14:27:35

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,680
Website

Re: Unable to mv binary to /usr/bin

Morta wrote:

install: regular File '/usr/bin/mediainfo-rar' can't be created

That's not what it says. Read it again but slowly this time.

Is the missing backslash now present in the PKGBUILD?

You should probably explicitly specify the permissions in the install command. See other PKGBUILDs for examples of how to do this.

And the package name should have a -bin suffix if it supplies a binary.

Offline

#7 2022-07-02 14:31:41

Morta
Member
Registered: 2019-07-07
Posts: 655

Re: Unable to mv binary to /usr/bin

Ok.

Is more not enough rights. Sorry for the translation error.

I didn't really find a sample for install a binary. I searched in the forums and internet but coudn't find it.

Offline

#8 2022-07-02 14:35:37

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,680
Website

Re: Unable to mv binary to /usr/bin

What was the exact command you used to see that error message? Please post the full command and full output.

Also either edit the PKGBUILD in the OP to reflect the current status or post an updated version.

Offline

#9 2022-07-02 14:39:30

seth
Member
Registered: 2012-09-03
Posts: 49,968

Re: Unable to mv binary to /usr/bin

Is more not enough rights.

The problem of #3 (if that's your "doesn't work") isn't a rights issue.

I didn't really find a sample for install a binary.

https://aur.archlinux.org/packages?O=0&K=-bin
eg. https://aur.archlinux.org/cgit/aur.git/ … ?h=yay-bin

Online

#10 2022-07-02 15:21:25

Morta
Member
Registered: 2019-07-07
Posts: 655

Re: Unable to mv binary to /usr/bin

# Version notes:
pkgname=mediainfo-rar
pkgver=1.3.0
pkgrel=1
epoch=1
pkgdesc='mediainfo from rar files'
arch=(x86_64)
url=http://www.lundman.net/wiki/index.php/Mediainfo-rar
license=('')
depends=()
optdepends=()
provides=("${pkgname%-bin}=$pkgver" 'mediainfo-rar')
conflicts=(unrar)
options=(!strip)
source=("$pkgname-$pkgver.tar.gz::http://www.lundman.net/ftp/mediainfo-rar/$pkgname-Linux_x64-$pkgver.tar.gz")
noextract=("$pkgname-$pkgver.tar.gz")
sha256sums=('de7b518fb6c101bf2e375564d757f98f49407a1a4fc29a2abbfe19b936840ad0')

prepare() {
	mkdir -p mediainfo-rar
	tar xfvz "$pkgname-$pkgver.tar.gz" -C mediainfo-rar
	chmod +x mediainfo-rar/mediainfo-rar
}

package() {
	install -dm0755 "/$pkgdir/usr/bin"
        cd mediainfo-rar
        cp -a mediainfo-rar "/$pkgdir/usr/bin/$pkgname"
        cp -a unrar "/$pkgdir/usr/bin/unrar"
}

It's installing me in /usr/bin/mediainfor-rar/mediainfo-rar and /usr/bin/mediainfor-rar/unrar instead of /usr/bin/mediainfo-rar and /usr/bin/unrar

What is wrong?

Last edited by Morta (2022-07-02 15:21:41)

Offline

#11 2022-07-02 15:25:50

Morta
Member
Registered: 2019-07-07
Posts: 655

Re: Unable to mv binary to /usr/bin

I got it

# Version notes:
pkgname=mediainfo-rar
pkgver=1.3.0
pkgrel=1
epoch=1
pkgdesc='mediainfo from rar files'
arch=(x86_64)
url=http://www.lundman.net/wiki/index.php/Mediainfo-rar
license=('')
depends=()
optdepends=()
provides=("${pkgname%-bin}=$pkgver" 'mediainfo-rar')
conflicts=(unrar)
options=(!strip)
source=("$pkgname-$pkgver.tar.gz::http://www.lundman.net/ftp/mediainfo-rar/$pkgname-Linux_x64-$pkgver.tar.gz")
noextract=("$pkgname-$pkgver.tar.gz")
sha256sums=('de7b518fb6c101bf2e375564d757f98f49407a1a4fc29a2abbfe19b936840ad0')

prepare() {
	mkdir -p mediainfo-rar
	tar xfvz "$pkgname-$pkgver.tar.gz" -C mediainfo-rar
	chmod +x mediainfo-rar/mediainfo-rar
}

package() {
        cd $pkgname
	install -dm0755 "/$pkgdir/usr/bin"
        cd $pkgname
        cp -a mediainfo-rar "/$pkgdir/usr/bin/$pkgname"
        cp -a unrar "/$pkgdir/usr/bin/unrar"
}

Offline

#12 2022-07-02 15:28:05

Morta
Member
Registered: 2019-07-07
Posts: 655

Re: Unable to mv binary to /usr/bin

How can I commit this PKGBUILD to aur.archlinux.org?

Offline

#13 2022-07-02 15:36:58

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,680
Website

Re: Unable to mv binary to /usr/bin

Why are you using an epoch in the package version?

Why have you applied the noextract option for the source tarball and then manually extracted it? Remove that option and the prepare() function.

Why have you used install to just create "$pkgdir"/usr/bin/ instead of using it to install both executables:

package() {
   cd "$pkgname"
   install -Dm755 mediainfo-rar "$pkgdir"/usr/bin/mediainfo-rar
   install -Dm755 unrar "$pkgdir"/usr/bin/unrar
}

Offline

#14 2022-07-02 15:41:49

Morta
Member
Registered: 2019-07-07
Posts: 655

Re: Unable to mv binary to /usr/bin

Thanks for input the reason is not enough know-how :-D

# Version notes:
pkgname=mediainfo-rar
pkgver=1.3.0
pkgrel=1
pkgdesc='mediainfo from rar files'
arch=(x86_64)
url=http://www.lundman.net/wiki/index.php/Mediainfo-rar
license=('')
depends=()
optdepends=()
provides=("${pkgname%-bin}=$pkgver" 'mediainfo-rar')
conflicts=(unrar)
options=(!strip)
source=("$pkgname-$pkgver.tar.gz::http://www.lundman.net/ftp/mediainfo-rar/$pkgname-Linux_x64-$pkgver.tar.gz")
noextract=("$pkgname-$pkgver.tar.gz")
sha256sums=('de7b518fb6c101bf2e375564d757f98f49407a1a4fc29a2abbfe19b936840ad0')

prepare() {
	mkdir -p mediainfo-rar
	tar xfvz "$pkgname-$pkgver.tar.gz" -C mediainfo-rar
	chmod +x mediainfo-rar/mediainfo-rar
}

package() {
	cd "$pkgname"
	install -Dm755 mediainfo-rar "$pkgdir"/usr/bin/mediainfo-rar
	install -Dm755 unrar "$pkgdir"/usr/bin/unrar
}

looks better now, nor?

Back to my question... How I can push to AUR?

Last edited by Morta (2022-07-02 15:42:42)

Offline

#15 2022-07-02 15:51:34

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,680
Website

Re: Unable to mv binary to /usr/bin

You still have the noextract line and superfluous prepare() function. The licence field isn't filled in (I know Arch is shamefully lax about licencing but at least a vague statement is required). The empty fields should all be removed. The package name is still wrong because you haven't added the -bin suffix. That !strip option also looks bad.

Morta wrote:

How I can push to AUR?

https://wiki.archlinux.org/title/AUR_su … guidelines

Offline

#16 2022-07-02 16:44:58

Morta
Member
Registered: 2019-07-07
Posts: 655

Re: Unable to mv binary to /usr/bin

# Version notes:
pkgname=mediainfo-rar-bin
pkgver=1.3.0
pkgrel=1
pkgdesc='mediainfo from rar files'
arch=(x86_64)
url=http://www.lundman.net/wiki/index.php/Mediainfo-rar
license=('GPL2')
provides=("${pkgname%-bin}=$pkgver" 'mediainfo-rar')
conflicts=(unrar)
source=("http://www.lundman.net/ftp/mediainfo-rar/mediainfo-rar-Linux_x64-$pkgver.tar.gz")
sha256sums=('de7b518fb6c101bf2e375564d757f98f49407a1a4fc29a2abbfe19b936840ad0')

prepare() {
        cd mediainfo-rar
	chmod +x mediainfo-rar/mediainfo-rar
	chmod +x mediainfo-rar/unrar
}

package() {
	cd mediainfo-rar
	install -Dm755 /mediainfo-rar/mediainfo-rar "$pkgdir"/usr/bin/mediainfo-rar
	install -Dm755 /mediainfor-rar/unrar "$pkgdir"/usr/bin/unrar
}
 makepkg -si
==> Erstelle Paket: mediainfo-rar-bin 1.3.0-1 (Sat 02 Jul 2022 06:36:43 PM CEST)
==> Prüfe Laufzeit-Abhängigkeiten...
==> Prüfe Buildtime-Abhängigkeiten...
==> Empfange Quellen...
  -> mediainfo-rar-Linux_x64-1.3.0.tar.gz gefunden
==> Überprüfe source Dateien mit sha256sums...
    mediainfo-rar-Linux_x64-1.3.0.tar.gz ... Erfolg
==> Entpacke Quellen...
  -> Entpacke mediainfo-rar-Linux_x64-1.3.0.tar.gz mit bsdtar
mediainfo-rar/mediainfo-rar: Can't replace existing directory with non-directory: Das Verzeichnis ist nicht leer
bsdtar: Error exit delayed from previous errors.
==> FEHLER: Konnte mediainfo-rar-Linux_x64-1.3.0.tar.gz nicht entpacken
    Breche ab...

Why is the directory not empty? And why can't replace the directory with a non directory? I can't understand this error.

Is noextract the right way to do that when bsdtar fails?

Last edited by Morta (2022-07-02 16:52:41)

Offline

#17 2022-07-02 16:54:03

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,680
Website

Re: Unable to mv binary to /usr/bin

The tarball is automatically extracted (because you've removed the noextract option) so the manual extraction in the prepare() function (which I told you to remove) doesn't work.

Once more: remove the prepare() function.

Remove the pkg/ & src/ directories before running makepkg again.

EDIT: and prepend commands with LC_ALL=C to make them speak English.

Last edited by Head_on_a_Stick (2022-07-02 16:55:41)

Offline

#18 2022-07-02 17:04:11

Morta
Member
Registered: 2019-07-07
Posts: 655

Re: Unable to mv binary to /usr/bin

Head_on_a_Stick wrote:

The tarball is automatically extracted (because you've removed the noextract option) so the manual extraction in the prepare() function (which I told you to remove) doesn't work.

Once more: remove the prepare() function.

Remove the pkg/ & src/ directories before running makepkg again.

EDIT: and prepend commands with LC_ALL=C to make them speak English.

Ok I didn‘t understand the meaning of superfluous.
My english is far away from perfect. Remove I do understand.

And now I understand also that the prepare section is there to extract a tarball and is with a automatically extraction not necessary.

I will do tomorrow. Now I go out for a drink. Cheers!

Last edited by Morta (2022-07-02 17:04:32)

Offline

#19 2022-07-02 17:06:57

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,680
Website

Re: Unable to mv binary to /usr/bin

Morta wrote:

Ok I didn‘t understand the meaning of superfluous.
My english is far away from perfect. Remove I do understand.

Ah, sorry about that.

Too pretentious for my own good big_smile

Offline

#20 2022-07-02 17:27:09

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

Re: Unable to mv binary to /usr/bin

Note that this software should not be submitted to the AUR.  It must have a license.  And while upstream provides a file called "LICENSE" they do not grant any rights for use, copying, or anything else at all.  The whole license file is a joke (that's not a criticism, it appears intended as a joke).  It's most certainly *not* GPL2 as one of your PKGBUILDs above claimed.  You cannot just assign your preferred license to other people's software.

This also appears to incorporate source code from mediainfo but fails to meet their license requirements for using their code.  The same might be true for using unrar's code, but unrar also uses a custom and unusual license so I don't know what their requirements are.

Last edited by Trilby (2022-07-02 17:32:15)


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

Offline

#21 2022-07-02 17:38:06

Morta
Member
Registered: 2019-07-07
Posts: 655

Re: Unable to mv binary to /usr/bin

It‘s CC 4.0 for mediainfo mediainfo-rar has no license but is allowed to adjust the software even for commercial use.

Offline

#22 2022-07-02 17:45:08

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

Re: Unable to mv binary to /usr/bin

Morta wrote:

It‘s CC 4.0 for mediainfo

Where did you get this?  It's a BSD 2 clause license.

Morta wrote:

...mediainfo-rar has no license

If this were true, it could not be submitted to the AUR either.  But there is a file called LICENSE in the source tarball (and this is the file that's full of attempts at humor, but does not actually grant any rights to users).

Last edited by Trilby (2022-07-02 21:07:14)


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

Offline

#23 2022-07-02 17:49:11

Morta
Member
Registered: 2019-07-07
Posts: 655

Re: Unable to mv binary to /usr/bin

https://mediaarea.net/Conduct

This Code of Conduct is adapted from the Contributor Covenant, version 2.0
No change except the Scope paragraph which is adapted from the Django Code Of Conduct.
Creative Commons Attribution license.

Offline

#24 2022-07-02 17:54:44

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,680
Website

Re: Unable to mv binary to /usr/bin

That's a Code of Conduct, which is not the same as a software licence.

The correct SPDX identifier would be "BSD-2-Clause" but the Arch developers appear to think "BSD" is acceptable as an identifier.

EDIT: added SPDX link.

Last edited by Head_on_a_Stick (2022-07-02 17:55:42)

Offline

#25 2022-07-03 12:41:25

Morta
Member
Registered: 2019-07-07
Posts: 655

Re: Unable to mv binary to /usr/bin

# Maintainer: Joël Müller <mail@joelmueller.ch>
pkgname=mediainfo-rar-bin
pkgver=1.3.0
pkgrel=1
pkgdesc='mediainfo from rar files'
arch=(x86_64)
url=http://www.lundman.net/wiki/index.php/Mediainfo-rar
license=('BSD')
provides=("${pkgname%-bin}=$pkgver" 'mediainfo-rar')
conflicts=(unrar)
source=("http://www.lundman.net/ftp/mediainfo-rar/mediainfo-rar-Linux_x64-$pkgver.tar.gz")
sha256sums=('de7b518fb6c101bf2e375564d757f98f49407a1a4fc29a2abbfe19b936840ad0')

package() {
        cd "$srcdir"
	install -Dm755 "$srcdir"/mediainfo-rar/mediainfo-rar "$pkgdir"/usr/bin/mediainfo-rar
	install -Dm755 "$srcdir"/mediainfo-rar/unrar "$pkgdir"/usr/bin/unrar
}

I'm finished!

Now I have problems to push it to AUR. Could someone help me

Offline

Board footer

Powered by FluxBB