You are not logged in.

#1 2015-11-18 20:38:20

tuxflo
Member
Registered: 2015-07-29
Posts: 6

First PKGBUILD for Document Management System EcoDMS

Hey guys! I'm trying to build an PKGBUILD for the EcoDMS Client Software. The Developers only provide a .deb package so I tried to copy the teamviewer PKGBUILD, because it is a famous .deb package I know. Here is my code so far:
PKGBUILD:

# Maintainer: tuxflo

pkgname=ecodmsclient
pkgver=14.08.11
pkgrel=1
pkgdesc="Document Management Software"
arch=('i686' 'x86_64')
url="http://www.ecodms.de/index.php/de/"
license=('custom')
depends=('bash')
options=('!strip')
install=${pkgname}.install

if [[ $CARCH == 'i686' ]]; then
  source=("ecodmsclient-${pkgver}_i386.deb::http://www.ecodms.de/ecodms_140832/trusty/ecodmsclient-14.08-11_i386.deb")
  md5sums=('e4c55f2e451d7de0c6afb16008a58fce')
elif [[ $CARCH == 'x86_64' ]]; then
  source=("ecodmsclient-${pkgver}_amd64.deb::http://www.ecodms.de/ecodms_140864/trusty/ecodmsclient-14.08-11_amd64.deb")
  md5sums=('568084420989e9882c496beaba894362')
fi

build() {
  cd "${srcdir}"
  tar -xf data.tar.xz
}

package() {
  cd "${srcdir}"

# Install
  cp -dr --no-preserve=ownership {etc,opt,usr} "${pkgdir}"/
}

ecodmsclient.install:

post_install() {
  echo "Execute /opt/ecodms/ecodmsclient/ecodmsconmgr.sh to connect to the server"
}

post_upgrade() {
  post_install
}

post_remove() {
  rm -rf /opt/ecodms/ecodmsclient
}
# vim: ts=2 sw=2 et:

I just want to know if there are problems with the PKGBUILD and if its ok to install the package to /opt. And maybe someone could try the package to see if there are dependencies which I already had installed.

Thanks for helping!

Offline

#2 2015-11-18 22:22:58

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,223
Website

Re: First PKGBUILD for Document Management System EcoDMS

  cp -dr --no-preserve=ownership {etc,opt,usr} "${pkgdir}"/

I know this came from the teamviewer PKGBUILD, but I have no idea why someone would write that as {etc,opt,usr} -- bash will just expand that to 'etc opt usr' so for clarity I would remove the expansion and just write 'etc opt usr'

tuxflo wrote:

...and if its ok to install the package to /opt.

For binary packages like this that do their own magic things I see no problem, although you should put them in /opt/$pkgname/{etc,opt,usr}     (this is where the above bash expansion is useful! wink)

Offline

#3 2015-11-18 22:30:59

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

Re: First PKGBUILD for Document Management System EcoDMS

The whole "if $CARCH" block is obsolete. Pacman now supports architecture specific variables. See the PKGBUILD man page.

'cd "${srcdir}"' at the beginning of a function isn't necessary. All functions are now guaranteed to start there.

Personally, I would just extract the archive directly to $pkgdir in the package function using tar/bsdtar's '-C' option . Get rid of the build function all together.

Namcap will help you find dependencies you missed. It doesn't work well with scripts, though.

Having to change the pkgver in 3 different places is a recipe for problems.

What's with the rm -rf in post_remove?

Last edited by Scimmia (2015-11-18 22:31:30)

Online

#4 2015-11-19 10:27:46

tuxflo
Member
Registered: 2015-07-29
Posts: 6

Re: First PKGBUILD for Document Management System EcoDMS

Thanks for the help! I'll update the PKGBUILD with your suggestions when I've got some time.
@Scimmia the rm -fr in post_remove should delete the installed files on remove. Is there another (better) way to do that?

Offline

#5 2015-11-19 15:17:08

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

Re: First PKGBUILD for Document Management System EcoDMS

Pacman will remove anything it installed

Online

Board footer

Powered by FluxBB