srtp/srtp.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
child 366
a8a705664ef9
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@309 1 ##
michael@309 2 ## srtp.spec -- OpenPKG RPM Package Specification
michael@309 3 ## Copyright (c) 2011 Michael Schloh von Bennewitz <michael@schloh.com>
michael@309 4 ##
michael@309 5 ## Permission to use, copy, modify, and distribute this software for
michael@309 6 ## any purpose with or without fee is hereby granted, provided that
michael@309 7 ## the above copyright notice and this permission notice appear in all
michael@309 8 ## copies.
michael@309 9 ##
michael@309 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@309 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@309 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@309 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@309 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@309 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@309 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@309 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@309 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@309 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@309 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@309 21 ## SUCH DAMAGE.
michael@309 22 ##
michael@309 23
michael@309 24 # package information
michael@309 25 Name: srtp
michael@309 26 Summary: Secure Real-time Transport Protocol
michael@309 27 URL: http://srtp.sourceforge.net/srtp.html
michael@309 28 Vendor: David McGrew
michael@309 29 Packager: Michael Schloh von Bennewitz
michael@309 30 Distribution: Europalab Production
michael@309 31 Class: EVAL
michael@309 32 Group: Cryptography
michael@309 33 License: BSD
michael@309 34 Version: 1.4.4.2
michael@309 35 Release: 20110300
michael@309 36
michael@309 37 # list of sources
michael@309 38 Source0: http://switch.dl.sourceforge.net/project/srtp/srtp/%{version}/srtp-%{version}.tar.bz2
michael@309 39 #Source0: cvs -d :pserver:anonymous@srtp.cvs.sourceforge.net:/cvsroot/srtp co -P srtp
michael@309 40 #Source0: http://srtp.sourceforge.net/srtp-%{version}.tar.gz
michael@309 41
michael@309 42 # build information
michael@309 43 Prefix: %{l_prefix}
michael@309 44 BuildRoot: %{l_buildroot}
michael@309 45 BuildPreReq: OpenPKG, openpkg >= 20040130
michael@309 46 PreReq: OpenPKG, openpkg >= 20040130
michael@309 47 AutoReq: no
michael@309 48 AutoReqProv: no
michael@309 49
michael@309 50 %description
michael@309 51 The libSRTP library is an open source implementation of the Secure Realtime
michael@309 52 Transport Protocol (SRTP.) SRTP is a security profile for RTP that adds
michael@309 53 confidentiality, message authentication, and replay protection to that
michael@309 54 protocol. It is specified in RFC 3711.
michael@309 55
michael@309 56 %track
michael@309 57 prog srtp = {
michael@309 58 version = %{version}
michael@309 59 url = http://srtp.sourceforge.net/
michael@309 60 regex = srtp-(__VER__)\.tar.bz2
michael@309 61 }
michael@309 62
michael@309 63 %prep
michael@309 64 # unpack sources
michael@309 65 %setup -q -n %{name}-%{version}
michael@309 66
michael@309 67 %build
michael@309 68 # prepare build configuration
michael@309 69 CC="%{l_cc}" \
michael@309 70 CFLAGS="%{l_cflags -O}" \
michael@309 71 CPPFLAGS="%{l_cppflags}" \
michael@309 72 LDFLAGS="%{l_ldflags}" \
michael@309 73 ./configure \
michael@309 74 --prefix=%{l_prefix}
michael@309 75
michael@309 76 # build using parallel make
michael@309 77 %{l_make} %{l_mflags -O}
michael@309 78
michael@309 79 %install
michael@309 80 # remove previously existing installations
michael@309 81 rm -rf $RPM_BUILD_ROOT
michael@309 82
michael@309 83 # run the native installation logic
michael@309 84 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
michael@309 85
michael@309 86 # determine installation files
michael@309 87 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
michael@309 88
michael@309 89 %files -f files
michael@309 90
michael@309 91 %clean
michael@309 92 rm -rf $RPM_BUILD_ROOT
michael@309 93

mercurial