You are not logged in.

#1 2011-10-07 05:47:36

zkeng
Member
Registered: 2009-12-08
Posts: 12

[SOLVED]openstudio is a new AUR package, requesting review of PKGBUILD

Hi,

I have been working on a simple desktop environment for Arch Linux, called OpenStudio.se . This is the first time I have made a PKGBUILD and it would be great if anyone with some more experience could help me verify that the PKGBUILD is correct. I have tested it on both x86_64 and x86 systems and it works well and the package installs correctly with pacman.

If you want to check out the desktop environment, visit www.openstudio.se

BR
Mikael


Here is my PKGBUILD :

 
# Maintainer: Mikael Nordvall <mikael@openstudio.se>
pkgname=openstudio
pkgver=0.4
pkgrel=1
pkgdesc="Scripts to install and configure a simple, lightweight desktop environment for Arch Linux"
arch=(any)
url="http://www.openstudio.se/de/"
license=('GPL3')
source=(http://www.openstudio.se/de/source/$pkgname.tar.gz)
md5sums=('dc085cf28b74a541833a680603fa85be') #generate with 'makepkg -g'

package() {
  mkdir $pkgdir/etc
  mkdir $pkgdir/etc/openstudio
  mkdir $pkgdir/usr
  mkdir $pkgdir/usr/bin
  mkdir $pkgdir/usr/share
  mkdir $pkgdir/usr/share/man
  mkdir $pkgdir/usr/share/man/man1
  cp -r $srcdir/$pkgname $pkgdir/usr/share/
  cd $pkgdir/usr/share/$pkgname/
  cp ./scripts/openstudio $pkgdir/usr/bin/
  cp ./library/manpage/openstudio.1.gz $pkgdir/usr/share/man/man1/
}

Last edited by zkeng (2011-10-09 10:27:25)

Offline

#2 2011-10-08 16:03:30

Stefan Husmann
Member
From: Germany
Registered: 2007-08-07
Posts: 1,391

Re: [SOLVED]openstudio is a new AUR package, requesting review of PKGBUILD

We prefer the install command over the cp command in PKGBUILDs.

Using this, the PKGBUILD could be shorter.

# Maintainer: Mikael Nordvall <mikael@openstudio.se>
pkgname=openstudio
pkgver=0.4
pkgrel=1
pkgdesc="Scripts to install and configure a simple, lightweight desktop environment for Arch Linux"
arch=(any)
url="http://www.openstudio.se/de/"
license=('GPL3')
source=(http://www.openstudio.se/de/source/$pkgname.tar.gz)
md5sums=('4f9dec211a1b082d91251fa0e73810db')

package() {
  install -d $pkgdir/etc/openstudio
  install -d $pkgdir/usr/share
  cp -r $srcdir/$pkgname $pkgdir/usr/share/
  cd $pkgdir/usr/share/$pkgname/
  install -Dm755 ./scripts/$pkgname $pkgdir/usr/bin/$pkgname
  install -Dm644 ./library/manpage/$pkgname.1.gz \
    $pkgdir/usr/share/man/man1/$pkgname.1.gz
}

What is the purpose of the empty directory under /etc? Namcap would complain about it.

The md5sum has changed. smile

Offline

#3 2011-10-08 18:03:48

zkeng
Member
Registered: 2009-12-08
Posts: 12

Re: [SOLVED]openstudio is a new AUR package, requesting review of PKGBUILD

Thank you very much for the input Stefan. I will update the PKGBUILD according to your suggestions.

About the empty dir /etc/openstudio
The openstudio package contains a system configure script. When executed this script will set-up some global config files (shared for all users) in this dir. The reason why I created it already during installation is because I do want it to be removed if you decide to remove the openstudio package. The reason why it is empty at the beginning is because I do not want to over-write its content when openstudio package is upgraded.
Maybe there is another standard way of solving this kind of issue, but to avoid the error you mentioned about an empty dir I made sure an info file is copied to the dir during install.

New PKGBUILD (with new md5sum) :

# Maintainer: Mikael Nordvall <mikael@openstudio.se>
pkgname=openstudio
pkgver=0.4
pkgrel=1
pkgdesc="Scripts to install and configure a simple, lightweight desktop environment for Arch Linux"
arch=(any)
url="http://www.openstudio.se/de/"
license=('GPL3')
source=(http://www.openstudio.se/de/source/$pkgname.tar.gz)
md5sums=('4f9dec211a1b082d91251fa0e73810db') #generate with 'makepkg -g'

package() {
  install -d $pkgdir/usr/share
  cp -r $srcdir/$pkgname $pkgdir/usr/share/
  cd $pkgdir/usr/share/$pkgname/
  install -Dm755 ./scripts/$pkgname $pkgdir/usr/bin/$pkgname
  install -Dm644 ./library/config/readme_etc_$pkgname \
    $pkgdir/etc/$pkgname/readme_etc_$pkgname
  install -Dm644 ./library/manpage/$pkgname.1.gz \
    $pkgdir/usr/share/man/man1/$pkgname.1.gz
}

Last edited by zkeng (2011-10-08 18:48:59)

Offline

Board footer

Powered by FluxBB