tun/tun.spec

Tue, 28 Aug 2012 18:34:30 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 28 Aug 2012 18:34:30 +0200
changeset 568
f43677a707f3
parent 387
33ae2d61c751
child 667
9dacbd1d1aa2
permissions
-rw-r--r--

Import package vendor original specs for necessary manipulations.

michael@75 1 ##
michael@75 2 ## tun.spec -- OpenPKG RPM Specification
michael@525 3 ## Copyright (c) 2012 Michael Schloh von Bennewitz <michael@schloh.com>
michael@75 4 ##
michael@75 5 ## Permission to use, copy, modify, and distribute this software for
michael@75 6 ## any purpose with or without fee is hereby granted, provided that
michael@75 7 ## the above copyright notice and this permission notice appear in all
michael@75 8 ## copies.
michael@75 9 ##
michael@75 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@75 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@75 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@75 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@75 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@75 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@75 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@75 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@75 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@75 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@75 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@75 21 ## SUCH DAMAGE.
michael@75 22 ##
michael@75 23
michael@75 24 # MSvB Fixme: Device driver could possibly be stripped
michael@75 25 # %{l_shtool} install -c -m -s 755 \
michael@75 26 # tun $RPM_BUILD_ROOT%{l_prefix}/lib/tun
michael@75 27
michael@75 28 # package information
michael@75 29 Name: tun
michael@75 30 Summary: Universal TUN/TAP Device Driver
michael@75 31 URL: http://vtun.sourceforge.net/tun/
michael@75 32 Vendor: Maxim Krasnyansky
michael@75 33 Packager: Michael Schloh von Bennewitz
michael@387 34 Distribution: Europalab Networks Production
michael@75 35 Class: EVAL
michael@75 36 Group: Driver
michael@75 37 License: GPL
michael@75 38 Version: 1.1
michael@525 39 Release: 20120800
michael@75 40
michael@75 41 # list of sources
michael@75 42 Source0: http://vtun.sourceforge.net/tun/tun-%{version}.tar.gz
michael@75 43 Patch0: tun.patch
michael@75 44
michael@75 45 # build information
michael@525 46 BuildPreReq: OpenPKG, openpkg >= 20100101, make
michael@525 47 PreReq: OpenPKG, openpkg >= 20100101
michael@75 48
michael@75 49 %description
michael@75 50 Tun provides packet reception and transmission for user space
michael@75 51 programs. It can be viewed as a simple Point-to-Point device, which
michael@75 52 instead of receiving packets from a physical media, receives them
michael@75 53 from user space program and instead of sending packets via physical
michael@75 54 media writes them to the user space program.
michael@75 55
michael@75 56 %track
michael@75 57 prog tun = {
michael@75 58 version = %{version}
michael@75 59 url = http://vtun.sourceforge.net/tun/
michael@75 60 regex = tun-(__VER__)\.tar\.gz
michael@75 61 }
michael@75 62
michael@75 63 %prep
michael@75 64 %setup -q -n tun-%{version}
michael@75 65 %patch -p0
michael@525 66 case "%{l_platform -t}" in
michael@525 67 *-sunos5.11 )
michael@525 68 %{l_shtool} subst \
michael@525 69 -e 's;ddi_power\([ \t]*/\* devo_power \*/\);NULL\1;' \
michael@525 70 -e 's;\(else if( (cmd == DDI_SUSPEND)\) || (cmd == DDI_PM_SUSPEND) );\1);' \
michael@525 71 solaris/tun.c
michael@525 72 ;;
michael@525 73 esac
michael@75 74
michael@75 75 %build
michael@75 76 CC="%{l_cc}" \
michael@75 77 CFLAGS="%{l_cflags -O}" \
michael@75 78 ./configure \
michael@75 79 --prefix=%{l_prefix}
michael@75 80 locplat=`grep 'OS_DIR *=' Makefile | sed -e 's;OS_DIR[^=][^=]*= *\([^ ][^ ]*\);\1;'`
michael@75 81 ( cd $locplat
michael@75 82 %{l_make} %{l_mflags -O}
michael@75 83 ) || exit $?
michael@75 84
michael@75 85 %install
michael@75 86 %{l_shtool} mkdir -f -p -m 755 \
michael@75 87 $RPM_BUILD_ROOT%{l_prefix}/lib/tun
michael@75 88 locplat=`grep 'OS_DIR *=' Makefile | sed -e 's;OS_DIR[^=][^=]*= *\([^ ][^ ]*\);\1;'`
michael@75 89 ( cd $locplat
michael@75 90 %{l_shtool} install -c -m 644 \
michael@75 91 tun tun.conf if_tun.h $RPM_BUILD_ROOT%{l_prefix}/lib/tun
michael@75 92 ) || exit $?
michael@75 93 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
michael@75 94
michael@75 95 %files -f files
michael@75 96
michael@75 97 %clean
michael@75 98
michael@75 99 %post
michael@75 100 if [ $1 -eq 1 -o $1 -eq 2 ]; then
michael@75 101 # announce special nature of this package
michael@75 102 ( echo "Attention: The special nature of the package contents require privileged"
michael@75 103 echo "interation, and must be carefully copied and nonportably installed to"
michael@75 104 echo "system areas outside of the OpenPKG instance."
michael@75 105 echo ""
michael@75 106 echo "This package therefore does not conform to basic OpenPKG principles, and"
michael@75 107 echo "should be removed immediately after its short term utility is exhausted."
michael@75 108 echo ""
michael@75 109 echo "To complete the installation on a SVR4 style operating system:"
michael@75 110 echo ""
michael@75 111 echo " $ su -"
michael@75 112 echo " # find %{l_prefix}/lib/tun/ -print"
michael@75 113 echo " # shtool install -c -m 755 -o root -g sys tun /usr/kernel/drv/"
michael@75 114 echo " # shtool install -c -m 644 -o root -g sys tun.conf /usr/kernel/drv/"
michael@75 115 echo " # shtool install -c -m 644 -o root -g bin if_tun.h /usr/include/net/"
michael@75 116 echo " # /usr/sbin/rem_drv tun"
michael@75 117 echo " # /usr/sbin/add_drv tun"
michael@75 118 ) | %{l_rpmtool} msg -b -t notice
michael@75 119 fi
michael@75 120 exit 0
michael@75 121
michael@75 122 %postun
michael@75 123 [ $1 -eq 0 ] || exit 0
michael@75 124 # announce special nature of this package on uninstall
michael@75 125 ( echo "Attention: The special nature of the package contents require privileged"
michael@75 126 echo "interation, and must be carefully deleted and nonportably uninstalled"
michael@75 127 echo "from system areas outside of the OpenPKG instance."
michael@75 128 echo ""
michael@75 129 echo " $ su -"
michael@75 130 echo " # ls -ld /usr/kernel/drv/*tun* /usr/include/net/*tun*"
michael@75 131 echo " # /usr/sbin/rem_drv tun"
michael@75 132 echo " # ls -ld /usr/kernel/drv/*tun*"
michael@75 133 echo " # ls -ld /usr/include/net/*tun*"
michael@75 134 echo " # rm -f /usr/kernel/drv/tun"
michael@75 135 echo " # rm -f /usr/kernel/drv/tun.conf"
michael@75 136 echo " # rm -f /usr/include/net/if_tun.h"
michael@75 137 ) | %{l_rpmtool} msg -b -t notice
michael@75 138 exit 0
michael@75 139

mercurial