libupnp/libupnp.spec

Mon, 12 Jan 2009 17:12:14 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Mon, 12 Jan 2009 17:12:14 +0100
changeset 71
4f2be5694fa1
parent 70
1b746d93c8f0
child 72
925d35999964
permissions
-rw-r--r--

Remove substitutions irrelevant to newer vendor dist and Solaris OS.

michael@70 1 ##
michael@70 2 ## libupnp.spec -- OpenPKG RPM Specification
michael@70 3 ## Copyright (c) 2009 Michael Schloh von Bennewitz <michael@schloh.com>
michael@70 4 ##
michael@70 5 ## Permission to use, copy, modify, and distribute this software for
michael@70 6 ## any purpose with or without fee is hereby granted, provided that
michael@70 7 ## the above copyright notice and this permission notice appear in all
michael@70 8 ## copies.
michael@70 9 ##
michael@70 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@70 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@70 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@70 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@70 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@70 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@70 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@70 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@70 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@70 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@70 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@70 21 ## SUCH DAMAGE.
michael@70 22 ##
michael@70 23
michael@70 24
michael@70 25 # package information
michael@70 26 Name: libupnp
michael@70 27 Summary: Universal Plug and Play (UPnP) SDK
michael@70 28 URL: http://pupnp.sourceforge.net/
michael@70 29 Vendor: Michel Pfeiffer
michael@70 30 Packager: Michael Schloh von Bennewitz
michael@70 31 Distribution: Michael Schloh von Bennewitz
michael@70 32 Class: EVAL
michael@70 33 Group: Network
michael@70 34 License: BSD
michael@70 35 Version: 1.6.6
michael@70 36 Release: 20090106
michael@70 37
michael@70 38 # list of sources
michael@70 39 Source0: http://switch.dl.sourceforge.net/pupnp/libupnp-%{version}.tar.bz2
michael@70 40 Patch0: libupnp.patch
michael@70 41
michael@70 42 # build information
michael@70 43 Prefix: %{l_prefix}
michael@70 44 BuildRoot: %{l_buildroot}
michael@70 45 BuildPreReq: OpenPKG, openpkg >= 20040130
michael@70 46 PreReq: OpenPKG, openpkg >= 20040130
michael@70 47 AutoReq: no
michael@70 48 AutoReqProv: no
michael@70 49
michael@70 50 %description
michael@70 51 The portable Universal Plug and Play (UPnP) SDK provides support
michael@70 52 for building UPnP compliant control points, devices, and bridges
michael@70 53 that are compliant with version 1.0 of the Universal Plug and
michael@70 54 Play device architecture specification.
michael@70 55
michael@70 56 %track
michael@70 57 prog libupnp = {
michael@70 58 version = %{version}
michael@70 59 url = http://prdownloads.sourceforge.net/upnp/
michael@70 60 regex = libupnp-(__VER__)\.tar\.bz2
michael@70 61 }
michael@70 62
michael@70 63 %prep
michael@70 64 # unpack sources
michael@70 65 %setup -q
michael@70 66 %patch -p0
michael@70 67
michael@70 68 # apply coorections
michael@70 69 %{l_shtool} subst \
michael@70 70 -e 's;#if defined(_sun);#if (defined(sun) \&\& defined(__svr4__));' \
michael@70 71 upnp/src/api/upnpapi.c
michael@70 72 %{l_shtool} subst \
michael@70 73 -e 's;defined(SPARC_SOLARIS);(defined(sun) \&\& defined(__svr4__));' \
michael@70 74 upnp/src/genlib/net/uri/uri.c
michael@70 75 %{l_shtool} subst \
michael@70 76 -e 's;\(uuid_create_from_name\);\1_upnp;g' \
michael@70 77 -e 's;\(uuid_compare\);\1_upnp;g' \
michael@70 78 -e 's;\(uuid_create\);\1_upnp;g' \
michael@70 79 -e 's;\(uuid_unpack\);\1_upnp;g' \
michael@70 80 upnp/src/gena/gena_device.c \
michael@70 81 upnp/src/gena/gena_ctrlpt.c \
michael@70 82 upnp/src/uuid/uuid.c \
michael@70 83 upnp/src/inc/uuid.h
michael@70 84
michael@70 85 %build
michael@70 86 # query for platform specific libraries
michael@70 87 loclibs=""
michael@70 88 case "%{l_platform -t}" in
michael@70 89 *-sunos* ) loclibs="-lsocket -lnsl -lrt" ;;
michael@70 90 esac
michael@70 91
michael@70 92 # prepare build configuration
michael@70 93 CC="%{l_cc}" \
michael@70 94 CFLAGS="%{l_cflags -O}" \
michael@70 95 CPPFLAGS="%{l_cppflags}" \
michael@70 96 LDFLAGS="%{l_ldflags}" \
michael@70 97 LIBS="$loclibs" \
michael@70 98 ./configure \
michael@70 99 --prefix=%{l_prefix} \
michael@70 100 --disable-shared
michael@70 101
michael@70 102 # build using parallel make
michael@70 103 %{l_make} %{l_mflags -O}
michael@70 104
michael@70 105 %install
michael@70 106 # remove previously existing installations
michael@70 107 rm -rf $RPM_BUILD_ROOT
michael@70 108
michael@70 109 # run the native installation logic
michael@70 110 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
michael@70 111
michael@70 112 # install docs
michael@70 113 %{l_shtool} mkdir -f -p -m 755 \
michael@70 114 $RPM_BUILD_ROOT%{l_prefix}/share/libupnp/doc/pdf
michael@70 115 %{l_shtool} install -c -m 755 \
michael@70 116 docs/dist/html $RPM_BUILD_ROOT%{l_prefix}/share/libupnp/doc/
michael@70 117 %{l_shtool} install -c -m 644 \
michael@70 118 docs/dist/*.pdf $RPM_BUILD_ROOT%{l_prefix}/share/libupnp/doc/pdf/
michael@70 119
michael@70 120 # install examples
michael@70 121 %{l_shtool} mkdir -f -p -m 755 \
michael@70 122 $RPM_BUILD_ROOT%{l_prefix}/share/libupnp/examples
michael@70 123 %{l_shtool} install -c -m 755 \
michael@70 124 upnp/sample/upnp_tv_combo \
michael@70 125 upnp/sample/upnp_tv_ctrlpt \
michael@70 126 upnp/sample/upnp_tv_device \
michael@70 127 $RPM_BUILD_ROOT%{l_prefix}/share/libupnp/examples/
michael@70 128
michael@70 129 # determine installation files
michael@70 130 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
michael@70 131
michael@70 132 %files -f files
michael@70 133
michael@70 134 %clean
michael@70 135 rm -rf $RPM_BUILD_ROOT
michael@70 136
michael@70 137 %post
michael@70 138 # after installing or upgrading package networking reminder
michael@70 139 ( echo "Before using UPnP, the network must be able to multicast route."
michael@70 140 echo "The following command may add a static multicast route:"
michael@70 141 echo " # route add -net 239.0.0.0 netmask 255.0.0.0 eth0"
michael@70 142 ) | %{l_rpmtool} msg -b -t notice
michael@70 143 exit 0
michael@70 144

mercurial