You are not logged in.
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
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.
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
(A works at time B) && (time C > time B ) ≠ (A works at time C)
Offline
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
If this is compiling something, you should set the arch to arch=('i686' 'x86_64').
Offline
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.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
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