libupnp/libupnp.spec

changeset 70
1b746d93c8f0
child 71
4f2be5694fa1
equal deleted inserted replaced
-1:000000000000 0:ab23cf579aaf
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 ##
23
24
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
37
38 # list of sources
39 Source0: http://switch.dl.sourceforge.net/pupnp/libupnp-%{version}.tar.bz2
40 Patch0: libupnp.patch
41
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
49
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.
55
56 %track
57 prog libupnp = {
58 version = %{version}
59 url = http://prdownloads.sourceforge.net/upnp/
60 regex = libupnp-(__VER__)\.tar\.bz2
61 }
62
63 %prep
64 # unpack sources
65 %setup -q
66 %patch -p0
67
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
84 %{l_shtool} subst \
85 -e 's;\(PTHREAD_MUTEX_[^_]*\)_NP;\1;g' \
86 -e 's;\(pthread_mutexattr_[gs]et\)kind_np;\1type;g' \
87 threadutil/inc/ithread.h
88
89 %build
90 # query for platform specific libraries
91 loclibs=""
92 case "%{l_platform -t}" in
93 *-sunos* ) loclibs="-lsocket -lnsl -lrt" ;;
94 esac
95
96 # prepare build configuration
97 CC="%{l_cc}" \
98 CFLAGS="%{l_cflags -O}" \
99 CPPFLAGS="%{l_cppflags}" \
100 LDFLAGS="%{l_ldflags}" \
101 LIBS="$loclibs" \
102 ./configure \
103 --prefix=%{l_prefix} \
104 --disable-shared
105
106 # build using parallel make
107 %{l_make} %{l_mflags -O}
108
109 %install
110 # remove previously existing installations
111 rm -rf $RPM_BUILD_ROOT
112
113 # run the native installation logic
114 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
115
116 # install docs
117 %{l_shtool} mkdir -f -p -m 755 \
118 $RPM_BUILD_ROOT%{l_prefix}/share/libupnp/doc/pdf
119 %{l_shtool} install -c -m 755 \
120 docs/dist/html $RPM_BUILD_ROOT%{l_prefix}/share/libupnp/doc/
121 %{l_shtool} install -c -m 644 \
122 docs/dist/*.pdf $RPM_BUILD_ROOT%{l_prefix}/share/libupnp/doc/pdf/
123
124 # install examples
125 %{l_shtool} mkdir -f -p -m 755 \
126 $RPM_BUILD_ROOT%{l_prefix}/share/libupnp/examples
127 %{l_shtool} install -c -m 755 \
128 upnp/sample/upnp_tv_combo \
129 upnp/sample/upnp_tv_ctrlpt \
130 upnp/sample/upnp_tv_device \
131 $RPM_BUILD_ROOT%{l_prefix}/share/libupnp/examples/
132
133 # determine installation files
134 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
135
136 %files -f files
137
138 %clean
139 rm -rf $RPM_BUILD_ROOT
140
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
148

mercurial