Mon, 12 Jan 2009 17:12:14 +0100
Remove substitutions irrelevant to newer vendor dist and Solaris OS.
1 ##
2 ## libupnp.spec -- OpenPKG RPM Specification
3 ## Copyright (c) 2009 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: Michael Schloh von Bennewitz
32 Class: EVAL
33 Group: Network
34 License: BSD
35 Version: 1.6.6
36 Release: 20090106
38 # list of sources
39 Source0: http://switch.dl.sourceforge.net/pupnp/libupnp-%{version}.tar.bz2
40 Patch0: libupnp.patch
42 # build information
43 Prefix: %{l_prefix}
44 BuildRoot: %{l_buildroot}
45 BuildPreReq: OpenPKG, openpkg >= 20040130
46 PreReq: OpenPKG, openpkg >= 20040130
47 AutoReq: no
48 AutoReqProv: no
50 %description
51 The portable Universal Plug and Play (UPnP) SDK provides support
52 for building UPnP compliant control points, devices, and bridges
53 that are compliant with version 1.0 of the Universal Plug and
54 Play device architecture specification.
56 %track
57 prog libupnp = {
58 version = %{version}
59 url = http://prdownloads.sourceforge.net/upnp/
60 regex = libupnp-(__VER__)\.tar\.bz2
61 }
63 %prep
64 # unpack sources
65 %setup -q
66 %patch -p0
68 # apply coorections
69 %{l_shtool} subst \
70 -e 's;#if defined(_sun);#if (defined(sun) \&\& defined(__svr4__));' \
71 upnp/src/api/upnpapi.c
72 %{l_shtool} subst \
73 -e 's;defined(SPARC_SOLARIS);(defined(sun) \&\& defined(__svr4__));' \
74 upnp/src/genlib/net/uri/uri.c
75 %{l_shtool} subst \
76 -e 's;\(uuid_create_from_name\);\1_upnp;g' \
77 -e 's;\(uuid_compare\);\1_upnp;g' \
78 -e 's;\(uuid_create\);\1_upnp;g' \
79 -e 's;\(uuid_unpack\);\1_upnp;g' \
80 upnp/src/gena/gena_device.c \
81 upnp/src/gena/gena_ctrlpt.c \
82 upnp/src/uuid/uuid.c \
83 upnp/src/inc/uuid.h
85 %build
86 # query for platform specific libraries
87 loclibs=""
88 case "%{l_platform -t}" in
89 *-sunos* ) loclibs="-lsocket -lnsl -lrt" ;;
90 esac
92 # prepare build configuration
93 CC="%{l_cc}" \
94 CFLAGS="%{l_cflags -O}" \
95 CPPFLAGS="%{l_cppflags}" \
96 LDFLAGS="%{l_ldflags}" \
97 LIBS="$loclibs" \
98 ./configure \
99 --prefix=%{l_prefix} \
100 --disable-shared
102 # build using parallel make
103 %{l_make} %{l_mflags -O}
105 %install
106 # remove previously existing installations
107 rm -rf $RPM_BUILD_ROOT
109 # run the native installation logic
110 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
112 # install docs
113 %{l_shtool} mkdir -f -p -m 755 \
114 $RPM_BUILD_ROOT%{l_prefix}/share/libupnp/doc/pdf
115 %{l_shtool} install -c -m 755 \
116 docs/dist/html $RPM_BUILD_ROOT%{l_prefix}/share/libupnp/doc/
117 %{l_shtool} install -c -m 644 \
118 docs/dist/*.pdf $RPM_BUILD_ROOT%{l_prefix}/share/libupnp/doc/pdf/
120 # install examples
121 %{l_shtool} mkdir -f -p -m 755 \
122 $RPM_BUILD_ROOT%{l_prefix}/share/libupnp/examples
123 %{l_shtool} install -c -m 755 \
124 upnp/sample/upnp_tv_combo \
125 upnp/sample/upnp_tv_ctrlpt \
126 upnp/sample/upnp_tv_device \
127 $RPM_BUILD_ROOT%{l_prefix}/share/libupnp/examples/
129 # determine installation files
130 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
132 %files -f files
134 %clean
135 rm -rf $RPM_BUILD_ROOT
137 %post
138 # after installing or upgrading package networking reminder
139 ( echo "Before using UPnP, the network must be able to multicast route."
140 echo "The following command may add a static multicast route:"
141 echo " # route add -net 239.0.0.0 netmask 255.0.0.0 eth0"
142 ) | %{l_rpmtool} msg -b -t notice
143 exit 0