You are not logged in.

#1 2016-03-16 15:33:59

conbon
Member
Registered: 2016-03-16
Posts: 2

Pretty Quick R, PKGBUILD for review

Hi all,

I took a stab at creating my first PKGBUILD for a variant of R called Pretty Quick R.
I am open to suggestions for improvement.

I looked at the r-devel package to use as a model, but that package installs to /usr/local, which I understood was against the AUR guidelines. I, therefore, opted to install this to /opt, but am not sure if that is the best way to go about this.
Thanks in advance for your feedback.

Cheers

Pkgbuild:

# Maintainer: Conor Anderson <conor[dot]anderson[at]utoronto.ca>
pkgname=pqr
_pkgver="2015-09-14"
pkgver=${_pkgver//-/}
pkgrel=1
pkgdesc="a pretty quick version of R"
arch=('i686' 'x86_64')
url="http://www.pqr-project.org/"
license=('GPL')
depends=('blas' 'lapack' 'bzip2'  'libpng' 'libjpeg' 'libtiff'
         'ncurses' 'pcre' 'readline' 'zlib' 'perl' 'gcc-libs'
         'libxt' 'libxmu' 'pango' 'xz' 'desktop-file-utils' 'zip' 'unzip')
makedepends=('gcc-fortran')
optdepends=('tk: tcl/tk interface' 'texlive-bin: latex sty files')
options=('!makeflags' '!emptydirs')
install=$pkgname.install
source=("http://www.pqr-project.org/pqR-${_pkgver}.tar.gz"
	'pqr.desktop'
	'pqr.png')
md5sums=('5f1f65f3c71f2f27c33c2901417bcbfe'
         '543264e50f64a1c5bdf1465e3961b188'
         '8a535cb19598efcf31a5e757b6d74217')

build() {
  cd "pqR-${_pkgver}"
  ./configure --prefix=/opt/pqr --enable-R-shlib
  make
}

package() {
  cd "pqR-${_pkgver}"

  make DESTDIR="${pkgdir}/" install

  # install some freedesktop.org compatibility (borrowed form r-devel)
  install -Dm644 "${srcdir}/pqr.desktop" \
	"${pkgdir}/usr/share/applications/pqr.desktop"
  install -Dm644 "${srcdir}/pqr.png" \
	"${pkgdir}/opt/pqr/pqr.png"
}

Install:

post_install() {
    echo "pqR has been installed to /opt/pqr"
    echo "to use with RStudio set your environment variables like: export RSTUDIO_WHICH_R='/opt/pqr/bin/R'"
}

Last edited by conbon (2016-03-16 16:11:13)

Offline

#2 2016-03-16 15:50:59

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

Re: Pretty Quick R, PKGBUILD for review

You're installing the desktop file to /usr/local. Don't do that.

Right now on upgrade, you have to change the version in 4 places. This isn't idea. I would set a variable "_pkgver=2015-09-14", then set "pkgver=${_pkgver//-/}. You can then use the _pkgver variable when you "cd" and in the source array. This keeps the version number in only one place.

Why are you printing that message on every upgrade? It seems to be printing it on install is sufficient.

You shouldn't put "pqR - " in the pkgdesc. We already know it's pqr, it's in the pkgname.

I doubt "arch=(any)" is correct. If the end package has any architecture specific binaries, it's not.

Get rid of empty arrays, (groups=()).

You sometimes have variables in braces and sometimes don't. This should be consistent.

Last edited by Scimmia (2016-03-16 15:52:11)

Online

#3 2016-03-16 16:12:01

conbon
Member
Registered: 2016-03-16
Posts: 2

Re: Pretty Quick R, PKGBUILD for review

Thanks Scimmia, I've edited the OP to include the changes as per your feedback.

Offline

Board footer

Powered by FluxBB