merge trellis branch to trunk.
[util-vserver-pl.git] / Makefile.am
1 ## $Id$
2
3 # Copyright (C) 2003,2004,2005,2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
4 #  
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2, or (at your option)
8 # any later version.
9 #  
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #  
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 #  
19
20 python_vserverimpl_la_SOURCES = python/vserverimpl.c src/planetlab.c src/netns.c
21 python_vserverimpl_la_LIBADD =  -lvserver
22 python_vserverimpl_la_CFLAGS =  -Wno-redundant-decls -I$(top_srcdir)/src $(PYTHON_INCLUDES)
23 python_vserverimpl_la_LDFLAGS = -module -avoid-version
24
25 src_vip6_autod_SOURCES =        src/vip6-autod.c
26 src_vip6_autod_LDADD =          -lvserver -lnl
27
28 src_vsh_SOURCES =               src/vsh.c
29
30 noinst_HEADERS =                src/planetlab.h
31
32 man_MANS =                      man/vsh.8
33
34 pyexec_LTLIBRARIES =            python/vserverimpl.la
35
36 pyexec_DATA =                   python/vserver.py \
37                                 python/bwlimit.py \
38                                 python/cpulimit.py
39
40 sbin_SCRIPTS =                  python/bwlimit \
41                                 python/disklimit \
42                                 scripts/vuseradd \
43                                 scripts/vuserdel
44
45 sbin_PROGRAMS =                 src/vsh 
46
47 sysv_SCRIPTS =                  
48
49 if ENSC_HAVE_LIBNL
50 sbin_PROGRAMS +=                src/vip6-autod
51 sysv_SCRIPTS +=                 sysv/vip6-autod
52 endif
53
54 crondir =                       $(sysconfdir)/cron.d
55
56 logrotatedir =                  $(sysconfdir)/logrotate.d
57
58 install-data-hook: install-fix-script-paths
59
60 fix_SCRPTS =                    $(addprefix $(sbindir)/,  $(notdir $(sbin_SCRIPTS))) \
61                                 $(addprefix $(sysvdir)/,  $(notdir $(sysv_SCRIPTS)))
62
63 install-fix-script-paths:
64         test "$(UV_PKGLIBDIR)" = "/usr/lib/util-vserver" || \
65         for i in $(fix_SCRPTS); do \
66                 f="$(DESTDIR)$$i"; \
67                 $(SED) -e 's!/usr/lib/util-vserver!$(UV_PKGLIBDIR)!g' "$$f" > "$$f.tmp"; \
68                 cmp -s "$$f.tmp" "$$f" || cat "$$f.tmp" > "$$f"; \
69                 rm -f "$$f.tmp"; \
70         done