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