You are not logged in.

#1 2019-08-13 14:09:02

ahirapatel
Member
Registered: 2019-08-13
Posts: 3

[SOLVED] PKGBUILD review request (paho-mqtt-cpp)

I had need of paho-mqtt-cpp but only saw a PKGBUILD for paho-mqtt-c, so I made this one. I never made one before, so comments are appreciated.

The paho-mqtt-c PKGBUILD is slightly out of date, so making that PKGBUILD will fail unless you remove 533.patch. I posted a comment on the AUR page for it.

# Maintainer: Hiral Patel <ahirapatel at gmail dot com>
_bpn=paho-mqtt-cpp
pkgname=${_bpn}-git
pkgver=1.0.1.r47.g7fe0c26
pkgrel=1
pkgdesc="A C++ wrapper around paho-mqtt-c"
arch=(any)
url="https://github.com/eclipse/paho.mqtt.cpp"
license=('EPL')
groups=()
depends=(paho-mqtt-c)
makedepends=(git)
provides=(${_bpn})
conflicts=(${_bpn})
replaces=()
backup=()
options=()
install=
source=("git+https://github.com/eclipse/paho.mqtt.cpp.git")
md5sums=('SKIP')

pkgver() {
  cd "$srcdir/paho.mqtt.cpp"
  git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd "$srcdir/paho.mqtt.cpp"
  cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=/usr/lib .
  make
}

package() {
  cd "$srcdir/paho.mqtt.cpp"
  make DESTDIR="$pkgdir/" install
}

Last edited by ahirapatel (2019-08-13 16:41:03)

Offline

#2 2019-08-13 15:04:39

loqs
Member
Registered: 2014-03-06
Posts: 8,789

Re: [SOLVED] PKGBUILD review request (paho-mqtt-cpp)

Welcome to the arch linux forums ahirapatel.

arch=(any)

The package contains shared objects which are architecture dependent so can not be any.  paho-mqtt-c also has this issue.

groups=()

Empty entries can be removed.

source=("$_bpn::git+https://github.com/eclipse/paho.mqtt.cpp.git")

would allow you to use cd $_bpn

Out of tree builds are generally preferred to in tree builds.

prepare() {
  mkdir -p build
}
build() {
  cd build
  cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=/usr/lib ../$_bpn
  make
}

The shared objects provided by the package depend upon libs from gcc-libs but it is not a listed dependency.  paho-mqtt-c also has this issue although with different libs.

Offline

#3 2019-08-13 15:45:50

ahirapatel
Member
Registered: 2019-08-13
Posts: 3

Re: [SOLVED] PKGBUILD review request (paho-mqtt-cpp)

Thanks for the help! I appreciate it.

I've made the changes you suggested and the changed PKGBUILD is below:

# Maintainer: Hiral Patel <ahirapatel at gmail dot com>
_bpn=paho-mqtt-cpp
pkgname=${_bpn}-git
pkgver=1.0.1.r47.g7fe0c26
pkgrel=1
pkgdesc="A C++ wrapper around paho-mqtt-c"
arch=('x86_64')
url="https://github.com/eclipse/paho.mqtt.cpp"
license=('EPL')
depends=(paho-mqtt-c gcc-libs openssl)
makedepends=(git)
provides=(${_bpn})
conflicts=(${_bpn})
install=
source=("$_bpn::git+https://github.com/eclipse/paho.mqtt.cpp.git")
md5sums=('SKIP')

pkgver() {
	cd $_bpn
	git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
	mkdir -p build
}

build() {
	cd build
	cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=/usr/lib ../$_bpn
	make
}

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

Offline

#4 2019-08-13 15:55:58

loqs
Member
Registered: 2014-03-06
Posts: 8,789

Re: [SOLVED] PKGBUILD review request (paho-mqtt-cpp)

I forgot to mention a missing makedepends on cmake
The install line can be removed and the rest looks fine to me.

Offline

#5 2019-08-13 16:40:02

ahirapatel
Member
Registered: 2019-08-13
Posts: 3

Re: [SOLVED] PKGBUILD review request (paho-mqtt-cpp)

Alright, awesome, thanks!

Offline

Board footer

Powered by FluxBB