You are not logged in.

#1 2013-10-24 11:31:50

elken
Member
From: Vim
Registered: 2013-10-17
Posts: 66

[Solved] Multiple licenses?

Hi,

I'm redoing the PKGBUILD for powerline-fonts, but as the pack requires different licenses. I have them wrapped in the source tarball but I'm unable to install them for some reason. Is there a hook I need to include to have the dir under /usr/share/licenses/$pkgname created? I'm using the method outlined in the guidelines to install, but within a for loop.

EDIT: Sorry, I typed this post just before I left.

# Maintainer: Sergey Dovgal <arcadoss-f at ya.ru>
# Contributor: Ellis Kenyo <elken.tdos at gmail.com>
pkgname=powerline-fonts
_gitname=powerline-fonts
pkgver=861a3c6
pkgrel=1
depends=('fontconfig' 'xorg-font-utils')
makedepends=('git')
url=('git://github.com/Lokaltog/powerline-fonts')
license=('Apache' 'custom:"SIL Open Font License"' 'custom:"Ubuntu Fonts License"' 'custom:"DejaVu Fonts 
License"')
pkgdesc="All patched fonts for Powerline users"
arch=('any')
source=('git+https://github.com/Lokaltog/powerline-fonts.git' )
install=$pkgname.install

md5sums=('SKIP')

pkgver() {
	cd $_gitname
	# Use the tag of the last commit
	git describe --always | sed 's|-|.|g'
}

package() {
	install -d "$pkgdir/usr/share/fonts/TTF"
	for i in LICENSE.*; do
		install -Dm644 $i "${pkgdir}/usr/share/licenses/${pkgname}/$i";
	done
	#cd $_gitname
	#cp "$srcdir/Monaco_Linux-Powerline.ttf" "$pkgdir/usr/share/fonts/TTF/"
	#cp -dpr --no-preserve=ownership */*.ttf "$pkgdir/usr/share/fonts/TTF/"
}

Last edited by elken (2013-10-25 21:10:45)


Useless shit wot I do | "A very witty and relatable quote." -- A wise man

Offline

#2 2013-10-24 11:35:07

Allan
Developer
From: Brisbane, AU
Registered: 2007-06-09
Posts: 10,409
Website

Re: [Solved] Multiple licenses?

I see your mistake.  It is on line three...    or at least that is what I would say if you gave us anything to look at.

Offline

#3 2013-10-24 11:36:25

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

Re: [Solved] Multiple licenses?

Please post the redone PKGBUILD.

Offline

#4 2013-10-24 11:37:59

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 5,275

Re: [Solved] Multiple licenses?

Just make the directory manually in the package function, like the current PKGBUILD does with "/usr/share/fonts/TTF".

Last edited by WorMzy (2013-10-24 11:39:19)


Sakura:-
Mobo: ASUS P8Z77-V PRO // Processor: Intel Core i7-3770K 3.4GHz // GFX: nVidia GeForce GTX 970 Ti // RAM: 32GB (4x 8GB) Corsair DDR3 (@ 2133MHz) // Storage: 1x 3TB Seagate SATAII 5x 1TB Samsung SATAII, 2x 120GB Corsair SSD

Offline

#5 2013-10-24 11:40:47

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,838
Website

Re: [Solved] Multiple licenses?

There's not much we can do unless you show the PKGBUILD that is leading to the problem.  Also the error(s) you are getting would help.  But a couple notes:

1) The package name should be powerline-fonts-git as it pulls from a git source
2) When you say the licenses are in the source tarball, you don't mean the one you upload to the AUR do you?  They are in the upstream source on git, so they should not be uploaded to the AUR directly.
3) If you are including them in the tarball uploaded to the AUR, you'd need to copy them from ${srcdir} not from ${_gitname} - but as mentioned in #2, you shouldn't do this.


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#6 2013-10-24 11:45:35

elken
Member
From: Vim
Registered: 2013-10-17
Posts: 66

Re: [Solved] Multiple licenses?

Trilby wrote:

There's not much we can do unless you show the PKGBUILD that is leading to the problem.  Also the error(s) you are getting would help.  But a couple notes:

1) The package name should be powerline-fonts-git as it pulls from a git source
2) When you say the licenses are in the source tarball, you don't mean the one you upload to the AUR do you?  They are in the upstream source on git, so they should not be uploaded to the AUR directly.
3) If you are including them in the tarball uploaded to the AUR, you'd need to copy them from ${srcdir} not from ${_gitname} - but as mentioned in #2, you shouldn't do this.

Ah, ok. My mistake. I thought I had to explicitally include them. So would I copy those from the repo to /usr/share/licenses/$pkgdir?


Useless shit wot I do | "A very witty and relatable quote." -- A wise man

Offline

#7 2013-10-24 11:51:20

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,838
Website

Re: [Solved] Multiple licenses?

Please read the PKGBUILD documentation more carefully, and look at a few examples.  You will never see ${pkgdir} at the end of a path like that.  The reason why is very clear when you read the definition of what that variable is.

But still, we can't know if that's the main/only problem unless you show us the PKGBUILD or the errors. (edit: sorry, I missed your edit of the OP)

Last edited by Trilby (2013-10-24 11:53:42)


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#8 2013-10-24 11:52:16

elken
Member
From: Vim
Registered: 2013-10-17
Posts: 66

Re: [Solved] Multiple licenses?

I know, I was just using it as a shorthand answer. I've stuck the PKGBUILD in first post.


Useless shit wot I do | "A very witty and relatable quote." -- A wise man

Offline

#9 2013-10-24 11:59:25

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,838
Website

Re: [Solved] Multiple licenses?

You still haven't told us about any errors.  I have to assume (I don't like assuming) that the error comes from the for loop not finding any LICENSE files, because they aren't in the current working directory.  You have to provide the proper path to those files.

[ EDIT: first, make sure you `cd` to ${gitdir} ]

One way which is closest to what you already have is to initiate the loop as follows:

for i in */LICENSE.txt; do

I would prefer using find myself:

find -name LICENSE.txt -exec install ...

But if you haven't used find's exec parameter before, the first will probably be easier to get working quickly.

EDIT: I hope this doesn't make me sound like a jerk, but while I'm all for shorthand (like my elipsis in the above example) there is a difference between shorthand and innaccuracy.  I don't see putting the ${pkgdir} at the end of a path as any shorter than the beginning.  Perhaps you meant for ${pkgname} to be in that spot, in which case it would be a typo (a perfectly understandable one in hindsight) but not shorthand.  Precision in troubleshooting discussions is important.

Last edited by Trilby (2013-10-24 12:08:33)


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#10 2013-10-24 12:02:00

elken
Member
From: Vim
Registered: 2013-10-17
Posts: 66

Re: [Solved] Multiple licenses?

There isn't a visible error, the files & directory don't exist after

makepkg -si

Useless shit wot I do | "A very witty and relatable quote." -- A wise man

Offline

#11 2013-10-24 12:03:38

Allan
Developer
From: Brisbane, AU
Registered: 2007-06-09
Posts: 10,409
Website

Re: [Solved] Multiple licenses?

elken wrote:
package() {
	install -d "$pkgdir/usr/share/fonts/TTF"
	for i in LICENSE.*; do
		install -Dm644 $i "${pkgdir}/usr/share/licenses/${pkgname}/$i";
	done
	#cd $_gitname
	#cp "$srcdir/Monaco_Linux-Powerline.ttf" "$pkgdir/usr/share/fonts/TTF/"
	#cp -dpr --no-preserve=ownership */*.ttf "$pkgdir/usr/share/fonts/TTF/"
}

You are almost certainly not in the right directory, so there is no LICENSE.*.   Also, I'd create the ${pkgdir}/usr/share/licenses/${pkgname}/ directory and then install the licenses into it.

Offline

#12 2013-10-24 12:07:20

elken
Member
From: Vim
Registered: 2013-10-17
Posts: 66

Re: [Solved] Multiple licenses?

There is, I had the 3 licenses saved in LICENSE.<name> format.

ls -al

total 76
drwxr-xr-x 1 ed ed   270 Oct 24 12:24 .
drwxr-xr-x 1 ed ed   124 Oct 24 11:18 ..
-rw-r--r-- 1 ed ed  4765 Oct 24 11:37 LICENSE.dejavu
-rw-r--r-- 1 ed ed  4696 Oct 24 11:29 LICENSE.ofl
-rw-r--r-- 1 ed ed  4673 Oct  8  2010 LICENSE.ubuntu
drwxr-xr-x 1 ed ed    30 Oct 24 12:21 pkg
-rw-r--r-- 1 ed ed   988 Oct 24 12:23 PKGBUILD
-rw-r--r-- 1 ed ed  1096 Oct 24 12:21 powerline-fonts-861a3c6-1-any.pkg.tar.xz
-rw-r--r-- 1 ed ed 39088 Oct 24 11:45 powerline-fonts.git
-rw-r--r-- 1 ed ed   278 Oct 24 12:19 powerline-fonts.install
drwxr-xr-x 1 ed ed    68 Oct 24 12:23 src

Ok, I wasn't sure to what degree directory creation was allowed. Thanks for you help.

Last edited by elken (2013-10-24 12:10:06)


Useless shit wot I do | "A very witty and relatable quote." -- A wise man

Offline

#13 2013-10-24 12:11:55

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,838
Website

Re: [Solved] Multiple licenses?

You don't list those files in the source array of the PKGBUILD, so they are not copied (or linked) to the source directory where the package function starts.

The first thing any PKGBUILD function should do is cd to the correct directory.

To fix the problem as stated, all the license files should be added to the source array if they are to be included in the tarball uploaded to the AUR.  To fix the problem correctly, pull them out of the source pulled fom git instead.

Last edited by Trilby (2013-10-24 12:14:16)


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#14 2013-10-24 12:13:25

Allan
Developer
From: Brisbane, AU
Registered: 2007-06-09
Posts: 10,409
Website

Re: [Solved] Multiple licenses?

If they are source files, you should add them to the source array.   That way makepkg will put them in the directory you start in.

Offline

#15 2013-10-24 12:56:24

elken
Member
From: Vim
Registered: 2013-10-17
Posts: 66

Re: [Solved] Multiple licenses?

Ok, this PKGBUILD works. Is it fine to upload? Or should I retain the original name?

# Maintainer: Sergey Dovgal <arcadoss-f at ya.ru>
# Contributor: Ellis Kenyo <elken.tdos at gmail.com>
pkgname=ttf-powerline-fonts-git
_gitname=powerline-fonts
pkgver=861a3c6
pkgrel=1
depends=('fontconfig' 'xorg-font-utils')
makedepends=('git')
url=('git://github.com/Lokaltog/powerline-fonts')
license=('Apache' 'custom:"SIL Open Font License"' 'custom:"Ubuntu Fonts License"' 'custom:"DejaVu Fonts 
License"')
pkgdesc="All patched fonts for Powerline users"
arch=('any')
source=('git+https://github.com/Lokaltog/powerline-fonts.git' )
install=$pkgname.install

md5sums=('SKIP')

pkgver() {
	cd $_gitname
	# Use the tag of the last commit
	git describe --always | sed 's|-|.|g'
}

package() {
	mkdir -p $pkgdir/usr/share/fonts/TTF
	mkdir -p $pkgdir/usr/share/licenses/$pkgname
	
	find . -iname "*.ttf" -exec install -m644 {} $pkgdir/usr/share/fonts/TTF \;
	cd $srcdir/$_gitname
	cp -vR --parents */*.txt "$pkgdir/usr/share/licenses/$pkgname"
}

Useless shit wot I do | "A very witty and relatable quote." -- A wise man

Offline

#16 2013-10-24 14:24:01

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 4,991

Re: [Solved] Multiple licenses?

git describe doesn't work if there's no tags. Please pick another method of updating the pkgver. See https://wiki.archlinux.org/index.php/VC … Guidelines

please quote all uses of $srcdir and $pkgdir.

cp -a is usually preferable if you must use cp.

Online

#17 2013-10-24 14:27:44

elken
Member
From: Vim
Registered: 2013-10-17
Posts: 66

Re: [Solved] Multiple licenses?

# Maintainer: Ellis Kenyo <elken.tdos at gmail.com>
pkgname=ttf-powerline-fonts-git
_gitname=powerline-fonts
pkgver=861a3c6
pkgrel=1
depends=('fontconfig' 'xorg-font-utils')
makedepends=('git')
url=('git://github.com/Lokaltog/powerline-fonts')
license=('Apache' 'custom:"OFL"' 'custom:"UFL"' 'custom:"DFL "')
pkgdesc="Patched fonts for Powerline users"
arch=('any')
source=('git+https://github.com/Lokaltog/powerline-fonts.git' )
install=$pkgname.install

md5sums=('SKIP')

pkgver() {
	cd local_repo
	printf "%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}


package() {
	mkdir -p "$pkgdir/usr/share/fonts/TTF"
	mkdir -p "$pkgdir/usr/share/fonts/OTF"
	if [ ! -f /usr/share/fonts/OTF/fonts.dir ]; then
		"mkfontdir $pkgdir/usr/share/fonts/OTF";
	fi
	if 	[ ! -f /usr/share/fonts/TTF/fonts.dir ]; then
		mkfontdir "$pkgdir/usr/share/fonts/TTF";
	fi
	mkdir -p "$pkgdir/usr/share/licenses/$pkgname"
	
	find . -iname "*.ttf" -exec install -m644 {} "$pkgdir/usr/share/fonts/TTF" \;
	find . -iname "*.otf" -exec install -m644 {} "$pkgdir/usr/share/fonts/OTF" \;
	cd $srcdir/$_gitname
	cp -vR --parents */*.txt "$pkgdir/usr/share/licenses/$pkgname"
}

Like that?


Useless shit wot I do | "A very witty and relatable quote." -- A wise man

Offline

#18 2013-10-24 14:55:59

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,838
Website

Re: [Solved] Multiple licenses?

mkfontdir will fail there as it will run in the fakeroot environment - or worse, if it succeeds it will overwrite the user's fonts.dir files and bork their other fonts.  That should be put into the post install script.

I'm also not sure what "local_repo".  Just use 'cd "${_gitname}"'.  I'd also suggest moving the `cd` commands to the very first line of the package function.  It may not make a different right now, but it'd be better "future proofing"


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#19 2013-10-24 15:01:33

elken
Member
From: Vim
Registered: 2013-10-17
Posts: 66

Re: [Solved] Multiple licenses?

It only creates the fontdir if the font.dir doesn't exist already, or is there a better way than that?

# Maintainer: Ellis Kenyo <elken.tdos at gmail.com>
pkgname=ttf-powerline-fonts-git
_gitname=powerline-fonts
pkgver=861a3c6
pkgrel=1
depends=('fontconfig' 'xorg-font-utils')
makedepends=('git')
url=('git://github.com/Lokaltog/powerline-fonts')
license=('Apache' 'custom:"OFL"' 'custom:"UFL"' 'custom:"DFL "')
pkgdesc="Patched fonts for Powerline users"
arch=('any')
source=('git+https://github.com/Lokaltog/powerline-fonts.git' )
install=$pkgname.install

md5sums=('SKIP')

pkgver() {
	cd $srcdir/$_gitname
	printf "%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}


package() {
	cd $srcdir/$_gitname
        mkdir -p "$pkgdir/usr/share/fonts/TTF"
	mkdir -p "$pkgdir/usr/share/fonts/OTF"
	if [ ! -f /usr/share/fonts/OTF/fonts.dir ]; then
		"mkfontdir $pkgdir/usr/share/fonts/OTF";
	fi
	if 	[ ! -f /usr/share/fonts/TTF/fonts.dir ]; then
		mkfontdir "$pkgdir/usr/share/fonts/TTF";
	fi
	mkdir -p "$pkgdir/usr/share/licenses/$pkgname"
	
	find . -iname "*.ttf" -exec install -m644 {} "$pkgdir/usr/share/fonts/TTF" \;
	find . -iname "*.otf" -exec install -m644 {} "$pkgdir/usr/share/fonts/OTF" \;
	cp -vR --parents */*.txt "$pkgdir/usr/share/licenses/$pkgname"
}

Last edited by elken (2013-10-24 15:03:24)


Useless shit wot I do | "A very witty and relatable quote." -- A wise man

Offline

#20 2013-10-24 15:08:09

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 5,275

Re: [Solved] Multiple licenses?

There's no way to know whether the font.dir exists or not if the user is building in a fakeroot environment (e.g. with devtools), and the user could generate one after making the package.

You should still add quotes to anything that uses $srcdir or $pkgdir, e.g. cd "$srcdir/$_gitname"

Also, is this package ultimately any different to powerline-fonts-git?


Sakura:-
Mobo: ASUS P8Z77-V PRO // Processor: Intel Core i7-3770K 3.4GHz // GFX: nVidia GeForce GTX 970 Ti // RAM: 32GB (4x 8GB) Corsair DDR3 (@ 2133MHz) // Storage: 1x 3TB Seagate SATAII 5x 1TB Samsung SATAII, 2x 120GB Corsair SSD

Offline

#21 2013-10-24 15:10:30

elken
Member
From: Vim
Registered: 2013-10-17
Posts: 66

Re: [Solved] Multiple licenses?

powerline-fonts-git is outdated due to Powerline being added into [community], this is for people like me who want the fonts without having to install it.

So should I stick the font stuff in post_install?

Last edited by elken (2013-10-24 15:20:13)


Useless shit wot I do | "A very witty and relatable quote." -- A wise man

Offline

#22 2013-10-24 16:30:47

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,838
Website

Re: [Solved] Multiple licenses?

elken wrote:

powerline-fonts-git is outdated due to Powerline being added into [community], this is for people like me who want the fonts without having to install it.

So should I stick the font stuff in post_install?

But you would be installing it ... you just be pulling from git to install it first.  A PKGBUILD is for building a package ... that you will then install.  I feel like I must be missing something here.

But for the second question, yes, the mkfontdir and any mkfontscale should go in the post_install script, otherwise it will simply not work and will most likely generate a file conflict when you try to install the package.


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#23 2013-10-24 16:32:03

elken
Member
From: Vim
Registered: 2013-10-17
Posts: 66

Re: [Solved] Multiple licenses?

Ok, thanks.


Useless shit wot I do | "A very witty and relatable quote." -- A wise man

Offline

Board footer

Powered by FluxBB