libupnp/libupnp.spec

Tue, 29 Mar 2011 20:04:34 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 29 Mar 2011 20:04:34 +0200
changeset 334
4a34d7a82eab
parent 84
944803a4d3f3
child 387
33ae2d61c751
permissions
-rw-r--r--

Rework package yet again, correcting and introducing new buildconf logic:
Conditionally disable bootstrap stage comparison correctly, correct
english grammar, better find system as(1) and ld(1), indotruce detailed
optimization option messages, more completely guess cpu types, allow
profiled bootstrapping without a preinstalled GCC because many other
compilers have long since implemented 64-bit arithmetic, instruct make
to build sequentially (not in sparallel) when building a profiled
bootstrap as GCC online documents recommend, and generally improve
comment blocks.

The single most important correction in this changeset relates to the
GCC changed optimization policy since at least GCC 4.5, in which -march
is always passed and not always correctly guessed. In the case of this
package, allowing GCC to guess the architecture leads to wild build
errors at various subcomponents (zlib, libgcc, libiberty...) and
bootstrap stages. It seems quite platform specific, and the safest
approach to correcting this seems to be explicitly always specifying the
-march argument when bootstrapping GCC. Because the best choice 'native'
is not available when bootstrapping using a foreign (non GCC) compiler,
a guess is made according to rpmmacros l_platform in that case.

It is questionable as to whether these recent optimization changes
on the part of GCC or this package are compatible with each other,
or if either are complete or correct at all. At least applying these
corrections allows this package to build again in most cases test.

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

mercurial