I submitted this to AUR (https://aur.archlinux.org/packages/syncany/), and the link to the source on the webpage is off in a weird way. It displays the underscore-to-dash substitution partly, which leads to a wrong link. What is the proper way to resolve that?
Don't expect AUR to parse and evaluate bash.
]]>Does anyone have a proper solution for the substition/url issue I mentioned in my last post? Other packages with this problem seem to define their own variable for this and use that in the source-url, so if no one knows a better solution, I'll implement that.
]]>well apart of that look ok.
Quotes and test the programm after submitting will help
Perosonally I prefer use #!/usr/bin/sh for prevent breakages if some user is enough foolish to try delete the simlink in /bin, /sbin, /usr/sbin .... ....
]]>EDIT:
I submitted this to AUR (https://aur.archlinux.org/packages/syncany/), and the link to the source on the webpage is off in a weird way. It displays the underscore-to-dash substitution partly, which leads to a wrong link. What is the proper way to resolve that?
]]>You should always quote $srcdir and $pkgdir to prevent word expansion on paths with spaces. In general, any variable with a value that you do not explicitly control should be quoted. I consider it a good habit to quote all variables by default.
You should set explicit permission when using the install command, e.g.
for foo in lib/*
do
install -Dm644 "$foo" "$pkgdir/usr/share/java/$pkgname/$foo"
done
The symlink at the end of the package function should not refer to $pkgdir, which will not exist after the package is built. It should be an absolute path to /usr/bin/syncany. That assumes that "sy" should be included at all. If the user requires a shortcut to "syncany" then the user can create an alias for the command.
]]># Maintainer: Pim Otte <otte dot pim at gmail dot com>
pkgname=syncany
pkgver=0.1.0_alpha
pkgrel=1
pkgdesc="Cloud storage and filesharing application"
arch=(any)
url="http://http://www.syncany.org/"
license=('GPL2')
depends=('java-environment>=7' 'sh')
source=(http://syncany.org/dist/$pkgname-${pkgver//_/-}.tar.gz
syncany)
sha256sums=('731a09a50d0838bf7ae939b0adc3493e9a837fb40c5642a94a85c11172cccf2c'
'c8492da21054f29ed09e5016502199457042c9af4d5a31d2a18622f2b15892b0')
package() {
install -D syncany ${pkgdir}/usr/bin/syncany
cd "$srcdir/$pkgname-${pkgver//_/-}"
install -d ${pkgdir}/usr/share/java/${pkgname}
install lib/* ${pkgdir}/usr/share/java/${pkgname}
ln -s ${pkgdir}/usr/bin/syncany ${pkgdir}/usr/bin/sy
}
syncany:
#!/bin/sh
for name in /usr/share/java/syncany/*.jar ; do
CP=$CP:$name
done
"$JAVA_HOME/bin/java" -cp $CP org.syncany.Syncany "$@"