tun/tun.spec

changeset 769
a0926cc92e0c
parent 525
bf1e61b0917c
equal deleted inserted replaced
3:f3fc00cdd087 4:9aed37ad9e8e
18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
21 ## SUCH DAMAGE. 21 ## SUCH DAMAGE.
22 ## 22 ##
23
24 # MSvB Fixme: Device driver could possibly be stripped
25 # %{l_shtool} install -c -m -s 755 \
26 # tun $RPM_BUILD_ROOT%{l_prefix}/lib/tun
27 23
28 # package information 24 # package information
29 Name: tun 25 Name: tun
30 Summary: Universal TUN/TAP Device Driver 26 Summary: Universal TUN/TAP Device Driver
31 URL: http://vtun.sourceforge.net/tun/ 27 URL: http://vtun.sourceforge.net/tun/
46 BuildPreReq: OpenPKG, openpkg >= 20100101, make 42 BuildPreReq: OpenPKG, openpkg >= 20100101, make
47 PreReq: OpenPKG, openpkg >= 20100101 43 PreReq: OpenPKG, openpkg >= 20100101
48 44
49 %description 45 %description
50 Tun provides packet reception and transmission for user space 46 Tun provides packet reception and transmission for user space
51 programs. It can be viewed as a simple Point-to-Point device, which 47 programs. It can be viewed as a simple point to point device, which
52 instead of receiving packets from a physical media, receives them 48 instead of receiving packets from a physical media, receives them
53 from user space program and instead of sending packets via physical 49 from user space program and instead of sending packets via physical
54 media writes them to the user space program. 50 media writes them to the user space program.
55 51
56 %track 52 %track
61 } 57 }
62 58
63 %prep 59 %prep
64 %setup -q -n tun-%{version} 60 %setup -q -n tun-%{version}
65 %patch -p0 61 %patch -p0
62 %{l_shtool} subst \
63 -e 's;^\(CC *= *\).*;\1@CC@;' \
64 -e 's;^\(CFLAGS *= *\).*;\1@CFLAGS@ $(DEFS) -D_KERNEL -I.;' \
65 solaris/Makefile.in
66 case "%{l_platform -t}" in
67 *-sunos5.1[01] )
68 %{l_shtool} subst \
69 -e 's;"tun";"vtun";g' \
70 solaris/tun.c
71 %{l_shtool} subst \
72 -e 's;tun;vtun;g' \
73 solaris/tun.conf
74 ;;
75 esac
66 case "%{l_platform -t}" in 76 case "%{l_platform -t}" in
67 *-sunos5.11 ) 77 *-sunos5.11 )
68 %{l_shtool} subst \ 78 %{l_shtool} subst \
69 -e 's;ddi_power\([ \t]*/\* devo_power \*/\);NULL\1;' \ 79 -e 's;ddi_power\([ \t]*/\* devo_power \*/\);NULL\1;' \
70 -e 's;\(else if( (cmd == DDI_SUSPEND)\) || (cmd == DDI_PM_SUSPEND) );\1);' \ 80 -e 's;\(else if( (cmd == DDI_SUSPEND)\) || (cmd == DDI_PM_SUSPEND) );\1);' \
71 solaris/tun.c 81 solaris/tun.c
72 ;; 82 ;;
73 esac 83 esac
84 case "%{l_platform -t}" in
85 *64-* )
86 %{l_shtool} subst \
87 %if "%{l_cc}" == "/opt/solarisstudio12.3/bin/cc"
88 -e 's;\(\$(LD)\) *\(.*-o tun\);\1 -64 \2;' \
89 -e 's;^\(CFLAGS *=.*\);\1 -fast -xO4 -m64 -Kpic;' \
90 %else
91 -e 's;^\(CFLAGS *=.*\);\1 -O2 -m64 -fPIC;' \
92 %endif
93 solaris/Makefile.in
94 ;;
95 esac
74 96
75 %build 97 %build
98 %if "%{l_cc}" == "/opt/solarisstudio12.3/bin/cc"
99 PATH="/bin:/sbin:/usr/bin:/usr/sbin:/opt/solarisstudio12.3/bin"
100 %endif
76 CC="%{l_cc}" \ 101 CC="%{l_cc}" \
77 CFLAGS="%{l_cflags -O}" \ 102 CFLAGS="%{l_cflags}" \
78 ./configure \ 103 ./configure \
79 --prefix=%{l_prefix} 104 --prefix=%{l_prefix}
80 locplat=`grep 'OS_DIR *=' Makefile | sed -e 's;OS_DIR[^=][^=]*= *\([^ ][^ ]*\);\1;'` 105 locplat=`grep 'OS_DIR *=' Makefile | sed -e 's;OS_DIR[^=][^=]*= *\([^ ][^ ]*\);\1;'`
81 ( cd $locplat 106 ( cd $locplat
82 %{l_make} %{l_mflags -O} 107 %{l_make} %{l_mflags -O}
85 %install 110 %install
86 %{l_shtool} mkdir -f -p -m 755 \ 111 %{l_shtool} mkdir -f -p -m 755 \
87 $RPM_BUILD_ROOT%{l_prefix}/lib/tun 112 $RPM_BUILD_ROOT%{l_prefix}/lib/tun
88 locplat=`grep 'OS_DIR *=' Makefile | sed -e 's;OS_DIR[^=][^=]*= *\([^ ][^ ]*\);\1;'` 113 locplat=`grep 'OS_DIR *=' Makefile | sed -e 's;OS_DIR[^=][^=]*= *\([^ ][^ ]*\);\1;'`
89 ( cd $locplat 114 ( cd $locplat
90 %{l_shtool} install -c -m 644 \ 115 case "%{l_platform -t}" in
91 tun tun.conf if_tun.h $RPM_BUILD_ROOT%{l_prefix}/lib/tun 116 *-sunos5.1[01] )
117 %{l_shtool} install -c -m 755 \
118 tun $RPM_BUILD_ROOT%{l_prefix}/lib/tun/vtun
119 %{l_shtool} install -c -m 644 \
120 tun.conf $RPM_BUILD_ROOT%{l_prefix}/lib/tun/vtun.conf
121 %{l_shtool} install -c -m 644 \
122 if_tun.h $RPM_BUILD_ROOT%{l_prefix}/lib/tun/
123 ;;
124 * )
125 %{l_shtool} install -c -m 755 \
126 tun $RPM_BUILD_ROOT%{l_prefix}/lib/tun
127 %{l_shtool} install -c -m 644 \
128 tun.conf if_tun.h $RPM_BUILD_ROOT%{l_prefix}/lib/tun
129 ;;
130 esac
92 ) || exit $? 131 ) || exit $?
93 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} 132 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
94 133
95 %files -f files 134 %files -f files
96 135
108 echo "" 147 echo ""
109 echo "To complete the installation on a SVR4 style operating system:" 148 echo "To complete the installation on a SVR4 style operating system:"
110 echo "" 149 echo ""
111 echo " $ su -" 150 echo " $ su -"
112 echo " # find %{l_prefix}/lib/tun/ -print" 151 echo " # find %{l_prefix}/lib/tun/ -print"
113 echo " # shtool install -c -m 755 -o root -g sys tun /usr/kernel/drv/" 152 echo " # shtool install -c -m 644 -o root -g sys (v)tun.conf /usr/kernel/drv/"
114 echo " # shtool install -c -m 644 -o root -g sys tun.conf /usr/kernel/drv/" 153 echo " # (optional) shtool install -c -m 644 -o root -g bin if_tun.h /usr/include/net/"
115 echo " # shtool install -c -m 644 -o root -g bin if_tun.h /usr/include/net/" 154 echo " # file (v)tun # if the driver 32-bit or 64-bit is very important"
116 echo " # /usr/sbin/rem_drv tun" 155 echo " # (either) shtool install -c -m 755 -o root -g sys (v)tun /usr/kernel/drv/"
117 echo " # /usr/sbin/add_drv tun" 156 echo " # (or) shtool install -c -m 755 -o root -g sys (v)tun /usr/kernel/drv/amd64/"
157 echo " # (or) shtool install -c -m 755 -o root -g sys (v)tun /usr/kernel/drv/sparcv9/"
158 echo " # modinfo | grep tun"
159 echo " # /usr/sbin/rem_drv -C (v)tun"
160 echo " # /usr/sbin/add_drv (v)tun"
161 echo " # modinfo | grep tun"
118 ) | %{l_rpmtool} msg -b -t notice 162 ) | %{l_rpmtool} msg -b -t notice
119 fi 163 fi
120 exit 0 164 exit 0
121 165
122 %postun 166 %postun
125 ( echo "Attention: The special nature of the package contents require privileged" 169 ( echo "Attention: The special nature of the package contents require privileged"
126 echo "interation, and must be carefully deleted and nonportably uninstalled" 170 echo "interation, and must be carefully deleted and nonportably uninstalled"
127 echo "from system areas outside of the OpenPKG instance." 171 echo "from system areas outside of the OpenPKG instance."
128 echo "" 172 echo ""
129 echo " $ su -" 173 echo " $ su -"
130 echo " # ls -ld /usr/kernel/drv/*tun* /usr/include/net/*tun*" 174 echo " # ls -ld /usr/kernel/drv/*/*tun* /usr/kernel/drv/*tun* /usr/include/net/*tun*"
131 echo " # /usr/sbin/rem_drv tun" 175 echo " # modinfo | grep tun"
176 echo " # /usr/sbin/rem_drv -C (v)tun"
177 echo " # modinfo | grep tun"
132 echo " # ls -ld /usr/kernel/drv/*tun*" 178 echo " # ls -ld /usr/kernel/drv/*tun*"
179 echo " # ls -ld /usr/kernel/drv/*/*tun*"
133 echo " # ls -ld /usr/include/net/*tun*" 180 echo " # ls -ld /usr/include/net/*tun*"
134 echo " # rm -f /usr/kernel/drv/tun" 181 echo " # rm -f /usr/kernel/drv/[archpath]/(v)tun"
135 echo " # rm -f /usr/kernel/drv/tun.conf" 182 echo " # rm -f /usr/kernel/drv/(v)tun.conf"
136 echo " # rm -f /usr/include/net/if_tun.h" 183 echo " # rm -f /usr/include/net/if_tun.h"
137 ) | %{l_rpmtool} msg -b -t notice 184 ) | %{l_rpmtool} msg -b -t notice
138 exit 0 185 exit 0
139 186

mercurial