You are not logged in.
So I went to put a forum on a website I was working on and what better forum engine to use than the very same one bbs uses... and then I realize there's no PKGBUILD in ABS or AUR for fluxbb, so I decided to make a simple one. Please keep in mind this is my first so be gentle.
Also, let me know if you think it should be more interactive: for example /srv/http is not everyone's base webserver directory and people may want to change the name of "/upload" to something more fitting like "/forums".
# Contributor: DefunctProcess <blazercist@gmail.com>
pkgname=fluxbb
pkgver=1.2.22
pkgrel=1
pkgdesc="The forum engine that archlinux.org uses."
arch=('i686' 'x86_64')
url="fluxbb.org"
license=('GPL')
groups=()
depends=()
makedepends=()
optdepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=
source=(http://fluxbb.org/download/releases/$pkgver/$pkgname-$pkgver.tar.gz)
noextract=()
md5sums=('6fac6a426be6c263abe545e3656e5493')
build() {
cd "$srcdir/$pkgname-$pkgver"
#Modifying permissions of subdirectories in upload
chmod 777 upload/cache || echo "Error: you must manually chmod 777 /upload/cache"
chmod 777 upload/img/avatars || echo "Error: you must manually chmod 777 /upload/img/avatars"
#Creating install path
mkdir -p \
"$pkgdir/srv/http/upload" \ || return 1
#Copying...
cp -R $srcdir/$pkgname-$pkgver/upload $pkgdir/srv/http/
}Last edited by blazercist (2010-04-08 04:42:27)
Offline
You should put the PKGBUILD in code-blocks ![]()
Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.
Offline
ngoonee, done and done ![]()
Offline
Here we go...
1) get rid of all empty values. e.g. conflicts=()
2) I'm sure it has some dependencies....
3) I would copy the files to PKGDEST and then adjust the permissions. And just error out instead of the message.
4) as you noted /srv/http/upload seems a strange path. /srv/http/fluxbb perhaps?
Offline
IMHO....
# Contributor: DefunctProcess <blazercist@gmail.com>You are the Maintainer, not a past contributor ![]()
source=(http://fluxbb.org/download/releases/$pkgver/$pkgname-$pkgver.tar.gz)Double quote the URL.... If nothing else, it improves readability when using an editor with syntax highlighting.
chmod 777 upload/cache || echo "Error: you must manually chmod 777 /upload/cache"
chmod 777 upload/img/avatars || echo "Error: you must manually chmod 777 /upload/img/avatars"1) Change the echo to 'return 1' like you've done in other places. Let the chmod error message give feedback to the user.
2) chmod 777 is BAD. chown and/or chgrp and chmod g+w the directories to '33' (http) instead.
mkdir -p \
"$pkgdir/srv/http/upload" \ || return 1Don't bother wrapping lines like this.
Just my HO, otherwise quite good for a first PKGBUILD ![]()
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
/srv should not be included into the PKGBUILD.
Package should not contain following directories:
* /dev
* /home
* /srv
* /media
* /mnt
* /proc
* /root
* /selinux
* /sys
* /tmp
* /var/tmp
He could move everything to /opt, and then add a message printed through .install file that would give instructions for manual moving to /srv.
Offline
/srv should not be included into the PKGBUILD.
...
He could move everything to /opt, and then add a message printed through .install file that would give instructions for manual moving to /srv.
I'd prefer /usr/share/fluxbb to /opt/fluxbb.
Offline
Right, never install anything to /srv; it's like /home for services. For such arch independent apps you have to install it into /usr/share. But the software itself shouldn't alter any files there (like the upload dir). Put those into /var.
Most web apps cannot be packaged correctly which is the reason why we don't provide any. I would recommend to use your own vcs like git for managing your web apps.
Offline
Just to let you guys know (in case you didn't already) this isn't a binary, its just a collection of .php files that need to go into the base directory of your webserver. So for lighttpd its /srv/http/ and for apache its /var/www/ I think... that's why I'm installing to /srv/http/. This is also why I suggested the install should be more interactive (allowing the user to specify their directory of choice and renaming "upload" to something more appropriate). Also, the reason for chmod 777 is because when I manually installed on my machine those two directories had the wrong permissions and when I went to complete the install by going to www.mywebsite.com/upload/install.php it explicitly suggested that I chmod 777 those two directories.
Perhaps I should do as flamelab says and just install to some arbitrary directory and echo instructions with the .install script, but then the PKGBUILD loses some of its automation. So I'm torn as to what to do.
Fukawi2, thanks for the advice, I'll clean things up.
Ok, so I'm going to submit the script to AUR soon, I'm going to wait a few hours for any last minute objections/suggestions.
Offline
Yes, I think everyone was assuming it was just some php files, not a binary. You should still not install anything to /srv. Users should be free to write/edit anything under that directory. Install to /usr/share/whatever and tell users how to copy to/link from /srv/whatever.
And despite what the php scripts tell you, finding some solution that doesn't require the directories to be world-writeable will be much more secure than making them 777.
Last edited by Profjim (2010-04-08 17:43:47)
Offline