You are not logged in.

#1 2006-04-13 16:17:05

necui
Member
Registered: 2006-04-13
Posts: 4
Website

My new Leafnode package - problems.

Hi, I've created a new package for Leafnode.

PKGBUILD:

# Contributor: Rafal Jedruszek <necui@nic-nac-project.de>
pkgname=leafnode
pkgver=1.11.5
pkgrel=12
pkgdesc="Easy to use IPv6-capable NNTP news proxy for Unix/Linux systems."
url="http://leafnode.sourceforge.net/"
license="custom"
depends=('pcre')
makedepends=()
conflicts=()
replaces=()
backup=('etc/xinetd.d/leafnode')
install=('leafnode.install')
source=("http://www.dt.e-technik.uni-dortmund.de/~ma/leafnode/$pkgname-$pkgver.tar.bz2" 'leafnode.xinetd')
md5sums=('88552c5cc91cb27146c8906b2d33289d' '5638ec88cd16a62144b2ce0859200402')

build() {
  cd $startdir/src/$pkgname-$pkgver
  ./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc/leafnode --with-lockfile=/var/lock/leafnode/fetchnews.lck
  make || return 1
  make DESTDIR=$startdir/pkg install
  mkdir -p $startdir/pkg/var/lock/leafnode
  mkdir -p $startdir/pkg/usr/share/licenses/leafnode
  install -m644 $startdir/src/$pkgname-$pkgver/COPYING $startdir/pkg/usr/share/licenses/leafnode/
  # xinetd
  mkdir -p $startdir/pkg/etc/xinetd.d
  install -m644 $startdir/src/leafnode.xinetd $startdir/pkg/etc/xinetd.d/leafnode
}

leafnode.install:

post_install() {
  groupadd -g 36 news &>/dev/null
  useradd -c "Leafnode News Server" -d /var/spool/news -s /bin/false -g news -u 36 news &>/dev/null
  chown news:news /var/spool/news
  echo "--------------------------Leafnode--------------------------"
  echo "NOTE:"
  echo "You should copy /etc/leafnode/config.example to"
  echo "/etc/leafnode/config and edit it to your own needs."
  echo "------------------------------------------------------------"
}

pre_remove() {
  userdel news &>/dev/null
  groupdel news &>/dev/null
  echo "--------------------------Leafnode--------------------------"
  echo "NOTE:"
  echo "If /var/spool/news is not empty it won't be deleted."
  echo "------------------------------------------------------------"
}

op=$1
shift

$op "$@"

leafnode.xinetd

service nntp
{
        socket_type             = stream
        wait                    = no
        user                    = news
        server                  = /usr/sbin/leafnode
        only_from               = 127.0.0.1
}

All comments are welcome.

I have some problems too: well,  basically everything works fine, but leafnode needs to have new user and group created.

What's more: it is chowning a directory during "make install".  So, while making a package I see a warning:
chown: `news:news': invalid user
It is only a warning, so for now I use:

chown news:news /var/spool/news

in post_install().

Leafnode's installation should place some subdirectories in /var/spool/news, but this directory is empty after installing the package.  It is probably not a big deal though, because Leafnode creates those subdirectories during first run.

I tried to pass arguments to ./configure script which changed the default user and group to "36" both.  While making the package there were no warnings; while installing, the subdiretories where properly created with good permissions.  But Leafnode coulnd't start, because it tried to look for user named "36" in /etc/passwd.

So, what should I do?  I see three choices:
- leave it as it is now (well, it works)
- make a patch for leafnode to make it search for userid not for username in /etc/passwd (ugly solution)
- make a patch for makefile, so "make install" will create subdirectories with 36:36, but leafnode will be compiled with news:news (even more ugly solution)

Do you have some ideas?


Second case: is it ok to create a new user and group with id 36?  I grepped the /var/abs directory and no other package uses this id.  But maybe there are some restrictions which number should I use?

Third case: Should I place the license in /usr/share/licenses/ or is this mechanism still not stable?

Offline

Board footer

Powered by FluxBB