You are not logged in.

#1 2014-03-30 20:04:07

aureianimus
Member
Registered: 2014-03-30
Posts: 4

First PKGBUILD review (syncany)

I tried to adhere to all the conventions and rules, but I'm not sure if I missed anything. namcap told me that java-runtime was not necessary, but that I did need java-environment and sh. Any feedback?
PKGBUILD:

# 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 "$@"

Last edited by aureianimus (2014-03-30 20:05:06)

Offline

#2 2014-03-30 20:41:45

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: First PKGBUILD review (syncany)

I don't understand why namcap thinks you need java-environment and not just java-runtime. It may be an error, but I am not familiar with syncany so I can't tell. "sh" is technically a requirement to run the included shell script so I would leave it.

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.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#3 2014-03-31 15:36:42

aureianimus
Member
Registered: 2014-03-30
Posts: 4

Re: First PKGBUILD review (syncany)

Thank you for your feedback. The quotes-stuff is a clear mishap on my part, I corrected that. I also removed the sy shortcut. For the Arch audience it's not really necessary to include that.

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?

Last edited by aureianimus (2014-03-31 19:19:16)

Offline

#4 2014-03-31 23:02:38

Jristz
Member
From: America/Santiago
Registered: 2011-06-11
Posts: 1,022

Re: First PKGBUILD review (syncany)

My recommendations:
*Try use Descriptive and short descriptions.... we not want another "Virus" (KDE) as for a description for only good know what is

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 .... ....


Well, I suppose that this is somekind of signature, no?

Offline

#5 2014-04-01 09:21:06

aureianimus
Member
Registered: 2014-03-30
Posts: 4

Re: First PKGBUILD review (syncany)

I lengthened the description to "Cloud storage and filesharing application with a focus on security and abstraction of storage."

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.

Offline

#6 2014-04-01 13:14:31

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: First PKGBUILD review (syncany)

aureianimus wrote:

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. smile


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#7 2014-04-01 19:28:39

aureianimus
Member
Registered: 2014-03-30
Posts: 4

Re: First PKGBUILD review (syncany)

Mmmm. Now you say that. I guess I was thrown off by the partial parsing. Thanks for the help everyone:)

Offline

Board footer

Powered by FluxBB