You are not logged in.
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
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'
...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! )
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
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)
Offline
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
Pacman will remove anything it installed
Offline