diff -r 84180bd0cb45 -r 1b746d93c8f0 libupnp/libupnp.spec --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libupnp/libupnp.spec Mon Jan 12 17:10:13 2009 +0100 @@ -0,0 +1,148 @@ +## +## libupnp.spec -- OpenPKG RPM Specification +## Copyright (c) 2009 Michael Schloh von Bennewitz +## +## Permission to use, copy, modify, and distribute this software for +## any purpose with or without fee is hereby granted, provided that +## the above copyright notice and this permission notice appear in all +## copies. +## +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## + + +# package information +Name: libupnp +Summary: Universal Plug and Play (UPnP) SDK +URL: http://pupnp.sourceforge.net/ +Vendor: Michel Pfeiffer +Packager: Michael Schloh von Bennewitz +Distribution: Michael Schloh von Bennewitz +Class: EVAL +Group: Network +License: BSD +Version: 1.6.6 +Release: 20090106 + +# list of sources +Source0: http://switch.dl.sourceforge.net/pupnp/libupnp-%{version}.tar.bz2 +Patch0: libupnp.patch + +# build information +Prefix: %{l_prefix} +BuildRoot: %{l_buildroot} +BuildPreReq: OpenPKG, openpkg >= 20040130 +PreReq: OpenPKG, openpkg >= 20040130 +AutoReq: no +AutoReqProv: no + +%description + The portable Universal Plug and Play (UPnP) SDK provides support + for building UPnP compliant control points, devices, and bridges + that are compliant with version 1.0 of the Universal Plug and + Play device architecture specification. + +%track + prog libupnp = { + version = %{version} + url = http://prdownloads.sourceforge.net/upnp/ + regex = libupnp-(__VER__)\.tar\.bz2 + } + +%prep + # unpack sources + %setup -q + %patch -p0 + + # apply coorections + %{l_shtool} subst \ + -e 's;#if defined(_sun);#if (defined(sun) \&\& defined(__svr4__));' \ + upnp/src/api/upnpapi.c + %{l_shtool} subst \ + -e 's;defined(SPARC_SOLARIS);(defined(sun) \&\& defined(__svr4__));' \ + upnp/src/genlib/net/uri/uri.c + %{l_shtool} subst \ + -e 's;\(uuid_create_from_name\);\1_upnp;g' \ + -e 's;\(uuid_compare\);\1_upnp;g' \ + -e 's;\(uuid_create\);\1_upnp;g' \ + -e 's;\(uuid_unpack\);\1_upnp;g' \ + upnp/src/gena/gena_device.c \ + upnp/src/gena/gena_ctrlpt.c \ + upnp/src/uuid/uuid.c \ + upnp/src/inc/uuid.h + %{l_shtool} subst \ + -e 's;\(PTHREAD_MUTEX_[^_]*\)_NP;\1;g' \ + -e 's;\(pthread_mutexattr_[gs]et\)kind_np;\1type;g' \ + threadutil/inc/ithread.h + +%build + # query for platform specific libraries + loclibs="" + case "%{l_platform -t}" in + *-sunos* ) loclibs="-lsocket -lnsl -lrt" ;; + esac + + # prepare build configuration + CC="%{l_cc}" \ + CFLAGS="%{l_cflags -O}" \ + CPPFLAGS="%{l_cppflags}" \ + LDFLAGS="%{l_ldflags}" \ + LIBS="$loclibs" \ + ./configure \ + --prefix=%{l_prefix} \ + --disable-shared + + # build using parallel make + %{l_make} %{l_mflags -O} + +%install + # remove previously existing installations + rm -rf $RPM_BUILD_ROOT + + # run the native installation logic + %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT + + # install docs + %{l_shtool} mkdir -f -p -m 755 \ + $RPM_BUILD_ROOT%{l_prefix}/share/libupnp/doc/pdf + %{l_shtool} install -c -m 755 \ + docs/dist/html $RPM_BUILD_ROOT%{l_prefix}/share/libupnp/doc/ + %{l_shtool} install -c -m 644 \ + docs/dist/*.pdf $RPM_BUILD_ROOT%{l_prefix}/share/libupnp/doc/pdf/ + + # install examples + %{l_shtool} mkdir -f -p -m 755 \ + $RPM_BUILD_ROOT%{l_prefix}/share/libupnp/examples + %{l_shtool} install -c -m 755 \ + upnp/sample/upnp_tv_combo \ + upnp/sample/upnp_tv_ctrlpt \ + upnp/sample/upnp_tv_device \ + $RPM_BUILD_ROOT%{l_prefix}/share/libupnp/examples/ + + # determine installation files + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} + +%files -f files + +%clean + rm -rf $RPM_BUILD_ROOT + +%post + # after installing or upgrading package networking reminder + ( echo "Before using UPnP, the network must be able to multicast route." + echo "The following command may add a static multicast route:" + echo " # route add -net 239.0.0.0 netmask 255.0.0.0 eth0" + ) | %{l_rpmtool} msg -b -t notice + exit 0 +