1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in

root/csw/mgar/pkg/tuntap/trunk/Makefile

Revision 19643, 3.3 KB (checked in by dmichelsen, 17 months ago)

WHOLE TREE: Remove default CATEGORIES

Line 
1NAME = tuntap
2VERSION = 1.1
3GARTYPE = v2
4
5DESCRIPTION = TUN and TAP virtual network kernel drivers
6define BLURB
7  TUN (as in network TUNnel) simulates a network layer device and it
8  operates with layer 3 packets such as IP packets.
9  TAP (as in network tap) simulates an Ethernet device and it operates
10  with layer 2 packets such as Ethernet frames. TAP is used
11  to create a network bridge, while TUN is used with routing.
12endef
13
14SPKG_SOURCEURL = http://www.whiteboard.ne.jp/~admin2/tuntap/
15MASTER_SITES = http://www.whiteboard.ne.jp/~admin2/tuntap/source/tuntap/
16# fix Dist
17DISTNAME = tuntap
18DISTFILES = $(DISTNAME).tar.gz
19
20CONFIGURE_ARGS = $(DIRPATHS)
21
22# one Makefile for both packages
23PACKAGES = CSWtun CSWtap
24CATALOGNAME_CSWtun = tun
25SPKG_DESC_CSWtun = tun
26CATALOGNAME_CSWtap = tap
27SPKG_DESC_CSWtap = tap
28# define packagefiles
29PKGFILES_CSWtun  = /usr/kernel/drv/tun
30PKGFILES_CSWtun += /usr/kernel/drv/tun.conf
31PKGFILES_CSWtun += /usr/kernel/drv/sparcv9/tun
32PKGFILES_CSWtun += /usr/kernel/drv/amd64/tun
33PKGFILES_CSWtun += /usr/include/net/if_tun.h
34PKGFILES_CSWtap  = /usr/kernel/drv/tap
35PKGFILES_CSWtap += /usr/kernel/drv/tap.conf
36PKGFILES_CSWtap += /usr/kernel/drv/sparcv9/tap
37PKGFILES_CSWtap += /usr/kernel/drv/amd64/tap
38PKGFILES_CSWtap += /usr/include/net/if_tun.h
39# prototype group sys directories
40PROTOTYPE_FILTER = awk '$$$$3 !~/^\/usr\/include/ && $$$$6 == "bin" { $$$$6 = "sys" } { print }'
41
42# build 64bit modules
43BUILD64 = 1
44
45# no build tests
46SKIPTEST = 1
47
48# we going to use a custom install
49INSTALL_SCRIPTS = custom
50# extra merging files outside /opt/csw..
51EXTRA_MERGE_INCLUDE_FILES  = /usr/kernel/drv/sparcv9/tun
52EXTRA_MERGE_INCLUDE_FILES += /usr/kernel/drv/amd64/tun
53EXTRA_MERGE_INCLUDE_FILES += /usr/kernel/drv/sparcv9/tap
54EXTRA_MERGE_INCLUDE_FILES += /usr/kernel/drv/amd64/tap
55
56# set korrekt module directory
57DRV_CONF_DIR = /usr/kernel/drv
58ifeq ($(ISA),sparcv9)
59        DRV_DIR = /usr/kernel/drv/sparcv9
60endif
61ifeq ($(ISA),sparcv8)
62        DRV_DIR = /usr/kernel/drv
63endif
64ifeq ($(ISA),amd64)
65        DRV_DIR = /usr/kernel/drv/amd64
66endif
67ifeq ($(ISA),i386)
68        DRV_DIR = /usr/kernel/drv
69endif
70
71# we will need a postinstall and preremove script
72define CSWtun_postinstall
73#!/bin/sh
74PATH=/usr/bin:/usr/sbin
75rem_drv tun > /dev/null 2>&1
76echo " ==> Loading tun module"
77add_drv tun
78endef
79define CSWtun_preremove
80#!/bin/sh
81PATH=/usr/bin:/usr/sbin
82echo " ==> Unloading tun module"
83rem_drv tun
84endef
85define CSWtap_postinstall
86#!/bin/sh
87PATH=/usr/bin:/usr/sbin
88rem_drv tap > /dev/null 2>&1
89echo " ==> Loading tap module"
90add_drv tap
91endef
92define CSWtap_preremove
93#!/bin/sh
94PATH=/usr/bin:/usr/sbin
95echo " ==> Unloading tap module"
96rem_drv tap
97endef
98
99include gar/category.mk
100
101# adjust compiler flags
102pre-build-modulated:
103        perl -pi -e 's@-m64@@' $(WORKSRC)/Makefile
104pre-build-isa-amd64:
105        perl -pi -e 's@(-D_KERNEL)@$$1 -xmodel=kernel@' $(WORKSRC)/Makefile
106
107# custom install
108install-custom:
109        @echo " ==> Installing ISA $(ISA)"
110        ginstall -d -m 0755 $(DESTDIR)$(DRV_CONF_DIR)
111        ginstall -m 644 $(WORKSRC)/tun.conf $(DESTDIR)$(DRV_CONF_DIR)
112        ginstall -m 644 $(WORKSRC)/tap.conf $(DESTDIR)$(DRV_CONF_DIR)
113        ginstall -d -m 0755 $(DESTDIR)/usr/include/net
114        ginstall -m 644 $(WORKSRC)/if_tun.h $(DESTDIR)/usr/include/net
115        ginstall -d -m 0755 $(DESTDIR)$(DRV_DIR)
116        ginstall -m 644 $(WORKSRC)/tun $(DESTDIR)$(DRV_DIR)
117        ginstall -m 644 $(WORKSRC)/tap $(DESTDIR)$(DRV_DIR)
118        @$(MAKECOOKIE)
Note: See TracBrowser for help on using the browser.