You are not logged in.

#1 2012-10-30 18:41:41

aganders3
Member
Registered: 2010-04-06
Posts: 8

First PKGBUILD - looking for review

Hello all,

I have created my first PKGBUILD for some new scientific computing libraries and corresponding examples related to my field. I am looking for input before submitting this to the authors for inclusion on their site (and possibly to the AUR if there ends up being more interest).

Anyway, here is what I have so far, which seems to work on my system:

PKGBUILD:

pkgname=ismrmrd-git
pkgver=20121030
pkgrel=1
pkgdesc="Libraries and examples for the proposed ISMRM Raw Data format"
url="http://ismrmrd.sourceforge.net"
arch=('any')
license=('unknown')
depends=('hdf5-fortran-cxx'
         'boost-libs'
         'xsd'
         'xerces-c')
optdepends=('fftw: used to compile example programs'
            'doxygen: only needed if you want to produce your own copy of the documentation')
makedepends=('unzip'
             'git'
             'cmake')

# install="${pkgname}.install"
# source=("http://www.syntax-on.com/static/$pkgname/$pkgname-$pkgver.tar.gz")
# source=("http://downloads.sourceforge.net/project/ismrmrd/src/${pkgname}_${pkgver}.zip")
source=("cmakelists.diff")
noextract=("${pkgname}_${pkgver}.zip")

md5sums=("9ec7ed899e488961826fa41da7109a84")

_gitroot="git://git.code.sf.net/p/ismrmrd/code"
_gitname="ismrmrd"

build() {
  cd "${srcdir}"
  # unzip ${pkgname}_${pkgver}.zip -d ${pkgname}-${pkgver}

  msg "Connecting to GIT server..."
  if [ -d $_gitname ] ; then
    cd $_gitname && git pull origin
    msg "Local files have been updated"
  else
    git clone $_gitroot "${srcdir}/$_gitname"
  fi

  msg "Received code from GIT or server timed out"

  # stop CMakeLists.txt appending an unwanted dir to the CMAKE_INSTALL_PREFIX
  # also prevent install of /usr/cmake/FindIsmrmrd.cmake 
  msg "Patching CMakeLists.txt to comply with Arch Packaging Standards..."
  cd "${srcdir}/${_gitname}"
  patch < ${startdir}/cmakelists.diff --forward

  # start the build
  mkdir "${srcdir}/${_gitname}/build" -p
  cd "${srcdir}/${_gitname}/build"
  msg "Starting cmake..."
  cmake -DCMAKE_INSTALL_PREFIX=/usr ../
  msg "Starting make..."
  make
}

package() {
  cd "${srcdir}/${_gitname}/build"
  make DESTDIR="${pkgdir}/" install
}

cmakelists.diff

--- src/ismrmrd-latest/CMakeLists.txt	2012-10-30 11:48:03.332945241 -0500
+++ src/ismrmrd-latest/CMakeLists_mod.txt	2012-10-30 11:48:27.619612710 -0500
@@ -10,7 +10,7 @@
 endif (WIN32)
 
 
-set(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/ismrmrd)
+# set(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/ismrmrd)
 list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
 
 find_package(XSD REQUIRED)
@@ -69,7 +69,7 @@
 
 INSTALL(FILES ismrmrd.h ${XSDS_SOURCES} ismrmrd_hdf5.h ismrmrd_hdf5_datatypes.h ismrmrd_export.h DESTINATION include)
 INSTALL(FILES schema/ismrmrd.xsd DESTINATION schema)
-INSTALL(FILES cmake/FindIsmrmrd.cmake DESTINATION cmake)
+# INSTALL(FILES cmake/FindIsmrmrd.cmake DESTINATION cmake)
 INSTALL(TARGETS ismrmrd DESTINATION lib)
 INSTALL(TARGETS ismrmrd_xsd DESTINATION lib)

I'm not using any .install file, is this something big I am missing? Again, this is my first time writing a PKGBUILD, so I appreciate any feedback. Thanks!

Offline

#2 2012-10-31 15:30:16

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 4,141

Re: First PKGBUILD - looking for review

license=('unknown') is weird, but i checked the sourcecode and there is indeed no mention of any license.

I suggest you try to contact the 3 devs about the license.


Booting with apg Openrc, NOT systemd.
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

#3 2012-10-31 16:07:21

aganders3
Member
Registered: 2010-04-06
Posts: 8

Re: First PKGBUILD - looking for review

Thanks, I plan to contact them about it before offering this for distribution. The other code they are working on (which depends on this library) is actually public domain, so I sort of expect this code to be the same.

Offline

#4 2012-11-07 09:19:24

sudokode
Member
Registered: 2010-06-27
Posts: 5

Re: First PKGBUILD - looking for review

If this is compiling something, you should set the arch to arch=('i686' 'x86_64').

Offline

#5 2012-11-07 12:06:36

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

Re: First PKGBUILD - looking for review

While it is in the commented out (non-git) version of the code, for future reference, you should not try to uncompress a source tarball yourself in a PKGBUILD.  Makepkg does that for you.  You also don't need any decompression tools in the makedepends array as these are part of base-devel which is required/assumed before one can build packages from the AUR.


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

Offline

#6 2012-11-07 20:14:02

aganders3
Member
Registered: 2010-04-06
Posts: 8

Re: First PKGBUILD - looking for review

Thanks - I will take note for future packages, or if I end up using a non-git version. makepkg seemed to not be able to handle the zip file itself, though. If I re-hosted the source myself in a tarball it worked, but on the authors' site I could only find it as a zip.

My main question is still about installation location, though. This typically installs itself in:

/usr/local/ismrmrd/bin
/usr/local/ismrmrd/lib
/usr/local/ismrmrd/include
/usr/local/ismrmrd/schema
/usr/local/ismrmrd/cmake

I was able to change this to:

/usr/bin
/usr/lib
/usr/include
/usr/schema

Obviously this prevents cmake/FindIsmrmrd.cmake from being installed at all (not sure this is OK or desirable), It also creates the /usr/schema directory, which I don't think is really standard. Where should I put such files? Should I instead install the whole package into /usr/opt/ismrmrd? It doesn't seem big enough to warrant that, but I don't know where else to put the schema and cmake directories and the associated files. Maybe in /usr/share?

Last edited by aganders3 (2012-11-07 20:20:40)

Offline

Board footer

Powered by FluxBB