1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/libupnp/libupnp.spec Mon Jan 12 17:10:13 2009 +0100 1.3 @@ -0,0 +1,148 @@ 1.4 +## 1.5 +## libupnp.spec -- OpenPKG RPM Specification 1.6 +## Copyright (c) 2009 Michael Schloh von Bennewitz <michael@schloh.com> 1.7 +## 1.8 +## Permission to use, copy, modify, and distribute this software for 1.9 +## any purpose with or without fee is hereby granted, provided that 1.10 +## the above copyright notice and this permission notice appear in all 1.11 +## copies. 1.12 +## 1.13 +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 1.14 +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 1.15 +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 1.16 +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR 1.17 +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 1.18 +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 1.19 +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 1.20 +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 1.21 +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 1.22 +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 1.23 +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 1.24 +## SUCH DAMAGE. 1.25 +## 1.26 + 1.27 + 1.28 +# package information 1.29 +Name: libupnp 1.30 +Summary: Universal Plug and Play (UPnP) SDK 1.31 +URL: http://pupnp.sourceforge.net/ 1.32 +Vendor: Michel Pfeiffer 1.33 +Packager: Michael Schloh von Bennewitz 1.34 +Distribution: Michael Schloh von Bennewitz 1.35 +Class: EVAL 1.36 +Group: Network 1.37 +License: BSD 1.38 +Version: 1.6.6 1.39 +Release: 20090106 1.40 + 1.41 +# list of sources 1.42 +Source0: http://switch.dl.sourceforge.net/pupnp/libupnp-%{version}.tar.bz2 1.43 +Patch0: libupnp.patch 1.44 + 1.45 +# build information 1.46 +Prefix: %{l_prefix} 1.47 +BuildRoot: %{l_buildroot} 1.48 +BuildPreReq: OpenPKG, openpkg >= 20040130 1.49 +PreReq: OpenPKG, openpkg >= 20040130 1.50 +AutoReq: no 1.51 +AutoReqProv: no 1.52 + 1.53 +%description 1.54 + The portable Universal Plug and Play (UPnP) SDK provides support 1.55 + for building UPnP compliant control points, devices, and bridges 1.56 + that are compliant with version 1.0 of the Universal Plug and 1.57 + Play device architecture specification. 1.58 + 1.59 +%track 1.60 + prog libupnp = { 1.61 + version = %{version} 1.62 + url = http://prdownloads.sourceforge.net/upnp/ 1.63 + regex = libupnp-(__VER__)\.tar\.bz2 1.64 + } 1.65 + 1.66 +%prep 1.67 + # unpack sources 1.68 + %setup -q 1.69 + %patch -p0 1.70 + 1.71 + # apply coorections 1.72 + %{l_shtool} subst \ 1.73 + -e 's;#if defined(_sun);#if (defined(sun) \&\& defined(__svr4__));' \ 1.74 + upnp/src/api/upnpapi.c 1.75 + %{l_shtool} subst \ 1.76 + -e 's;defined(SPARC_SOLARIS);(defined(sun) \&\& defined(__svr4__));' \ 1.77 + upnp/src/genlib/net/uri/uri.c 1.78 + %{l_shtool} subst \ 1.79 + -e 's;\(uuid_create_from_name\);\1_upnp;g' \ 1.80 + -e 's;\(uuid_compare\);\1_upnp;g' \ 1.81 + -e 's;\(uuid_create\);\1_upnp;g' \ 1.82 + -e 's;\(uuid_unpack\);\1_upnp;g' \ 1.83 + upnp/src/gena/gena_device.c \ 1.84 + upnp/src/gena/gena_ctrlpt.c \ 1.85 + upnp/src/uuid/uuid.c \ 1.86 + upnp/src/inc/uuid.h 1.87 + %{l_shtool} subst \ 1.88 + -e 's;\(PTHREAD_MUTEX_[^_]*\)_NP;\1;g' \ 1.89 + -e 's;\(pthread_mutexattr_[gs]et\)kind_np;\1type;g' \ 1.90 + threadutil/inc/ithread.h 1.91 + 1.92 +%build 1.93 + # query for platform specific libraries 1.94 + loclibs="" 1.95 + case "%{l_platform -t}" in 1.96 + *-sunos* ) loclibs="-lsocket -lnsl -lrt" ;; 1.97 + esac 1.98 + 1.99 + # prepare build configuration 1.100 + CC="%{l_cc}" \ 1.101 + CFLAGS="%{l_cflags -O}" \ 1.102 + CPPFLAGS="%{l_cppflags}" \ 1.103 + LDFLAGS="%{l_ldflags}" \ 1.104 + LIBS="$loclibs" \ 1.105 + ./configure \ 1.106 + --prefix=%{l_prefix} \ 1.107 + --disable-shared 1.108 + 1.109 + # build using parallel make 1.110 + %{l_make} %{l_mflags -O} 1.111 + 1.112 +%install 1.113 + # remove previously existing installations 1.114 + rm -rf $RPM_BUILD_ROOT 1.115 + 1.116 + # run the native installation logic 1.117 + %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT 1.118 + 1.119 + # install docs 1.120 + %{l_shtool} mkdir -f -p -m 755 \ 1.121 + $RPM_BUILD_ROOT%{l_prefix}/share/libupnp/doc/pdf 1.122 + %{l_shtool} install -c -m 755 \ 1.123 + docs/dist/html $RPM_BUILD_ROOT%{l_prefix}/share/libupnp/doc/ 1.124 + %{l_shtool} install -c -m 644 \ 1.125 + docs/dist/*.pdf $RPM_BUILD_ROOT%{l_prefix}/share/libupnp/doc/pdf/ 1.126 + 1.127 + # install examples 1.128 + %{l_shtool} mkdir -f -p -m 755 \ 1.129 + $RPM_BUILD_ROOT%{l_prefix}/share/libupnp/examples 1.130 + %{l_shtool} install -c -m 755 \ 1.131 + upnp/sample/upnp_tv_combo \ 1.132 + upnp/sample/upnp_tv_ctrlpt \ 1.133 + upnp/sample/upnp_tv_device \ 1.134 + $RPM_BUILD_ROOT%{l_prefix}/share/libupnp/examples/ 1.135 + 1.136 + # determine installation files 1.137 + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} 1.138 + 1.139 +%files -f files 1.140 + 1.141 +%clean 1.142 + rm -rf $RPM_BUILD_ROOT 1.143 + 1.144 +%post 1.145 + # after installing or upgrading package networking reminder 1.146 + ( echo "Before using UPnP, the network must be able to multicast route." 1.147 + echo "The following command may add a static multicast route:" 1.148 + echo " # route add -net 239.0.0.0 netmask 255.0.0.0 eth0" 1.149 + ) | %{l_rpmtool} msg -b -t notice 1.150 + exit 0 1.151 +