You are not logged in.
Hi to everyone:
Could anyone package this?: http://netdisco.org/
Netdisco is an Open Source web-based network management tool first released publically in 2003. The target users are large corporate and university networks administrators. Data is collected into a Postgres database using SNMP and presented with a clean web interface using Mason.
Configuration information and connection data for network devices are retrieved via SNMP. Data is stored using a SQL database for scalability and speed. Layer-2 topology protocols such as CDP and LLDP provide automatic discovery of the network topology.
A lot of thanks.
Offline
I'll give it a go and post back with my results.
Offline
Alright a lot of files need some configuration changes for it to conform to the arch linux standard, so can someone suggest a way to replace all occurances of /usr/local with /usr using some command line tool? I imagine sed does the trick, I'm just really not familiar with sed.
Offline
sed -i -e "s#/usr/local#/usr#g" whatever_files
Last edited by lucke (2009-12-17 17:17:50)
Offline
So far, this is what I have, am stopping work on it for today, but thought I'd post my results so far.
# Contributor: Niadh ( neilmunro_AT_gmail_DOT_com
pkgname=netdisco
pkgver=1.0
pkgrel=1
pkgdesc="Netdisco: I just packaged it, I dunno what it really does :P"
url="http://netdisco.org/"
arch=('i686')
license=('custom')
depends=('net-snmp' 'apache' 'mod_perl' 'postgresql')
makedepends=('pacpan')
provides=('netdisco')
conflicts=('netdisco')
source=('http://downloads.sourceforge.net/project/netdisco/netdisco/1.0/netdisco-1.0.tar.gz?use_mirror=switch')
md5sums=('bbb9cd2dbf487a3c106456eb67a10b6a')
build() {
cd $srcdir/$pkgname-$pkgver || return 1
## Install perl-html-mason
echo "Installing required perl modules... "
pacpan HTML::Mason
./build_cpan
echo "Done."
_LOCAL="/usr/local"
_USR="/usr"
## Do all the /usr/local /usr changes here
echo "Patching sources... "
echo ": sql/pg"
sed -i 's/$_LOCAL/$_USR/g' sql/pg ||return 1
echo ": bin/netdisco_daemon"
sed -i 's/$_LOCAL/$_USR/g' bin/netdisco_daemon || return 1
echo ": netdisco.conf"
sed -i 's/$_LOCAL/$_USR/g' netdisco.conf || return 1
echo ": netdisco_apache.conf"
sed -i 's/$_LOCAL/$_USR/g' netdisco_apache.conf || return 1
echo ": netdisco_apache_dir.conf"
sed -i 's/$_LOCAL/$_USR/g' netdisco_apache_dir.conf || return 1
echo "Done!"
## Actually get on with installing the package
mkdir $srcdir/usr #|| return 1
mkdir $srcdir/usr/$pkgname/ #|| return 1
mv $srcdir/$pkgname-$pkgver/* $srcdir/usr/$pkgname || return 1
useradd -d $srcdir/usr/netdisco netdisco || return 1
chown -R netdisco.netdisco /usr/netdisco || return 1
## Restart various services
#/etc/rc.d/httpd restart || return 1
#/etc/rc.d/postgresql restart || return 1
}
Offline
So far, this is what I have, am stopping work on it for today, but thought I'd post my results so far.
Fantastic, Niadh. You are the man!
Thanks for your hard and excellent work. I await to be the first tester of this package
Thank you so much.
Offline
Well, it's not exactally an easy application to package, many steps (particularly relating to database setup) is likely to have to be completed manually by yourself after install.
Offline
There actually an issue with this line
" useradd -d $srcdir/usr/netdisco netdisco || return 1"
It doesn't seem to work from within the pkgbuild file, can someone show me where I might be going wrong?
Offline
niadh - you need to read man PKGBUILD and the package-making howtos in the wiki. You could also look at existing PKGBUILDs for guidance, either in the official SVN repo or in the AUR.
Some things to fix:
- pkgdesc
- remove provides/conflicts
- use correct source URL
- create separate package for HTML::Mason and add it to depends= for netdisco
- write a patch for all the path changes, instead of multiple seds (optional, but cleaner)
- use $pkgdir, or you'll end up with an empty package (did you actually run makepkg on this?)
- use correct install path i,e, not /usr/netdisco
- use an install script for any actions that affect the install target system. This includes user creation and ownership/permission changes
- NEVER restart other application daemons from within a PKGBUILD or an install script (commented out, yes, but should never have been there at all)
Again, please read the docs before replying to any of this. Enthusiasm is always appreciated, but you're not helping the OP with that attempt. At the very least, run makepkg on your own PKGBUILD before posting it.
Offline
Thanks for the reply, I appreciate the feedback however a few things, I do have the wiki pages open on an almost perminant basis to try and understand what I'm doing.
The pkgdesc I know will need fixing, however since the package build is technically the most important bit I thought I'd get the core program to build before tidying up things like that, however I should have made clear it was simply a placeholder from the word go, my bad.
The provides/conflicts I shall have to look into, i will remove them, I'm just curious as to why.
Some example pkgbuild files I have looked at didn't have a full source url in the url field, so I assumed it was the project homepage, if not I will change this, thanks for letting me know about that one.
I had considered making a new package for HTML::Mason, just have not thought of the best way to do that yet, I figured since these would at best both end up in the aur, well, I wasn't sure how to make HTML::Mason a dep through it all without requiring the user to use an aur helper of some kind.
I'll do the patch thing, as soon as I can, I can't believe I didn't think to do that before.
Yup I ran makepkg -s on it, as you imply it didn't work, it's why I posted for some help. Which I will again point out I appreciate, I know how text based discussions can be taken the wrong way and I'd hate to be misunderstood.
Got it, the .install file is seperate from the pkgfile and is the file that directly alters the target system.
I wasn't sure about the restarting of servers, seemed a bit odd, they were there more for my reference as part of the installation instructions, I will remove them and add some message at the end of the installation about manual service restart, after all the install procedure requires a user to set up a database, makes sense they manually set it all up and restart their own services.
I will work on the things you have suggested, however it is (obviously) my first attempt at a pkgbuild, so I do expect to get things wrong and require a bit of correction, I should also add the reason I posted it was for feedback such as you have given, in essence, I defer to your wisdom as far as the pkgbuild goes, you caught lots of stupid mistakes I was making which I can quickly sort out before the pkgbuild became too much of a mess
Thanks for the pointers, I shall continue to work on it and post progress, though i wont claim it's ever finished unless I put it in the aur, that way hopefully no-one will run it assuming it will install netdisco.
Offline
Sounds good, keep at it. One more thing though - this particular forum is where people ask for packages to be created for them, and I don't think it's unreasonable for them to expect that the resulting PKGBUILD works as expected. Your first PKGBUILD should ideally be for a package that you want, and for an application that you know something about.
If you need help with any PKGBUILDs, the PKGBUILDs & ABS Support board is the place to go.
Offline
Just a quick update, I believe I have a patch for fixing the sources for arch, sorry I've not been able to look at this in the last few days, I've been ill and with the holiday period it's been a bit hectic. I have ran into an issue or two, but am resolving them.
Just thought I'd continue to let you guys know about my progress.
EDIT 1: I have gotten one of the unsupported dependencies to install through a pkgbuild I have written. Which makes managing this pkgbuild and the dependencies easier. Just have to figure out how to get a pkgbuild from the aur to install another aur pkgbuild.
EDIT 2: I have made a lot of progress on this, I can only apologise it's taking so long, but it is my first pkgbuild and I'm trying to do it right from the first attempt, I will continue to edit this post to show progress and post anew once it's complete. I hope it'll be ready soon.
Last edited by niadh (2009-12-30 13:35:50)
Offline