Sun, 03 Apr 2011 13:34:55 +0200
Correct and improve several packaging aspects including...
Correct datadir path for python modules, correct jar(1) path for
building libgcj classes, strip libexecdir path of version numbers,
improve name of oblbld build path, clean whitespace from as(1) and
ld(1) GNU detection, remove seemingly discarded '--with-local-prefix'
configure argument, and correct hardcoded lto plugin libtool archive
dependency information.
Most importantly, correct IA32 architecture detection logic in
config.gcc to correctly emit SSE2 instructions conditionally, leading
to the removal of all '-march' bootstrap options and replacement with
unconditional (for IA32/AMD64) '-mtune=native' options. Comments and
buildtime warnings are corrected appropriately. In theory these changes
cause a more portable, orthoganal, and optimal bootstrap to be built.
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 |