You are not logged in.

#1 2025-12-06 10:09:58

conn-fused
Member
Registered: 2011-06-19
Posts: 30

PKGBUILD using Maven for Mytourbook: Help requested!

Hi all,

I'm trying to make a PKGBUILD file for mytourbook as the version in the AUR (https://aur.archlinux.org/packages/mytourbook_bin) is well out of date.

The source is only available on github now, so the old binary method won't work. It looks like I need to use Maven to build the source.

Here's my PKGBUILD so far:

#  Maintainer: conn-fused
_pkgname=mytourbook
pkgname=${_pkgname}-git
pkgver=25.8.0
pkgrel=1
pkgdesc="MyTourbook from git"
arch=('x86_64')
url="https://github.com/mytourbook/${_pkgname}"
source=("git+https://github.com/mytourbook/${_pkgname}")

conflicts=('mytourbook_bin')
provides=("mytourbook=${pkgver}")

pkgver() {
  cd "$_pkgname"
  git describe --long --abbrev=7 | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

package() {
	cd "$_pkgname"
	mvn install
}

Now I try:

makepkg --skipchecksums

Sadly, this fails to complete.

[ERROR] Error executing Maven.
[ERROR] java.nio.file.AccessDeniedException: /root/.m2/repository/org/eclipse/tycho/extras/tycho-pomless
[ERROR] Caused by: /root/.m2/repository/org/eclipse/tycho/extras/tycho-pomless
==> ERROR: A failure occurred in package().
    Aborting...

It looks like something is trying to write to /root instead of to ~ ... but I can't figure out how to correct it and I'm already a bit out of my depth here! Is there anyone out there with some knowledge of PKGBUILDs and Maven? Your help is greatly appreciated!

Last edited by conn-fused (2025-12-06 10:12:52)

Offline

#2 2025-12-06 11:56:26

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,565

Re: PKGBUILD using Maven for Mytourbook: Help requested!

Wiki doesn't have guidelines for packages using maven, and the closest thing to sourcebuild instructions seems to be

Build the product is automated with maven/tycho, the build process for a new version needs still some manual adjustments which are documented in
https://github.com/mytourbook/mytourboo … -build.txt


Your best bet is probably to adapt the mytourbook_bin package to switch to github releases , see https://github.com/mytourbook/mytourbook/releases/


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#3 2025-12-06 15:19:31

twelveeighty
Member
Registered: 2011-09-04
Posts: 1,420

Re: PKGBUILD using Maven for Mytourbook: Help requested!

Probably quickest way to get your package to build is to look at/steal from other packages that use Maven during the build process. For example epubcheck from [Extra]. I think the crucial step is to set maven.repo.local environment variable:

build() {
  local maven_options=(
    clean
    package
    -D maven.test.skip=true  # tests fail on trying to use deprecated features
    -D maven.repo.local="./"
  )

  cd $pkgname-$pkgver
  mvn "${maven_options[@]}"

...
}

Offline

#4 2025-12-07 10:15:00

conn-fused
Member
Registered: 2011-06-19
Posts: 30

Re: PKGBUILD using Maven for Mytourbook: Help requested!

Your best bet is probably to adapt the mytourbook_bin package to switch to github releases , see https://github.com/mytourbook/mytourbook/releases/

This worked! Thank you.

For anyone else who might find this useful, the PKGBUILD is:

pkgname=mytourbook_bin
pkgver=25.11.0
pkgrel=1
pkgdesc="A tool to visualize and analyze tours recorded by a GPS device, ergometer, bike- or exercise computer."
arch=('x86_64')
url="http://mytourbook.sourceforge.net"
license=("GPL")
depends=('java-runtime>=11' 'fontconfig' 'libxrender')
install="mytourbook.install"
source=("mytourbook.desktop" "https://github.com/mytourbook/mytourbook/releases/download/25.11.0_2025-11-09_0609/mytourbook-25.11.0-linux.x86.tar.gz")
options=(!strip)
sha256sums=('84607b0ae8313aaf4e466ff41a8c6d7d32d5fb4b1609463d99084b0c13d3036a'
	    '1ef70931f276dfb818b70932c085a3623eab2e610b1824a75ef967554807ed44')

package() {
  mkdir -p ${pkgdir}/usr/{bin,share/mytourbook}
  cd ${srcdir}/mytourbook
  tar cf - --exclude=.PKGINFO * | ( cd ${pkgdir}/usr/share/mytourbook; tar xfp -)
  find ${pkgdir}/usr/share/mytourbook -type f -print0 | xargs -0 chmod 644
  chmod 755 ${pkgdir}/usr/share/mytourbook/mytourbook
  ln -s /usr/share/mytourbook/mytourbook ${pkgdir}/usr/bin/mytourbook

  install -D -m644 icon.xpm $pkgdir/usr/share/pixmaps/mytourbook.xpm
  install -D -m644 $srcdir/mytourbook.desktop $pkgdir/usr/share/applications/mytourbook.desktop
}

Offline

Board footer

Powered by FluxBB