michael@75: ## michael@75: ## tun.spec -- OpenPKG RPM Specification michael@75: ## Copyright (c) 2009 Michael Schloh von Bennewitz michael@75: ## michael@75: ## Permission to use, copy, modify, and distribute this software for michael@75: ## any purpose with or without fee is hereby granted, provided that michael@75: ## the above copyright notice and this permission notice appear in all michael@75: ## copies. michael@75: ## michael@75: ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED michael@75: ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF michael@75: ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. michael@75: ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR michael@75: ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@75: ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@75: ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF michael@75: ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND michael@75: ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, michael@75: ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT michael@75: ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF michael@75: ## SUCH DAMAGE. michael@75: ## michael@75: michael@75: # MSvB Fixme: Device driver could possibly be stripped michael@75: # %{l_shtool} install -c -m -s 755 \ michael@75: # tun $RPM_BUILD_ROOT%{l_prefix}/lib/tun michael@75: michael@75: # package information michael@75: Name: tun michael@75: Summary: Universal TUN/TAP Device Driver michael@75: URL: http://vtun.sourceforge.net/tun/ michael@75: Vendor: Maxim Krasnyansky michael@75: Packager: Michael Schloh von Bennewitz michael@387: Distribution: Europalab Networks Production michael@75: Class: EVAL michael@75: Group: Driver michael@75: License: GPL michael@75: Version: 1.1 michael@75: Release: 20090106 michael@75: michael@75: # list of sources michael@75: Source0: http://vtun.sourceforge.net/tun/tun-%{version}.tar.gz michael@75: Patch0: tun.patch michael@75: michael@75: # build information michael@75: Prefix: %{l_prefix} michael@75: BuildRoot: %{l_buildroot} michael@85: BuildPreReq: OpenPKG, openpkg >= 20050726, make michael@75: PreReq: OpenPKG, openpkg >= 20050726 michael@75: AutoReq: no michael@75: AutoReqProv: no michael@75: michael@75: %description michael@75: Tun provides packet reception and transmission for user space michael@75: programs. It can be viewed as a simple Point-to-Point device, which michael@75: instead of receiving packets from a physical media, receives them michael@75: from user space program and instead of sending packets via physical michael@75: media writes them to the user space program. michael@75: michael@75: %track michael@75: prog tun = { michael@75: version = %{version} michael@75: url = http://vtun.sourceforge.net/tun/ michael@75: regex = tun-(__VER__)\.tar\.gz michael@75: } michael@75: michael@75: %prep michael@75: %setup -q -n tun-%{version} michael@75: %patch -p0 michael@75: michael@75: %build michael@75: CC="%{l_cc}" \ michael@75: CFLAGS="%{l_cflags -O}" \ michael@75: ./configure \ michael@75: --prefix=%{l_prefix} michael@75: locplat=`grep 'OS_DIR *=' Makefile | sed -e 's;OS_DIR[^=][^=]*= *\([^ ][^ ]*\);\1;'` michael@75: ( cd $locplat michael@75: %{l_make} %{l_mflags -O} michael@75: ) || exit $? michael@75: michael@75: %install michael@75: rm -rf $RPM_BUILD_ROOT michael@75: %{l_shtool} mkdir -f -p -m 755 \ michael@75: $RPM_BUILD_ROOT%{l_prefix}/lib/tun michael@75: locplat=`grep 'OS_DIR *=' Makefile | sed -e 's;OS_DIR[^=][^=]*= *\([^ ][^ ]*\);\1;'` michael@75: ( cd $locplat michael@75: %{l_shtool} install -c -m 644 \ michael@75: tun tun.conf if_tun.h $RPM_BUILD_ROOT%{l_prefix}/lib/tun michael@75: ) || exit $? michael@75: %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} michael@75: michael@75: %files -f files michael@75: michael@75: %clean michael@75: rm -rf $RPM_BUILD_ROOT michael@75: michael@75: %post michael@75: if [ $1 -eq 1 -o $1 -eq 2 ]; then michael@75: # announce special nature of this package michael@75: ( echo "Attention: The special nature of the package contents require privileged" michael@75: echo "interation, and must be carefully copied and nonportably installed to" michael@75: echo "system areas outside of the OpenPKG instance." michael@75: echo "" michael@75: echo "This package therefore does not conform to basic OpenPKG principles, and" michael@75: echo "should be removed immediately after its short term utility is exhausted." michael@75: echo "" michael@75: echo "To complete the installation on a SVR4 style operating system:" michael@75: echo "" michael@75: echo " $ su -" michael@75: echo " # find %{l_prefix}/lib/tun/ -print" michael@75: echo " # shtool install -c -m 755 -o root -g sys tun /usr/kernel/drv/" michael@75: echo " # shtool install -c -m 644 -o root -g sys tun.conf /usr/kernel/drv/" michael@75: echo " # shtool install -c -m 644 -o root -g bin if_tun.h /usr/include/net/" michael@75: echo " # /usr/sbin/rem_drv tun" michael@75: echo " # /usr/sbin/add_drv tun" michael@75: ) | %{l_rpmtool} msg -b -t notice michael@75: fi michael@75: exit 0 michael@75: michael@75: %postun michael@75: [ $1 -eq 0 ] || exit 0 michael@75: # announce special nature of this package on uninstall michael@75: ( echo "Attention: The special nature of the package contents require privileged" michael@75: echo "interation, and must be carefully deleted and nonportably uninstalled" michael@75: echo "from system areas outside of the OpenPKG instance." michael@75: echo "" michael@75: echo " $ su -" michael@75: echo " # ls -ld /usr/kernel/drv/*tun* /usr/include/net/*tun*" michael@75: echo " # /usr/sbin/rem_drv tun" michael@75: echo " # ls -ld /usr/kernel/drv/*tun*" michael@75: echo " # ls -ld /usr/include/net/*tun*" michael@75: echo " # rm -f /usr/kernel/drv/tun" michael@75: echo " # rm -f /usr/kernel/drv/tun.conf" michael@75: echo " # rm -f /usr/include/net/if_tun.h" michael@75: ) | %{l_rpmtool} msg -b -t notice michael@75: exit 0 michael@75: