Wed, 14 Jan 2009 15:59:12 +0100
Correct and improve many buildconf and code logic blocks. In particular:
1. Document potential problems building with current binutils releases.
2. Document the flawed webkit and explain its temporary exclusion.
3. Document the edition of Qt which is built and installed.
4. Remove the Solaris x11_supdir logic as it is no longer found.
5. Correct several .pr[io] files including QMAKE_CXXFLAGS and INCPATH,
which previously caused preexisting Qt installations to deliver
erroneous old include and library logic instead of relying on
that of the currently building package. -I/opkg/include is now
placed at the end of the compile statements.
6. Don't trust the QMAKE_[INC|LIB]DIR_X11 identifiers in qmake.conf.
7. Allow more 64-bit builds and more properly identify the platform.
8. Place plugins (which are shared objects) in lib instead of share.
9. Build components as plugins when possible if with_shared is enabled.
10. Translate German text to English to be more consistent.
11. Instead of removing the pkgconfig directory of with_shared builds,
place it in a child directory useful for shared building.
12. Document the nonstandard shared build directory structure,
including using the hidden pkgconfig directory (PKG_CONFIG_PATH.)
13. Change %doc to specify files rather than directories in the RPM DB.
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, make
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 $RPM_BUILD_ROOT%{l_prefix}/share/libupnp/doc/html/ixml \
117 $RPM_BUILD_ROOT%{l_prefix}/share/libupnp/doc/html/upnp
118 %{l_shtool} install -c -m 644 \
119 docs/dist/html/ixml/* \
120 $RPM_BUILD_ROOT%{l_prefix}/share/libupnp/doc/html/ixml/
121 %{l_shtool} install -c -m 644 \
122 docs/dist/html/upnp/* \
123 $RPM_BUILD_ROOT%{l_prefix}/share/libupnp/doc/html/upnp/
124 %{l_shtool} install -c -m 644 \
125 docs/dist/*.pdf \
126 $RPM_BUILD_ROOT%{l_prefix}/share/libupnp/doc/pdf/
128 # install examples
129 %{l_shtool} mkdir -f -p -m 755 \
130 $RPM_BUILD_ROOT%{l_prefix}/share/libupnp/examples
131 %{l_shtool} install -c -m 755 \
132 upnp/sample/upnp_tv_combo \
133 upnp/sample/upnp_tv_ctrlpt \
134 upnp/sample/upnp_tv_device \
135 $RPM_BUILD_ROOT%{l_prefix}/share/libupnp/examples/
137 # determine installation files
138 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
139 %{l_files_std} \
140 '%doc %{l_prefix}/share/libupnp/doc/html/*/*' \
141 '%doc %{l_prefix}/share/libupnp/doc/pdf/*' \
142 '%not %dir %{l_prefix}/lib/pkgconfig'
144 %files -f files
146 %clean
147 rm -rf $RPM_BUILD_ROOT
149 %post
150 # after installing or upgrading package networking reminder
151 ( echo "Before using UPnP, the network must be able to multicast route."
152 echo "The following command may add a static multicast route:"
153 echo " # route add -net 239.0.0.0 netmask 255.0.0.0 dev eth0"
154 ) | %{l_rpmtool} msg -b -t notice
155 exit 0