You are not logged in.

#1 2015-12-27 20:27:26

crmullins
Member
Registered: 2014-04-08
Posts: 27

PKGBUILD request: Lightscreen screenshot software

Hi all,

Thanks in advance, this is my first PKGBUILD.  Lightscreen is some software I added to the Taking a Screenshot wiki page , it's super useful for taking screenshots and uploading them to imgur.  Figured I'd make one of these and maintain the package so it's easier for others to use.  Please let me know what can be improved.

# Maintainer: Chris <christopher.r.mullins g-mail>
# Contributors: Christian Kaiser <ckaiser github> (original author)

pkgname=Lightscreen
pkgver=2.0
pkgrel=1
pkgdesc='Simple tool to automate the tedious process of saving and cataloging screenshots'
arch=('i686' 'x86_64')
url='lightscreen.com.ar'
depends=('qt4')
makedepends=('qt4')
license=('GPL2')

source=("https://github.com/ckaiser/Lightscreen/archive/v2.0.tar.gz")
sha512sums=('b2ce92eb1f09ef447d407ea64c9b5658223230bf91def1327acebd83e343aa94385d7b1c48dcb8ae0be90bf6eb8133d4781e7cb5f5b5934f017af8ffa1133112')
build() {
  cd "$pkgname-$pkgver"
  qmake-qt4
  make
}

package() {
  install -d "$pkgdir/usr/local/bin"
  install -D -m755 "$pkgname-$pkgver/lightscreen" "$pkgdir/usr/local/bin/"
}

Some specific questions:

1) Should I list the author as a contributor?  I'm planning to reach out, but he isn't involved in packaging for Arch so far. But it seems dishonest not to have him on here anywhere.

2) namcap tells me that package names aren't supposed to have capital letters, but if I don't capitalize it then the command

 cd "$pkgname-$pkgver" 

doesn't work.  Seems like I'm missing something simple, but atm all I've got is either capitalizing "Lightscreen" or changing that command to hardcode "Lightscreen" which might not be best practice.

3) Is there a way to combine the two lines in the "package" method into one? 

4) Is /usr/local/bin the best place for the executable to live?  namcap says it's nonstandard but the Creating packages wiki page page says

A lot of software installs files relative to the /usr/local directory, which should only be done if you are manually building from source.

which we are.

Thanks!

Last edited by crmullins (2015-12-27 20:56:24)

Offline

#2 2015-12-27 21:20:04

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,540

Re: PKGBUILD request: Lightscreen screenshot software

You've already identified most of the problems with your questions, so let's start there.
1) Generally no. This is about the PKGBUILD, not the software itself.
2) namcap is right, the pkgname needs changed. The only reason to not simply hard code the names later on is if the name would change or you want to reuse the code. I don't see either one happening.
3) The first line isn't necessary since you're using the -D option.
4) You misunderstood the wiki page. Packages should never touch /usr/local, that's reserved for the user.

Other observations:

'lightscreen.com.ar' isn't a URL, it's only part of one.

runtime deps are always installed at build time as well, so there's no need to include qt4 in the makedepends.

License is wrong from what I can see. They specify "either version 2 of the License, or (at your option) any later version". This makes it 'GPL'.

The source array isn't using $pkgver. This means that each time you update the PKGBUILD, you need to change it in two places. Not a good situation.

The source file should be renamed, as it's really generic. You could get conflicts with other packages that download "v2.0.tar.gz". The PKGBUILD man page has information about how to do this (I'm sure the wiki does, too, but I haven't checked).

Offline

#3 2015-12-27 22:15:06

crmullins
Member
Registered: 2014-04-08
Posts: 27

Re: PKGBUILD request: Lightscreen screenshot software

Thanks for the tips Scimmia!  Here's the revised:

# Maintainer: Chris <christopher.r.mullins g-mail>

pkgname=lightscreen
pkgver=2.0
pkgrel=1
pkgdesc='Simple tool to automate the tedious process of saving and cataloging screenshots'
arch=('i686' 'x86_64')
url='http://lightscreen.com.ar/'
depends=('qt4')
license=('GPL')
source=("lightscreen-2.0::https://github.com/ckaiser/Lightscreen/archive/v$pkgver.tar.gz")
sha512sums=('b2ce92eb1f09ef447d407ea64c9b5658223230bf91def1327acebd83e343aa94385d7b1c48dcb8ae0be90bf6eb8133d4781e7cb5f5b5934f017af8ffa1133112')

build() {
  cd "Lightscreen-$pkgver"
  qmake-qt4
  make
}

package() {
  install -D -m755 "Lightscreen-$pkgver/lightscreen" "$pkgdir/usr/bin/lightscreen"
}

Offline

#4 2015-12-27 22:34:41

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,540

Re: PKGBUILD request: Lightscreen screenshot software

Better. Only think I see is that you're hardcoding the version in the source filename, and you're leaving off the extensions.

Offline

#5 2015-12-27 23:36:30

crmullins
Member
Registered: 2014-04-08
Posts: 27

Re: PKGBUILD request: Lightscreen screenshot software

Excellent, thanks again for the help.

Fixed and submitted to the AUR.

Offline

Board footer

Powered by FluxBB