LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Arch
User Name
Password
Arch This Forum is for the discussion of Arch Linux.

Notices


Reply
  Search this Thread
Old 02-07-2019, 09:57 AM   #1
Neyzan
Member
 
Registered: Jul 2010
Location: Athens, Greece
Distribution: Slackware, Arch, Fedora.
Posts: 90

Rep: Reputation: 3
Unable to create functional PKGBUILD for font collection


I am trying to create my first package with a collection of some fonts I use, to install on my Arch Linux system. I followed the relevant instructions to create a package for my fonts, but while I modified the template PKGBUILD accordingly I get the error "install: cannot stat 'OTF/*.otf': No such file or directory" (when I hash out the relevant line I get the same error for all "install" commands).
I uploaded the necessary files in my GitHub repo and made the following PKGBUILD.

Code:
pkgname=free-metal-fonts
pkgver=0.1
_relver=0.1
pkgrel=1
pkgdesc="This is a collection of rock and metal style free fonts compiled by Neyzan (NeyzanRumi)"
url="https://github.com/NeyzanRumi/Font-Collections/tree/master/Free-Metal-Fonts/"
arch=(any)
license=(SIL OFL v1.1 and GNU GPL v3)
_tarname=free-metal-fonts-${_relver//\//-}
source=("$_tarname.tar.gz::https://github.com/NeyzanRumi/Font-Collections/tree/master/Free-Metal-Fonts/$_relver.tar.gz")
sha256sums=('ef3180aab212b839e99665db67a821c074e8107ed4401878acff92e293d5d84d')

package() {
  cd $_tarname
  install -d "$pkgdir/usr/share/fonts/${pkgname%-fonts}"
  install -t "$pkgdir/usr/share/fonts/${pkgname%-fonts}" -m644 OTF/*.otf
  install -t "$pkgdir/usr/share/fonts/${pkgname%-fonts}" -m644 TTF/*.ttf
  install -Dm644 OFL "$pkgdir/usr/share/licenses/$pkgname/OFL"
  install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
  install -Dm644 README.md "$pkgdir/usr/share/licenses/$pkgname/README.md"
}

# vim:set ts=2 sw=2 et:
Can anyone tell me were I went wrong?

Last edited by Neyzan; 02-07-2019 at 10:05 AM.
 
Old 02-07-2019, 02:40 PM   #2
Roboron
LQ Newbie
 
Registered: Feb 2019
Posts: 3

Rep: Reputation: Disabled
Well the error is clear. You are trying to open a directory that doesn't exist (OTF).
 
Old 02-07-2019, 04:49 PM   #3
mralk3
Senior Member
 
Registered: May 2015
Location: Utah, USA
Distribution: Slackware 14.2 || Slackware-current && CentOS
Posts: 1,371

Rep: Reputation: 734Reputation: 734Reputation: 734Reputation: 734Reputation: 734Reputation: 734Reputation: 734
Unable to create functional PKGBUILD for font collection

Adjust the script to take the directory listing of the font files and loop through each one. Then copy each font into the desired location. I think you problem is due to the install command being unable to expand the directory listing. Check the man page.

Edit:. You could also simplify it all by using the cp command to copy the files and the chmod command to set the permissions.

Last edited by mralk3; 02-07-2019 at 04:51 PM.
 
Old 02-08-2019, 01:08 PM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 11,044
Blog Entries: 7

Rep: Reputation: 2778Reputation: 2778Reputation: 2778Reputation: 2778Reputation: 2778Reputation: 2778Reputation: 2778Reputation: 2778Reputation: 2778Reputation: 2778Reputation: 2778
^ fwiw i read recently on bbs.archlinux.org that creators of PKGBUILDs are encouraged to use 'install' instead of sudo-copying etc.
i am positive that the install command can achieve what is desired here.
Code:
man install
 
Old 02-15-2019, 06:26 AM   #5
Neyzan
Member
 
Registered: Jul 2010
Location: Athens, Greece
Distribution: Slackware, Arch, Fedora.
Posts: 90

Original Poster
Rep: Reputation: 3
I modified the PKGBUILD based on some other font packages (e.g.the otf-gfs) as shown below. The PKGBUILD now functions when I have the tarball on my system and give the PGKBUILD that particular sha256sum, but when I attempt to download it from my git repo I get a validation error and when I check the sha256sum is different. Any idea how to solve this?

Code:
pkgname=free-metal-fonts
pkgver=0.1
_relver=20190215
pkgrel=1
pkgdesc="This is a collection of rock and metal style free fonts compiled by Neyzan (NeyzanRumi)"
url="https://github.com/NeyzanRumi/Font-Collections/tree/master/Free-Metal-Fonts/"
arch=(any)
license=(SIL OFL v1.1 and GNU GPL v3)
makedepends=('tar')
depends=()

source=("https://github.com/NeyzanRumi/Font-Collections/tree/master/Free-Metal-Fonts/free-metal-fonts-20190215.tar.gz")
sha256sums=('ecf9f2f2b1eb3e16ff5cf966d1177fd21dc3eeb9bc3aefac8206ecfe6f460231')

package() {
  cd "$srcdir"
  tar -xvf free-metal-fonts-20190215.tar.gz
  sudo install -Dm755 $srcdir/free-metal-fonts-20190215/*otf /usr/share/fonts/
  sudo install -Dm755 $srcdir/free-metal-fonts-20190215/*ttf /usr/share/fonts/
  sudo install -Dm755 $srcdir/free-metal-fonts-20190215/*TTF /usr/share/fonts/
  sudo install -d /usr/share/licenses/$pkgname/
  sudo install -Dm755 $srcdir/free-metal-fonts-20190215/OFL /usr/share/licenses/$pkgname
  sudo install -Dm755 $srcdir/free-metal-fonts-20190215/COPYING /usr/share/licenses/$pkgname
  sudo install -Dm755 $srcdir/free-metal-fonts-20190215/README.md /usr/share/licenses/$pkgname
  sudo cat /usr/share/licenses/$pkgname/README.md
}
 
Old 02-16-2019, 06:17 AM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 11,044
Blog Entries: 7

Rep: Reputation: 2778Reputation: 2778Reputation: 2778Reputation: 2778Reputation: 2778Reputation: 2778Reputation: 2778Reputation: 2778Reputation: 2778Reputation: 2778Reputation: 2778
Quote:
Originally Posted by Neyzan View Post
but when I attempt to download it from my git repo I get a validation error and when I check the sha256sum is different. Any idea how to solve this?
AUR PKGBUILDS for *-git packages usually use 'SKIP' for the repo's checksum.
 
  


Reply

Tags
arch linux, package, pacman


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Announcing Amigo-PkgBuild-0.3 gnashley Amigo 2 02-15-2009 04:13 PM
A question for gnashley about PkgBuild Cpoc Slackware 3 10-12-2006 04:37 PM
PkgBuild & src2pkg upgrade gnashley Slackware 5 09-23-2006 03:31 AM
PkgBuild-0.9 is released with new features. gnashley Slackware 6 06-26-2006 12:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Arch

All times are GMT -5. The time now is 09:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration