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