Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 59589 - [new app] ebuild for opennap-ng-0.47
Summary: [new app] ebuild for opennap-ng-0.47
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High enhancement (vote)
Assignee: Gentoo net-p2p team
URL: http://opennap-ng.sourceforge.net/
Whiteboard:
Keywords: EBUILD
Depends on:
Blocks:
 
Reported: 2004-08-06 00:55 UTC by Lars Wendler (Polynomial-C) (RETIRED)
Modified: 2005-09-26 03:30 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
opennap-ng-0.47.ebuild (opennap-ng-0.47.ebuild,2.22 KB, text/plain)
2004-08-06 00:57 UTC, Lars Wendler (Polynomial-C) (RETIRED)
Details
opennap init-skript (opennap,1.11 KB, text/plain)
2004-08-06 00:59 UTC, Lars Wendler (Polynomial-C) (RETIRED)
Details
updated opennap-ng-0.47.ebuild (opennap-ng-0.47.ebuild,2.58 KB, text/plain)
2004-08-06 04:01 UTC, Lars Wendler (Polynomial-C) (RETIRED)
Details
updated opennap init-skript (opennap,1.01 KB, text/plain)
2004-08-06 04:05 UTC, Lars Wendler (Polynomial-C) (RETIRED)
Details
opennap-ng-0.47.ebuild with use_enable (opennap-ng-0.47.ebuild,2.47 KB, text/plain)
2004-08-06 10:34 UTC, Lars Wendler (Polynomial-C) (RETIRED)
Details
opennap-ng-0.47.ebuild with use_enable (opennap-ng-0.47.ebuild,2.47 KB, text/plain)
2004-08-06 10:34 UTC, Lars Wendler (Polynomial-C) (RETIRED)
Details
updated opennap-0.47.ebuild to use autogen.sh (opennap-ng-0.47.ebuild,2.73 KB, text/plain)
2004-08-10 08:41 UTC, Lars Wendler (Polynomial-C) (RETIRED)
Details
new ebuild (opennap-0.47.2.ebuild) (opennap-ng-0.47.2.ebuild,3.46 KB, text/plain)
2004-08-13 18:35 UTC, Lars Wendler (Polynomial-C) (RETIRED)
Details
new init-skript (opennap-2,1.02 KB, text/plain)
2004-08-13 18:45 UTC, Lars Wendler (Polynomial-C) (RETIRED)
Details
updated opennap-0.47.2.ebuild (opennap-ng-0.47.2.ebuild,3.69 KB, text/plain)
2004-08-20 15:58 UTC, Lars Wendler (Polynomial-C) (RETIRED)
Details
reworked init-skript (opennap.initd,2.27 KB, text/plain)
2004-08-20 16:02 UTC, Lars Wendler (Polynomial-C) (RETIRED)
Details
this is the config file for the init-skript (opennap.confd,597 bytes, text/plain)
2004-08-20 16:05 UTC, Lars Wendler (Polynomial-C) (RETIRED)
Details
reworked init-skript (opennap.initd,2.28 KB, text/plain)
2004-08-20 16:23 UTC, Lars Wendler (Polynomial-C) (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2004-08-06 00:55:03 UTC
Hi,

please find attached the ebuild for opennap-ng-0.47

Sidenote: As the binary itself is named opennap (without -ng) I always mean opennap-ng when I speak from opennap here.

opennap is an open source server (completely written in ANSI C) which speaks the napster protocol. It's distributed under the GNU GPL-2.
Clients for this server are net-p2p/teknap net-p2p/lopster net-p2p/xnap net-p2p/knapster2 (WinMX and Audignome under Windows) and some more I don't know atm :)

I had to introduce some package specific use-flags to have all configure-flags switchable:
chroot noinvalidclients noinvalidnicks nologchan nonroot resume router
Besides them there are also these two known use-flags:
debug zlib
I use nonroot to drop root-privileges of opennap after start and zilb for client<->server data compression (supported only by lopster afaik).
For the other flags please have a look at the homepage of opennap-ng.

To run opennap you also have to start nscd or opennap cannot link to other opennap server. This is already taken into account by the init-skript I made.

TODO:
- make the init-skript handle opennap in a chroot correct (I didn't test chroot up to now but I think this has to be changed)
- verify if opennap-ng compiles under gcc-3.4 (can't do that atm. Have to wait till emerge -e world is finished)
- give feeeedback. Would be nice to get some information about how you gentoo-folks like this :)

Poly

Reproducible: Always
Steps to Reproduce:
Comment 1 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2004-08-06 00:57:30 UTC
Created attachment 36867 [details]
opennap-ng-0.47.ebuild

I'm suggesting net-p2p as cathegory
Comment 2 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2004-08-06 00:59:08 UTC
Created attachment 36868 [details]
opennap init-skript

This is taken from sysklogd and should be put into ${FILESDIR} when you emerge
opennap-ng

Poly
Comment 3 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2004-08-06 04:01:10 UTC
Created attachment 36880 [details]
updated opennap-ng-0.47.ebuild

okay,

- removed --sysconfdir=/etc/opennap-ng from econf as the config-dir is
--datadir=/usr/share/opennap-ng
- reworked installation of the docs
- change ownership of config-dir to opennap:opennap when built with use-flag
nonroot enabled
- moved some einfos from src_install() to pkg_postinst()
Comment 4 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2004-08-06 04:05:11 UTC
Created attachment 36881 [details]
updated opennap init-skript

- removed hack for getting a pid
- start-stop-daemon now uses pidfile /usr/share/opennap-ng/pid
Comment 5 tklauser 2004-08-06 05:12:31 UTC
I think you should use the function 'use_enable' instead of

use xx && myconf="${myconf} --enable-xx"

inside of src_compile.

This is more standard in my opinion.
Comment 6 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2004-08-06 10:34:03 UTC
Created attachment 36906 [details]
opennap-ng-0.47.ebuild with use_enable

Hi,

alright I changed src_compile() a little bit but there are still five flags
configured the old way as I don't know if there exists a use_disable and
use_without

Poly
Comment 7 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2004-08-06 10:34:47 UTC
Created attachment 36907 [details]
opennap-ng-0.47.ebuild with use_enable

Hi,

alright I changed src_compile() a little bit but there are still five flags
configured the old way as I don't know if there exists a use_disable and
use_without

Poly
Comment 8 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2004-08-06 18:55:36 UTC
Hi,

opennap-ng also compiles and runs without problems under gcc-3.4.1-r2

# emerge --info
Portage 2.0.50-r9 (gcc34-x86-2004.2, gcc-3.4.1, glibc-2.3.4.20040619-r1, 2.6.8-rc2)
=================================================================
System uname: 2.6.8-rc2 i686 AMD Athlon(TM) XP 2000+
Gentoo Base System version 1.5.2
Autoconf: sys-devel/autoconf-2.59-r4
Automake: sys-devel/automake-1.8.5-r1
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -march=athlon-xp -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/X11/gdm /etc/env.d /etc/gconf /etc/gnome /etc/gnome-vfs-2.0 /etc/init.d /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -march=athlon-xp -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox userpriv usersandbox"
GENTOO_MIRRORS="ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo ftp://linux.rz.ruhr-uni-bochum.de/gentoo-mirror/ ftp://ftp.tu-clausthal.de/pub/linux/gentoo/ http://gentoo.oregonstate.edu http://www.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://192.168.0.254/gentoo-portage"
USE="3dnow X acl acpi alsa apm avi berkdb cdr crypt cups dvd dvdr encode foomaticdb gdbm gif gtk gtk2 imlib jpeg kde libg++ libwww linguas_de mad mikmod mmx motif mozilla mpeg ncurses nls nptl oggvorbis opengl oss pam pdflib perl png python qt quicktime readline samba sdl slang spell sse ssl svga tcltk tiff truetype x86 xml xml2 xmms xv xvid zlib"
Comment 9 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2004-08-10 08:41:18 UTC
Created attachment 37151 [details]
updated opennap-0.47.ebuild to use autogen.sh

Just a slight change:

- added src_unpack()
- change autogen.sh not invoking configure itself
- invoke autogen.sh in src_unpack()

Poly
Comment 10 Jon Hood (RETIRED) gentoo-dev 2004-08-11 10:21:56 UTC
opennap is a net-p2p network, so we'll take care of this one ;)
As for the ebuild, it may be better to use enewuser to create the user you're wanting. I would also prefer that root privileges not be enabled by default- the nonroot USE flag is not necessary, and it would be prefered to have the server run as a user.
Comment 11 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2004-08-13 18:35:50 UTC
Created attachment 37393 [details]
new ebuild (opennap-0.47.2.ebuild)

Hi,

Tobias I reverted your suggestions using use_enable as it has side-effects on
how opennap is configured. For instance I have -router in use-fags and I emerge
opennap that uses 'use_enable router' then this would result in
--disable-router as configure-flag. Unfortunately the configure skript of
opennap treats this like --enable-router. I was really amazed when suddently
nobody was able to connect to my server because of lack of authority (only
Admins/Elite may connect to a router-enabled server).

Jon I changed the ebuild to set up opennap-ng running as user opennap by
default. I removed use-flag nonroot and added use-flag asroot so if anybody
wants to run opennap as root one can do so.

The last days I talked to one of the devs of opennap-ng to divide the config
dir into a config dir for files opennap may change (/var/db/opennap-ng) and one
opennap may not change (/etc/opennap-ng). Currently files opennap may alter
are: users (userdb), bans, opennap-ng.pid (formerly pid) and channels. The
files opennap may not alter are: config, motd and servers
Also the pid-file was renamed from pid to opennap-ng.pid and is now also stored
in /var/db/opennap-ng/. I would prefer /var/run/ as directory but when opennap
doesn't run as root, it won't be able to store the file there.

I'm now testing the changed version of opennap and when it comes out to be
stable it will be released as opennap-ng-0.47.2 in the not far away future.
The attached ebuild is created for 0.47.2 and won't work with previous versions
of opennap except if you remove the lines containing --sysconfdir and
--localstatedir below econf.


(TODO) There's still much stuff to do on this ebuild:

- implement chroot into the ebuild. At the moment I have no idea how to invoke
./configure --enable-chroot correctly to make opennap running chrooted. I'm
sure that one who enables chroot in use-flags won't get the server running for
now. This also means that the init-skript for opennap should take account of
running opennap chrooted or not. Maybe this could be solved as in the
net-misc/dhcp package. As a result I deactivated use-flag chroot for now.

- use enewuser for creating the user/group for opennap as Jon Hood suggested.
Can anyone give me some useful links or some documentaion about enewuser? I
searched in the ebuild-howto but couldn't find anything about this. Are there
some ebuilds I could take a look at to understand how enewuser works?

I will try to make these things work but the next two weeks I'll only be at
home during the weekends.

Poly
Comment 12 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2004-08-13 18:45:13 UTC
Created attachment 37394 [details]
new init-skript

This is the init-skript appropriate for opennap-ng-0.47.2

The only change is the location and name of opennap's pidfile

Poly

P.S.: This also needs some cleanup. I must have been some kind of loopy using
the init-skript of sysklogd for opennap (but it was the first one that came me
to mind) :-)
Comment 13 Jon Hood (RETIRED) gentoo-dev 2004-08-13 18:50:26 UTC
Any app that has to run as root could have potential security problems. I would very much prefer the user not even have the ability to run the program as root. It's ok, we have plenty of time to work on this, and this is a large ebuild so it may take a while to get everything just right. Frankly, I don't like the asroot/nonroot USE flags- we can avoid them. Look at some ebuilds that use the enewuser command:
$ cd /usr/portage/ && grep -r enewuser *
to see how to use enewuser.
All .pid files should be in /var/run/ but the program itself should be able to run with only user privileges. Check out how the start-stop-daemon works (you may need a file in /etc/conf.d) for different users. This will allow us to avoid having the package "die" if the user does not exist. The chgrp'ing and the chmod'ing should also be done automagically by the ebuild without user intervention.

Yes, I know, I'm picky on ebuilds, and if you are completely stumped on something and need help, feel free to hit me up on IRC or AIM- you've done a very good job so far, and this is a harder package to make an ebuild for than most.
Comment 14 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2004-08-15 11:09:07 UTC
Hi,

opennap-ng-0.47.2 is now officially released @ sourceforge.
Beside the above mentioned changes it also contains a new configure-flag to disable server-side cration of a pidfile (i.e. usuable when staring opennap with start-stop-deamon as user).
I'll give a new ebuild with enewuser a try while I'm away. Next ebuild will hopefully be available next Friday/Saturday.

Poly
Comment 15 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2004-08-20 15:58:06 UTC
Created attachment 37825 [details]
updated opennap-0.47.2.ebuild

Hi,

please find attached a new ebuild for opennap-ng-0.47.2 with the following
changes:

-got rid of nonroot/asroot. opennap will run as user/group opennap
-added enewgroup/enewuser (yes I finally did it Jon ;)
-some trials in implementing chroot (still deactivated. I have to set up a
seperate opennap-server before I will test this)
Comment 16 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2004-08-20 16:02:10 UTC
Created attachment 37826 [details]
reworked init-skript

this is derived from net-p2p/mldonkey

-some trials for chroot (not in use for now)
-hopefully better pidfile handling
-this skript needs /etc/conf.d/opennap
Comment 17 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2004-08-20 16:05:52 UTC
Created attachment 37827 [details]
this is the config file for the init-skript

derived from net-p2p/mldonkey

For now one should only change the NICE variable if desired.

Poly
Comment 18 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2004-08-20 16:23:16 UTC
Created attachment 37828 [details]
reworked init-skript

Hi,

this time with svc_stop/svc_start in restart()

Poly
Comment 19 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2004-10-31 06:02:53 UTC
Hi,

I've put the current working ebuild for opennap-ng on my homepage. You can find it here:
http://polynomial-c.homelinux.net/pub/gentoo/portage/net-p2p/opennap-ng

changes are quite minor to the last ebuild posted here and I didn't work on making opennap running chrooted.

I need testers. This ebuild works well for me but I wanna hear comments from others.

Poly
Comment 20 Marcin Kryczek (RETIRED) gentoo-dev 2005-09-26 03:30:25 UTC
this problem seems to be dead and upstream developer doesn't respond on emails. 
sorry, but closing