Tue, 13 Jan 2009 18:51:31 +0100
Add forgotten RPM database identifers for pkgconfig and doc directories.
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 GREP=grep \
99 ./configure \
100 --prefix=%{l_prefix} \
101 --disable-shared
103 # build using parallel make
104 %{l_make} %{l_mflags -O}
106 %install
107 # remove previously existing installations
108 rm -rf $RPM_BUILD_ROOT
110 # run the native installation logic
111 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
113 # install docs
114 %{l_shtool} mkdir -f -p -m 755 \
115 $RPM_BUILD_ROOT%{l_prefix}/share/libupnp/doc/pdf
116 %{l_shtool} install -c -m 755 \
117 docs/dist/html $RPM_BUILD_ROOT%{l_prefix}/share/libupnp/doc/
118 %{l_shtool} install -c -m 644 \
119 docs/dist/*.pdf $RPM_BUILD_ROOT%{l_prefix}/share/libupnp/doc/pdf/
121 # install examples
122 %{l_shtool} mkdir -f -p -m 755 \
123 $RPM_BUILD_ROOT%{l_prefix}/share/libupnp/examples
124 %{l_shtool} install -c -m 755 \
125 upnp/sample/upnp_tv_combo \
126 upnp/sample/upnp_tv_ctrlpt \
127 upnp/sample/upnp_tv_device \
128 $RPM_BUILD_ROOT%{l_prefix}/share/libupnp/examples/
130 # determine installation files
131 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
132 '%doc %{l_prefix}/share/libupnp/doc/*' \
133 '%doc %{l_prefix}/share/libupnp/doc/*/*' \
134 '%not %dir %{l_prefix}/lib/pkgconfig'
136 %files -f files
138 %clean
139 rm -rf $RPM_BUILD_ROOT
141 %post
142 # after installing or upgrading package networking reminder
143 ( echo "Before using UPnP, the network must be able to multicast route."
144 echo "The following command may add a static multicast route:"
145 echo " # route add -net 239.0.0.0 netmask 255.0.0.0 eth0"
146 ) | %{l_rpmtool} msg -b -t notice
147 exit 0