Mon, 12 Jan 2009 19:09:19 +0100
Import new package spec for introduction into repository.
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gmediaserver/fsl.gmediaserver Mon Jan 12 19:09:19 2009 +0100 1.3 @@ -0,0 +1,16 @@ 1.4 +## 1.5 +## fsl.gmediaserver -- OSSP fsl configuration 1.6 +## 1.7 + 1.8 +ident (gmediaserver)/.+ q{ 1.9 + prefix( 1.10 + prefix="%b %d %H:%M:%S %N <%L> $1[%P]: " 1.11 + ) 1.12 + -> { 1.13 + debug: file( 1.14 + path="@l_prefix@/var/gmediaserver/log/gmediaserver.log", 1.15 + perm=0644 1.16 + ) 1.17 + } 1.18 +}; 1.19 +
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/gmediaserver/gmediaserver.patch Mon Jan 12 19:09:19 2009 +0100 2.3 @@ -0,0 +1,82 @@ 2.4 +Index: src/interface.c 2.5 +diff -Nau src/interface.c.orig src/interface.c 2.6 +--- src/interface.c.orig 2005-09-10 09:25:40.000000000 +0200 2.7 ++++ src/interface.c 2006-10-30 23:18:46.644745000 +0100 2.8 +@@ -28,8 +28,19 @@ 2.9 + #include <net/if.h> /* ? */ 2.10 + #include <netinet/in.h> /* ? */ 2.11 + #include <arpa/inet.h> /* ? */ 2.12 ++#if (defined(sun) && defined(__svr4__)) 2.13 ++#include <sys/sockio.h> 2.14 ++#endif 2.15 + #include "gmediaserver.h" 2.16 + 2.17 ++#ifndef MAX 2.18 ++#define MAX(a,b) ((a) > (b) ? (a) : (b)) 2.19 ++#endif 2.20 ++ 2.21 ++#ifndef MIN 2.22 ++#define MIN(a,b) ((a) < (b) ? (a) : (b)) 2.23 ++#endif 2.24 ++ 2.25 + char * 2.26 + get_ip_by_spec(char *spec) 2.27 + { 2.28 +Index: src/metadata.c 2.29 +diff -Nau src/metadata.c.orig src/metadata.c 2.30 +--- src/metadata.c.orig 2007-02-27 14:10:38.630894000 +0100 2.31 ++++ src/metadata.c 2007-02-27 14:11:50.191849000 +0100 2.32 +@@ -1071,6 +1071,7 @@ 2.33 + uint32_t c; 2.34 + uint32_t child_count = 0; 2.35 + 2.36 ++ root_entry = make_entry(ROOT_ENTRY_NAME, -1, true); 2.37 + children = xmalloc(sizeof(int32_t) * pathc); 2.38 + for (c = 0; c < pathc; c++) { 2.39 + Entry *entry; 2.40 +@@ -1088,13 +1089,12 @@ 2.41 + free(tmp); 2.42 + } 2.43 + 2.44 +- entry = scan_entry(pathv[c], name, -1, indent_size, NULL); 2.45 ++ entry = scan_entry(pathv[c], name, root_entry->id, indent_size, NULL); 2.46 + if (entry != NULL) 2.47 + children[child_count++] = entry->id; 2.48 + free(name); 2.49 + } 2.50 + if (child_count != 0) { 2.51 +- root_entry = make_entry(ROOT_ENTRY_NAME, -1, true); 2.52 + detail = get_entry_detail(root_entry, DETAIL_CHILDREN); 2.53 + detail->data.children.count = child_count; 2.54 + detail->data.children.list = children; 2.55 +Index: lib/Makefile.in 2.56 +diff -Nau lib/Makefile.in.orig lib/Makefile.in 2.57 +--- lib/Makefile.in.orig 2006-08-29 22:53:57.000000000 +0200 2.58 ++++ lib/Makefile.in 2006-11-01 10:25:38.000000000 +0100 2.59 +@@ -112,7 +112,16 @@ 2.60 + full-write.$(OBJEXT) getnline.$(OBJEXT) progname.$(OBJEXT) \ 2.61 + striconv.$(OBJEXT) version-etc.$(OBJEXT) xalloc-die.$(OBJEXT) \ 2.62 + xgethostname.$(OBJEXT) xstrndup.$(OBJEXT) xvasprintf.$(OBJEXT) \ 2.63 +- xasprintf.$(OBJEXT) 2.64 ++ xasprintf.$(OBJEXT) xmalloc.$(OBJEXT) quote.$(OBJEXT) error.$(OBJEXT) \ 2.65 ++ quotearg.$(OBJEXT) strftime.$(OBJEXT) \ 2.66 ++ strndup.$(OBJEXT) strnlen.$(OBJEXT) \ 2.67 ++ getopt.$(OBJEXT) getopt1.$(OBJEXT) \ 2.68 ++ basename.$(OBJEXT) dirname.$(OBJEXT) \ 2.69 ++ vasprintf.$(OBJEXT) vasnprintf.$(OBJEXT) \ 2.70 ++ full-read.$(OBJEXT) safe-read.$(OBJEXT) \ 2.71 ++ full-write.$(OBJEXT) safe-write.$(OBJEXT) \ 2.72 ++ printf-args.$(OBJEXT) printf-parse.$(OBJEXT) \ 2.73 ++ exitfail.$(OBJEXT) getndelim2.$(OBJEXT) sig2str.$(OBJEXT) 2.74 + libgnu_a_OBJECTS = $(am_libgnu_a_OBJECTS) 2.75 + LTLIBRARIES = $(noinst_LTLIBRARIES) 2.76 + DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) 2.77 +@@ -553,7 +562,7 @@ 2.78 + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) 2.79 + libgnu.a: $(libgnu_a_OBJECTS) $(libgnu_a_DEPENDENCIES) 2.80 + -rm -f libgnu.a 2.81 +- $(libgnu_a_AR) libgnu.a $(libgnu_a_OBJECTS) $(libgnu_a_LIBADD) 2.82 ++ $(libgnu_a_AR) libgnu.a $(libgnu_a_OBJECTS) 2.83 + $(RANLIB) libgnu.a 2.84 + 2.85 + clean-noinstLTLIBRARIES:
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/gmediaserver/gmediaserver.spec Mon Jan 12 19:09:19 2009 +0100 3.3 @@ -0,0 +1,171 @@ 3.4 +## 3.5 +## gmediaserver.spec -- OpenPKG RPM Specification 3.6 +## Copyright (c) 2009 Michael Schloh von Bennewitz <michael@schloh.com> 3.7 +## 3.8 +## Permission to use, copy, modify, and distribute this software for 3.9 +## any purpose with or without fee is hereby granted, provided that 3.10 +## the above copyright notice and this permission notice appear in all 3.11 +## copies. 3.12 +## 3.13 +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 3.14 +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 3.15 +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 3.16 +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR 3.17 +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 3.18 +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 3.19 +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 3.20 +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 3.21 +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 3.22 +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 3.23 +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3.24 +## SUCH DAMAGE. 3.25 +## 3.26 + 3.27 + 3.28 +# package information 3.29 +Name: gmediaserver 3.30 +Summary: UPnP Media Server 3.31 +URL: http://www.gnu.org/software/gmediaserver/ 3.32 +Vendor: Oskar Liljeblad 3.33 +Packager: Michael Schloh von Bennewitz 3.34 +Distribution: Michael Schloh von Bennewitz 3.35 +Class: EVAL 3.36 +Group: Network 3.37 +License: GPL 3.38 +Version: 0.13.0 3.39 +Release: 20090106 3.40 + 3.41 +# package options 3.42 +%option with_fsl yes 3.43 + 3.44 +# list of sources 3.45 +Source0: http://www.very-clever.com/download/nongnu/gmediaserver/gmediaserver-%{version}.tar.gz 3.46 +Source1: rc.gmediaserver 3.47 +Source2: fsl.gmediaserver 3.48 +Patch0: gmediaserver.patch 3.49 + 3.50 +# build information 3.51 +Prefix: %{l_prefix} 3.52 +BuildRoot: %{l_buildroot} 3.53 +BuildPreReq: OpenPKG, openpkg >= 20040130, gcc 3.54 +PreReq: OpenPKG, openpkg >= 20040130, gcc 3.55 +BuildPreReq: libupnp, file, id3lib, taglib 3.56 +PreReq: libupnp, file, id3lib, taglib 3.57 +%if "%{with_fsl}" == "yes" 3.58 +BuildPreReq: fsl >= 1.2.0 3.59 +PreReq: fsl >= 1.2.0 3.60 +%endif 3.61 +AutoReq: no 3.62 +AutoReqProv: no 3.63 + 3.64 +%description 3.65 + GMediaServer is a console based UPnP compatible media server. 3.66 + It serves audio and video files to those network connected media 3.67 + players capable of receiving media over UPnP. 3.68 + 3.69 +%track 3.70 + prog gmediaserver = { 3.71 + version = %{version} 3.72 + url = http://www.very-clever.com/download/nongnu/gmediaserver/ 3.73 + regex = gmediaserver-(__VER__)\.tar\.gz 3.74 + } 3.75 + 3.76 +%prep 3.77 + # unpack sources 3.78 + %setup -q 3.79 + %patch -p0 3.80 + 3.81 + # correct build configuration 3.82 + %{l_shtool} subst \ 3.83 + -e 's;\(LIBS="-lupnp\) \(\$LIBS"\);\1 -lixml -lthreadutil \2;' \ 3.84 + -e 's;\(UPNP_LIBS="\$PTHREAD_LIBS -L\$prefixupnp/lib -lupnp\);\1 -lixml -lthreadutil;' \ 3.85 + -e 's;\(LIBMAGIC=\)\(-lmagic\);\1"\2 -lz";' \ 3.86 + configure 3.87 + %{l_shtool} subst \ 3.88 + -e 's/tm.tm_zone = "GMT";/tzname[0] = "GMT";/' \ 3.89 + src/webclient.c 3.90 + 3.91 +%build 3.92 + # prepare configuration 3.93 + CC="%{l_cc}" \ 3.94 + CFLAGS="%{l_cflags -O} -pthread" \ 3.95 + CPPFLAGS="%{l_cppflags}" \ 3.96 + LDFLAGS="%{l_ldflags} %{l_fsl_ldflags} -pthread" \ 3.97 + LIBS="%{l_fsl_libs}" \ 3.98 + GREP="grep" \ 3.99 + ./configure \ 3.100 + --prefix=%{l_prefix} \ 3.101 + --disable-nls 3.102 + 3.103 + # use the internal getopt definitions 3.104 + cd lib && %{l_make} %{l_mflags} getopt.h iconv_.h 3.105 + 3.106 + # build using parallel make 3.107 + %{l_make} %{l_mflags -O} 3.108 + 3.109 +%install 3.110 + # remove previously existing installations 3.111 + rm -rf $RPM_BUILD_ROOT 3.112 + 3.113 + # run the native installation logic 3.114 + %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT 3.115 + 3.116 + # create additional installation paths 3.117 + %{l_shtool} mkdir -f -p -m 755 \ 3.118 + $RPM_BUILD_ROOT%{l_prefix}/var/gmediaserver/log \ 3.119 + $RPM_BUILD_ROOT%{l_prefix}/var/gmediaserver/run 3.120 + 3.121 + # correct the installation hierarchy 3.122 + mv $RPM_BUILD_ROOT%{l_prefix}/share/man \ 3.123 + $RPM_BUILD_ROOT%{l_prefix}/ 3.124 + mv $RPM_BUILD_ROOT%{l_prefix}/share/info \ 3.125 + $RPM_BUILD_ROOT%{l_prefix}/ 3.126 + rm -rf $RPM_BUILD_ROOT%{l_prefix}/share 3.127 + 3.128 + # strip binaries laden with symbols 3.129 + strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true 3.130 + 3.131 + # install runcommand script 3.132 + %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d 3.133 + %{l_shtool} install -c -m 755 %{l_value -s -a} \ 3.134 + %{SOURCE rc.gmediaserver} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ 3.135 + 3.136 + # install OSSP fsl configuration 3.137 + %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl 3.138 + %{l_shtool} install -c -m 644 %{l_value -s -a} \ 3.139 + %{SOURCE fsl.gmediaserver} \ 3.140 + $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/ 3.141 + 3.142 + # determine installation files 3.143 + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ 3.144 + %{l_files_std} \ 3.145 + '%not %dir %{l_prefix}/etc/fsl' \ 3.146 + '%config %{l_prefix}/etc/fsl/fsl.gmediaserver' 3.147 + 3.148 +%files -f files 3.149 + 3.150 +%clean 3.151 + rm -rf $RPM_BUILD_ROOT 3.152 + 3.153 +%pre 3.154 + # before upgrading package, record runtime status and stop service 3.155 + [ $1 -eq 2 ] || exit 0 3.156 + eval `%{l_rc} gmediaserver status 2>/dev/null | tee %{l_tmpfile}` 3.157 + %{l_rc} gmediaserver stop 2>/dev/null 3.158 + exit 0 3.159 + 3.160 +%post 3.161 + if [ $1 -eq 2 ]; then 3.162 + # after upgrading package, restore runtime status 3.163 + eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile} >/dev/null 2>&1 || true 3.164 + [ ".$gmediaserver_active" = .yes ] && %{l_rc} gmediaserver start 3.165 + fi 3.166 + exit 0 3.167 + 3.168 +%preun 3.169 + # before removing package, stop service and remove log files 3.170 + [ $1 -eq 0 ] || exit 0 3.171 + %{l_rc} gmediaserver stop 2>/dev/null 3.172 + rm -f $RPM_INSTALL_PREFIX/var/gmediaserver/log/* >/dev/null 2>&1 || true 3.173 + exit 0 3.174 +
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 4.2 +++ b/gmediaserver/rc.gmediaserver Mon Jan 12 19:09:19 2009 +0100 4.3 @@ -0,0 +1,86 @@ 4.4 +#!@l_prefix@/bin/openpkg rc 4.5 +## 4.6 +## rc.gmediaserver -- runcommands 4.7 +## 4.8 + 4.9 +%config 4.10 + gmediaserver_enable="$openpkg_rc_def" 4.11 + gmediaserver_log_prolog="true" 4.12 + gmediaserver_log_epilog="true" 4.13 + gmediaserver_log_numfiles="10" 4.14 + gmediaserver_log_minsize="1M" 4.15 + gmediaserver_log_complevel="9" 4.16 + gmediaserver_name="GMediaServer" 4.17 + gmediaserver_fschar="ISO-8859-1" 4.18 + gmediaserver_devchar="ISO-8859-1" 4.19 + gmediaserver_logchar="ISO-8859-1" 4.20 + gmediaserver_profile="generic" 4.21 + gmediaserver_ftypes="mp3,wav,ogg,pls,m3u,jpg,png" 4.22 + gmediaserver_expire="100" 4.23 + gmediaserver_iface="lo0" 4.24 + gmediaserver_port="49152" 4.25 + gmediaserver_dirs="@l_prefix@/pub" 4.26 + 4.27 +%common 4.28 + gmediaserver_pidfile="@l_prefix@/var/gmediaserver/run/gmediaserver.pid" 4.29 + gmediaserver_logfile="@l_prefix@/var/gmediaserver/log/gmediaserver.log" 4.30 + gmediaserver_signal () { 4.31 + [ -f $gmediaserver_pidfile ] && kill -$1 `cat $gmediaserver_pidfile` 4.32 + } 4.33 + 4.34 +%status -u @l_susr@ -o 4.35 + gmediaserver_usable="no" 4.36 + gmediaserver_active="no" 4.37 + rcService gmediaserver enable yes && \ 4.38 + gmediaserver_usable="yes" 4.39 + rcService gmediaserver enable yes && \ 4.40 + gmediaserver_signal 0 && gmediaserver_active="yes" 4.41 + echo "gmediaserver_enable=\"$gmediaserver_enable\"" 4.42 + echo "gmediaserver_usable=\"$gmediaserver_usable\"" 4.43 + echo "gmediaserver_active=\"$gmediaserver_active\"" 4.44 + 4.45 +%start -u @l_susr@ 4.46 + rcService gmediaserver enable yes || exit 0 4.47 + rcService gmediaserver active yes && exit 0 4.48 + @l_prefix@/bin/gmediaserver \ 4.49 + --friendly-name=$gmediaserver_name \ 4.50 + --fs-charset=$gmediaserver_fschar \ 4.51 + --device-charset=$gmediaserver_devchar \ 4.52 + --log-charset=$gmediaserver_logchar \ 4.53 + --profile=$gmediaserver_profile \ 4.54 + --file-types=$gmediaserver_ftypes \ 4.55 + --expire-time=$gmediaserver_expire \ 4.56 + --interface=$gmediaserver_iface \ 4.57 + --port=$gmediaserver_port \ 4.58 + --pid-file=$gmediaserver_pidfile \ 4.59 + --output=$gmediaserver_logfile \ 4.60 + --background \ 4.61 + --timestamp \ 4.62 + $gmediaserver_dirs 4.63 + 4.64 +%stop -u @l_susr@ 4.65 + rcService gmediaserver enable yes || exit 0 4.66 + rcService gmediaserver active no && exit 0 4.67 + gmediaserver_signal TERM 4.68 + 4.69 +%restart -u @l_susr@ 4.70 + rcService gmediaserver enable yes || exit 0 4.71 + rcService gmediaserver active no && exit 0 4.72 + rc gmediaserver stop 4.73 + sleep 2 4.74 + rc gmediaserver start 4.75 + 4.76 +%reload -u @l_susr@ 4.77 + rcService gmediaserver enable yes || exit 0 4.78 + rcService gmediaserver active no && exit 0 4.79 + gmediaserver_signal USR1 4.80 + 4.81 +%daily -u @l_susr@ 4.82 + rcService gmediaserver enable yes || exit 0 4.83 + shtool rotate -f \ 4.84 + -n ${gmediaserver_log_numfiles} -s ${gmediaserver_log_minsize} -d \ 4.85 + -z ${gmediaserver_log_complevel} -o @l_susr@ -g @l_mgrp@ -m 644 \ 4.86 + -P "${gmediaserver_log_prolog}" \ 4.87 + -E "${gmediaserver_log_epilog}; rc gmediaserver restart" \ 4.88 + @l_prefix@/var/gmediaserver/log/gmediaserver.log \ 4.89 + @l_prefix@/var/gmediaserver/log/arpsnmp.log
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 5.2 +++ b/id3lib/id3lib.spec Mon Jan 12 19:09:19 2009 +0100 5.3 @@ -0,0 +1,100 @@ 5.4 +## 5.5 +## id3lib.spec -- OpenPKG RPM Specification 5.6 +## Copyright (c) 2009 Michael Schloh von Bennewitz <michael@schloh.com> 5.7 +## 5.8 +## Permission to use, copy, modify, and distribute this software for 5.9 +## any purpose with or without fee is hereby granted, provided that 5.10 +## the above copyright notice and this permission notice appear in all 5.11 +## copies. 5.12 +## 5.13 +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 5.14 +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 5.15 +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 5.16 +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR 5.17 +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 5.18 +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 5.19 +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 5.20 +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 5.21 +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 5.22 +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 5.23 +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 5.24 +## SUCH DAMAGE. 5.25 +## 5.26 + 5.27 + 5.28 +# package information 5.29 +Name: id3lib 5.30 +Summary: ID3v1 and ID3v2 SDK 5.31 +URL: http://id3lib.sourceforge.net/ 5.32 +Vendor: Thijmen Klok 5.33 +Packager: Michael Schloh von Bennewitz 5.34 +Distribution: Michael Schloh von Bennewitz 5.35 +Class: EVAL 5.36 +Group: Audio 5.37 +License: LGPL 5.38 +Version: 3.8.3 5.39 +Release: 20090106 5.40 + 5.41 +# list of sources 5.42 +Source0: http://switch.dl.sourceforge.net/id3lib/id3lib-%{version}.tar.gz 5.43 + 5.44 +# build information 5.45 +Prefix: %{l_prefix} 5.46 +BuildRoot: %{l_buildroot} 5.47 +BuildPreReq: OpenPKG, openpkg >= 20040130, gcc, make 5.48 +PreReq: OpenPKG, openpkg >= 20040130 5.49 +AutoReq: no 5.50 +AutoReqProv: no 5.51 + 5.52 +%description 5.53 + id3lib is an Opensource, cross platform software development library 5.54 + for reading, writing, and manipulating ID3v1 and ID3v2 tags. It is 5.55 + an ongoing project whose primary goals are full compliance with the 5.56 + ID3v2 standard, portability across several platforms, and providing 5.57 + a powerful and feature rich API with a highly stable and efficient 5.58 + implementation. 5.59 + 5.60 +%track 5.61 + prog id3lib = { 5.62 + version = %{version} 5.63 + url = http://switch.dl.sourceforge.net/id3lib/ 5.64 + regex = id3lib-(__VER__)\.tar\.gz 5.65 + } 5.66 + 5.67 +%prep 5.68 + # unpack sources 5.69 + %setup -q 5.70 + 5.71 +%build 5.72 + # prepare configuration 5.73 + CC="%{l_cc}" \ 5.74 + CXX="%{l_cxx}" \ 5.75 + CFLAGS="%{l_cflags -O}" \ 5.76 + CXXFLAGS="%{l_cxxflags -O}" \ 5.77 + CPPFLAGS="%{l_cppflags}" \ 5.78 + LDFLAGS="%{l_ldflags}" \ 5.79 + ./configure \ 5.80 + --prefix=%{l_prefix} \ 5.81 + --disable-shared 5.82 + 5.83 + # build using parallel make 5.84 + %{l_make} %{l_mflags -O} 5.85 + 5.86 +%install 5.87 + # remove previously existing installations 5.88 + rm -rf $RPM_BUILD_ROOT 5.89 + 5.90 + # run the native installation logic 5.91 + %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT 5.92 + 5.93 + # strip binaries of symbols 5.94 + strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true 5.95 + 5.96 + # determine installation files 5.97 + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} 5.98 + 5.99 +%files -f files 5.100 + 5.101 +%clean 5.102 + rm -rf $RPM_BUILD_ROOT 5.103 +
6.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 6.2 +++ b/tun/tun.patch Mon Jan 12 19:09:19 2009 +0100 6.3 @@ -0,0 +1,53 @@ 6.4 +Index: linux/2.2/tun.c 6.5 +--- linux/2.2/tun.c.orig 2006-10-10 14:45:00.338589000 +0200 6.6 ++++ linux/2.2/tun.c 2006-10-10 14:44:05.695404000 +0200 6.7 +@@ -178,10 +178,22 @@ 6.8 + 6.9 + DBG( KERN_INFO "%s: tun_chr_poll\n", tun->name); 6.10 + 6.11 ++ /* Data written to the /dev/tunX device is immediately placed into a socket buffer, making it 6.12 ++ * available to networking code at the tunX interface. Writes never block. 6.13 ++ * Likewise, data flows from the network stack, through the tunX interface and into the /dev/tun* device, 6.14 ++ * where it is queued, making it available for read(). 6.15 ++ * Thus the character device /dev/tunX is: 6.16 ++ * - readable if data was "transmitted" to the tunX interface and is now queued at the /dev/tunX device. 6.17 ++ * - always writable. 6.18 ++ * Everything written here is equally true of taps. 6.19 ++ * The author made a mistake when implementing this routine; he forgot that the device is always writable. 6.20 ++ * -jeff stearns 22-Dec-2005 6.21 ++ */ 6.22 ++ 6.23 + poll_wait(file, &tun->read_wait, wait); 6.24 + 6.25 + if( skb_queue_len(&tun->txq) ) 6.26 +- return POLLIN | POLLRDNORM; 6.27 ++ return POLLIN | POLLRDNORM | POLLOUT | POLLWRNORM; 6.28 + 6.29 + return POLLOUT | POLLWRNORM; 6.30 + } 6.31 +Index: linux/2.4/tun.c 6.32 +--- linux/2.4/tun.c.orig 2006-10-10 14:41:57.910408000 +0200 6.33 ++++ linux/2.4/tun.c 2006-10-10 14:43:40.067700000 +0200 6.34 +@@ -176,9 +176,21 @@ 6.35 + DBG(KERN_INFO "%s: tun_chr_poll\n", tun->name); 6.36 + 6.37 + poll_wait(file, &tun->read_wait, wait); 6.38 ++ 6.39 ++ /* Data written to the /dev/tunX device is immediately placed into a socket buffer, making it 6.40 ++ * available to networking code at the tunX interface. Writes never block. 6.41 ++ * Likewise, data flows from the network stack, through the tunX interface and into the /dev/tun* device, 6.42 ++ * where it is queued, making it available for read(). 6.43 ++ * Thus the character device /dev/tunX is: 6.44 ++ * - readable if data was "transmitted" to the tunX interface and is now queued at the /dev/tunX device. 6.45 ++ * - always writable. 6.46 ++ * Everything written here is equally true of taps. 6.47 ++ * The author made a mistake when implementing this routine; he forgot that the device is always writable. 6.48 ++ * -jeff stearns 22-Dec-2005 6.49 ++ */ 6.50 + 6.51 + if (skb_queue_len(&tun->txq)) 6.52 +- return POLLIN | POLLRDNORM; 6.53 ++ return POLLIN | POLLRDNORM | POLLOUT | POLLWRNORM; 6.54 + 6.55 + return POLLOUT | POLLWRNORM; 6.56 + }
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 7.2 +++ b/tun/tun.spec Mon Jan 12 19:09:19 2009 +0100 7.3 @@ -0,0 +1,137 @@ 7.4 +## 7.5 +## tun.spec -- OpenPKG RPM Specification 7.6 +## Copyright (c) 2009 Michael Schloh von Bennewitz <michael@schloh.com> 7.7 +## 7.8 +## Permission to use, copy, modify, and distribute this software for 7.9 +## any purpose with or without fee is hereby granted, provided that 7.10 +## the above copyright notice and this permission notice appear in all 7.11 +## copies. 7.12 +## 7.13 +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 7.14 +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 7.15 +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 7.16 +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR 7.17 +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 7.18 +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 7.19 +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 7.20 +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 7.21 +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 7.22 +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 7.23 +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 7.24 +## SUCH DAMAGE. 7.25 +## 7.26 + 7.27 +# MSvB Fixme: Device driver could possibly be stripped 7.28 +# %{l_shtool} install -c -m -s 755 \ 7.29 +# tun $RPM_BUILD_ROOT%{l_prefix}/lib/tun 7.30 + 7.31 +# package information 7.32 +Name: tun 7.33 +Summary: Universal TUN/TAP Device Driver 7.34 +URL: http://vtun.sourceforge.net/tun/ 7.35 +Vendor: Maxim Krasnyansky 7.36 +Packager: Michael Schloh von Bennewitz 7.37 +Distribution: Michael Schloh von Bennewitz 7.38 +Class: EVAL 7.39 +Group: Driver 7.40 +License: GPL 7.41 +Version: 1.1 7.42 +Release: 20090106 7.43 + 7.44 +# list of sources 7.45 +Source0: http://vtun.sourceforge.net/tun/tun-%{version}.tar.gz 7.46 +Patch0: tun.patch 7.47 + 7.48 +# build information 7.49 +Prefix: %{l_prefix} 7.50 +BuildRoot: %{l_buildroot} 7.51 +BuildPreReq: OpenPKG, openpkg >= 20050726 7.52 +PreReq: OpenPKG, openpkg >= 20050726 7.53 +AutoReq: no 7.54 +AutoReqProv: no 7.55 + 7.56 +%description 7.57 + Tun provides packet reception and transmission for user space 7.58 + programs. It can be viewed as a simple Point-to-Point device, which 7.59 + instead of receiving packets from a physical media, receives them 7.60 + from user space program and instead of sending packets via physical 7.61 + media writes them to the user space program. 7.62 + 7.63 +%track 7.64 + prog tun = { 7.65 + version = %{version} 7.66 + url = http://vtun.sourceforge.net/tun/ 7.67 + regex = tun-(__VER__)\.tar\.gz 7.68 + } 7.69 + 7.70 +%prep 7.71 + %setup -q -n tun-%{version} 7.72 + %patch -p0 7.73 + 7.74 +%build 7.75 + CC="%{l_cc}" \ 7.76 + CFLAGS="%{l_cflags -O}" \ 7.77 + ./configure \ 7.78 + --prefix=%{l_prefix} 7.79 + locplat=`grep 'OS_DIR *=' Makefile | sed -e 's;OS_DIR[^=][^=]*= *\([^ ][^ ]*\);\1;'` 7.80 + ( cd $locplat 7.81 + %{l_make} %{l_mflags -O} 7.82 + ) || exit $? 7.83 + 7.84 +%install 7.85 + rm -rf $RPM_BUILD_ROOT 7.86 + %{l_shtool} mkdir -f -p -m 755 \ 7.87 + $RPM_BUILD_ROOT%{l_prefix}/lib/tun 7.88 + locplat=`grep 'OS_DIR *=' Makefile | sed -e 's;OS_DIR[^=][^=]*= *\([^ ][^ ]*\);\1;'` 7.89 + ( cd $locplat 7.90 + %{l_shtool} install -c -m 644 \ 7.91 + tun tun.conf if_tun.h $RPM_BUILD_ROOT%{l_prefix}/lib/tun 7.92 + ) || exit $? 7.93 + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} 7.94 + 7.95 +%files -f files 7.96 + 7.97 +%clean 7.98 + rm -rf $RPM_BUILD_ROOT 7.99 + 7.100 +%post 7.101 + if [ $1 -eq 1 -o $1 -eq 2 ]; then 7.102 + # announce special nature of this package 7.103 + ( echo "Attention: The special nature of the package contents require privileged" 7.104 + echo "interation, and must be carefully copied and nonportably installed to" 7.105 + echo "system areas outside of the OpenPKG instance." 7.106 + echo "" 7.107 + echo "This package therefore does not conform to basic OpenPKG principles, and" 7.108 + echo "should be removed immediately after its short term utility is exhausted." 7.109 + echo "" 7.110 + echo "To complete the installation on a SVR4 style operating system:" 7.111 + echo "" 7.112 + echo " $ su -" 7.113 + echo " # find %{l_prefix}/lib/tun/ -print" 7.114 + echo " # shtool install -c -m 755 -o root -g sys tun /usr/kernel/drv/" 7.115 + echo " # shtool install -c -m 644 -o root -g sys tun.conf /usr/kernel/drv/" 7.116 + echo " # shtool install -c -m 644 -o root -g bin if_tun.h /usr/include/net/" 7.117 + echo " # /usr/sbin/rem_drv tun" 7.118 + echo " # /usr/sbin/add_drv tun" 7.119 + ) | %{l_rpmtool} msg -b -t notice 7.120 + fi 7.121 + exit 0 7.122 + 7.123 +%postun 7.124 + [ $1 -eq 0 ] || exit 0 7.125 + # announce special nature of this package on uninstall 7.126 + ( echo "Attention: The special nature of the package contents require privileged" 7.127 + echo "interation, and must be carefully deleted and nonportably uninstalled" 7.128 + echo "from system areas outside of the OpenPKG instance." 7.129 + echo "" 7.130 + echo " $ su -" 7.131 + echo " # ls -ld /usr/kernel/drv/*tun* /usr/include/net/*tun*" 7.132 + echo " # /usr/sbin/rem_drv tun" 7.133 + echo " # ls -ld /usr/kernel/drv/*tun*" 7.134 + echo " # ls -ld /usr/include/net/*tun*" 7.135 + echo " # rm -f /usr/kernel/drv/tun" 7.136 + echo " # rm -f /usr/kernel/drv/tun.conf" 7.137 + echo " # rm -f /usr/include/net/if_tun.h" 7.138 + ) | %{l_rpmtool} msg -b -t notice 7.139 + exit 0 7.140 +