Disable vip6-autod if the configure script didn't detect a usable libnl.
Remove util-vserver-pl.spec.in, sync the version with configure.ac.
scripts/vuseradd \
scripts/vuserdel
-#sbin_PROGRAMS = src/vip6-autod \
-# src/vsh
sbin_PROGRAMS = src/vsh
-
-#sysv_SCRIPTS = sysv/vip6-autod
sysv_SCRIPTS =
+if ENSC_HAVE_LIBNL
+sbin_PROGRAMS += src/vip6-autod
+sysv_SCRIPTS += sysv/vip6-autod
+endif
+
crondir = $(sysconfdir)/cron.d
logrotatedir = $(sysconfdir)/logrotate.d
dnl
AC_PREREQ(2.57)
-AC_INIT(util-vserver-pl, 0.1, support@planet-lab.org)
+AC_INIT(util-vserver-pl, 0.3.1, support@planet-lab.org)
AC_CONFIG_SRCDIR([python/vserverimpl.c])
AC_CONFIG_HEADER([config.h])
AC_CANONICAL_HOST
# Checks for programs.
+AC_LANG(C)
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
fi
if test x"$ensc_have_libnl" = xyes; then
- AC_CHECK_LIB(nl, nl_handle_alloc_cb, [ : ],
- [ ensc_have_libnl=no ])
+ AC_CHECK_LIB(nl, nl_handle_alloc_cb, [
+ AC_DEFINE(HAVE_LIBNL_1_1, [],
+ [Define this to use the libnl 1.1 API])],
+ [AC_CHECK_LIB(nl, nlmsg_get_src,
+ [AC_DEFINE(HAVE_LIBNL_1_0, [],
+ [Define this to use the libnl 1.0-pre6 API])],
+ [ensc_have_libnl=no])])
fi
if test x"$ensc_have_libnl" != xyes; then
AC_DEFINE(_FILE_OFFSET_BITS, [64], [Use 64bit interface for filesystem operations])
-AC_CONFIG_FILES([util-vserver-pl.spec Makefile])
+AC_CONFIG_FILES([Makefile])
AC_OUTPUT
#include <asm/types.h>
#include <netlink/netlink.h>
-#include <netlink/handlers.h>
+#if defined(HAVE_LIBNL_1_1)
+# include <netlink/handlers.h>
+#elif defined(HAVE_LIBNL_1_0)
+# define rtnl_addr_put rtnl_addr_free
+#endif
#include <netlink/route/addr.h>
#include <vserver.h>
openlog("vip6-autod", LOG_PERROR, LOG_DAEMON);
+#if defined(HAVE_LIBNL_1_1)
cbs = nl_cb_alloc(NL_CB_VERBOSE);
if (!cbs) {
syslog(LOG_CRIT, "nl_cb_alloc: %s", strerror(errno));
exit(1);
}
+#elif defined(HAVE_LIBNL_1_0)
+ handle = nl_handle_alloc_nondefault(NL_CB_VERBOSE);
+ cbs = nl_handle_get_cb(handle);
+#endif
nl_cb_set(cbs, NL_CB_VALID, NL_CB_CUSTOM, handle_valid_msg, &map);
nl_cb_set(cbs, NL_CB_SEQ_CHECK, NL_CB_CUSTOM, handle_no_op, NULL);
nl_cb_err(cbs, NL_CB_CUSTOM, handle_error_msg, &map);
-
+#ifdef HAVE_LIBNL_1_1
handle = nl_handle_alloc_cb(cbs);
+#endif
nl_disable_sequence_check(handle);
nl_join_groups(handle, RTMGRP_IPV6_PREFIX|RTMGRP_IPV6_IFADDR);
%define url $URL$
%define name util-vserver-pl
-%define version 0.3
-%define taglevel 13
+%define version 0.3.1
+%define taglevel 1
%define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
Requires: util-vserver util-vserver-core util-vserver-build util-vserver-sysv
Provides: util-vserver-python = %{version}-%{release}
Obsoletes: util-vserver-py32 resman
+BuildRequires: libnl libnl-devel
+BuildRequires: python python-devel
BuildRequires: util-vserver-core util-vserver-devel
BuildRequires: autoconf automake libtool
/bin/vsh
%{_mandir}/man8/vsh.8*
-#%{_sbindir}/vip6-autod
-#%{_sysconfdir}/init.d/vip6-autod
+%{_sbindir}/vip6-autod
+%{_sysconfdir}/init.d/vip6-autod
%changelog
* Wed Sep 17 2008 Faiyaz Ahmed <faiyaza@cs.princeton.edu> - util-vserver-pl-0.3-13
+++ /dev/null
-%define name util-vserver-pl
-%define version @VERSION@
-%define release 1%{?pldistro:.%{pldistro}}%{?date:.%{date}}
-
-%define python_sitearch %( python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)" )
-
-Summary: PlanetLab extensions to util-vserver
-Name: %{name}
-Version: %{version}
-Release: %{release}
-License: GPL
-Group: System Environment/Base
-Source0: %{name}-%{version}.tar.bz2
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
-Requires: util-vserver util-vserver-core util-vserver-build util-vserver-sysv
-Provides: util-vserver-python = %{version}-%{release}
-Obsoletes: util-vserver-py32 resman
-BuildRequires: util-vserver-core util-vserver-devel
-BuildRequires: autoconf automake libtool
-
-%description
-This package contains all PlanetLab extensions to util-vserver.
-
-%prep
-%setup -q
-autoreconf -fi
-
-
-%build
-%configure
-make
-
-
-%install
-rm -fr %{buildroot}
-make DESTDIR=%{buildroot} install
-
-mkdir %{buildroot}/bin
-ln -s ..%{_sbindir}/vsh %{buildroot}/bin/vsh
-
-rm -f %{buildroot}%{python_sitearch}/vserverimpl.a
-rm -f %{buildroot}%{python_sitearch}/vserverimpl.la
-
-# Generate file list for python package
-find "%{buildroot}" -name '*.py' | { while read FILE; do
- f="${FILE#%{buildroot}}"
- echo "${f}"
- # need to touch these files, as they are not produced on FC4 or below
- touch ${FILE}c
- touch ${FILE}o
- echo %%ghost "${f}c"
- echo %%ghost "${f}o"
-done } > %name-python.list
-
-
-%post
-# add /bin/vsh to list of secure shells
-if [ ! -f /etc/shells ] || ! grep -q '^/bin/vsh$' /etc/shells ; then
- echo /bin/vsh >> /etc/shells
-fi
-
-
-%postun
-# 0 = erase, 1 = upgrade
-if [ "$1" = 0 ] ; then
- perl -i -n -e 'next if /^\/bin\/vsh$/; print' /etc/shells
-fi
-
-
-%clean
-rm -fr %{buildroot}
-
-
-%files -f %name-python.list
-%defattr(-,root,root,-)
-%{_sbindir}/bwlimit
-%{_sbindir}/disklimit
-%{_sbindir}/vuseradd
-%{_sbindir}/vuserdel
-%{python_sitearch}/vserverimpl.so
-
-%{_sbindir}/vsh
-/bin/vsh
-%{_mandir}/man8/vsh.8*
-
-%{_sbindir}/vip6-autod
-%{_sysconfdir}/init.d/vip6-autod
-
-%{_sbindir}/vcached
-%{_sysconfdir}/cron.d/vcached.cron
-%{_sysconfdir}/logrotate.d/vcached.logrotate
-
-
-%changelog
-* Fri Nov 30 2007 Daniel Hokka Zakrisson <daniel@hozac.com> - 0.1-1
-- Initial release