gmediaserver/gmediaserver.spec

Sun, 03 Apr 2011 13:34:55 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sun, 03 Apr 2011 13:34:55 +0200
changeset 337
f71e028eb3e2
parent 85
e6a1cd7ed6ba
child 387
33ae2d61c751
permissions
-rw-r--r--

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@75 1 ##
michael@75 2 ## gmediaserver.spec -- OpenPKG RPM Specification
michael@75 3 ## Copyright (c) 2009 Michael Schloh von Bennewitz <michael@schloh.com>
michael@75 4 ##
michael@75 5 ## Permission to use, copy, modify, and distribute this software for
michael@75 6 ## any purpose with or without fee is hereby granted, provided that
michael@75 7 ## the above copyright notice and this permission notice appear in all
michael@75 8 ## copies.
michael@75 9 ##
michael@75 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@75 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@75 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@75 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@75 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@75 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@75 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@75 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@75 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@75 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@75 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@75 21 ## SUCH DAMAGE.
michael@75 22 ##
michael@75 23
michael@75 24
michael@75 25 # package information
michael@75 26 Name: gmediaserver
michael@75 27 Summary: UPnP Media Server
michael@75 28 URL: http://www.gnu.org/software/gmediaserver/
michael@75 29 Vendor: Oskar Liljeblad
michael@75 30 Packager: Michael Schloh von Bennewitz
michael@75 31 Distribution: Michael Schloh von Bennewitz
michael@75 32 Class: EVAL
michael@75 33 Group: Network
michael@75 34 License: GPL
michael@75 35 Version: 0.13.0
michael@75 36 Release: 20090106
michael@75 37
michael@75 38 # package options
michael@75 39 %option with_fsl yes
michael@75 40
michael@75 41 # list of sources
michael@75 42 Source0: http://www.very-clever.com/download/nongnu/gmediaserver/gmediaserver-%{version}.tar.gz
michael@75 43 Source1: rc.gmediaserver
michael@75 44 Source2: fsl.gmediaserver
michael@75 45 Patch0: gmediaserver.patch
michael@75 46
michael@75 47 # build information
michael@75 48 Prefix: %{l_prefix}
michael@75 49 BuildRoot: %{l_buildroot}
michael@85 50 BuildPreReq: OpenPKG, openpkg >= 20040130, make, gcc
michael@85 51 PreReq: OpenPKG, openpkg >= 20040130
michael@75 52 BuildPreReq: libupnp, file, id3lib, taglib
michael@75 53 PreReq: libupnp, file, id3lib, taglib
michael@75 54 %if "%{with_fsl}" == "yes"
michael@75 55 BuildPreReq: fsl >= 1.2.0
michael@75 56 PreReq: fsl >= 1.2.0
michael@75 57 %endif
michael@75 58 AutoReq: no
michael@75 59 AutoReqProv: no
michael@75 60
michael@75 61 %description
michael@75 62 GMediaServer is a console based UPnP compatible media server.
michael@75 63 It serves audio and video files to those network connected media
michael@75 64 players capable of receiving media over UPnP.
michael@75 65
michael@75 66 %track
michael@75 67 prog gmediaserver = {
michael@75 68 version = %{version}
michael@75 69 url = http://www.very-clever.com/download/nongnu/gmediaserver/
michael@75 70 regex = gmediaserver-(__VER__)\.tar\.gz
michael@75 71 }
michael@75 72
michael@75 73 %prep
michael@75 74 # unpack sources
michael@75 75 %setup -q
michael@75 76 %patch -p0
michael@75 77
michael@75 78 # correct build configuration
michael@75 79 %{l_shtool} subst \
michael@75 80 -e 's;\(LIBS="-lupnp\) \(\$LIBS"\);\1 -lixml -lthreadutil \2;' \
michael@75 81 -e 's;\(UPNP_LIBS="\$PTHREAD_LIBS -L\$prefixupnp/lib -lupnp\);\1 -lixml -lthreadutil;' \
michael@75 82 -e 's;\(LIBMAGIC=\)\(-lmagic\);\1"\2 -lz";' \
michael@75 83 configure
michael@75 84 %{l_shtool} subst \
michael@75 85 -e 's/tm.tm_zone = "GMT";/tzname[0] = "GMT";/' \
michael@75 86 src/webclient.c
michael@75 87
michael@75 88 %build
michael@75 89 # prepare configuration
michael@75 90 CC="%{l_cc}" \
michael@75 91 CFLAGS="%{l_cflags -O} -pthread" \
michael@75 92 CPPFLAGS="%{l_cppflags}" \
michael@75 93 LDFLAGS="%{l_ldflags} %{l_fsl_ldflags} -pthread" \
michael@75 94 LIBS="%{l_fsl_libs}" \
michael@75 95 GREP="grep" \
michael@75 96 ./configure \
michael@75 97 --prefix=%{l_prefix} \
michael@75 98 --disable-nls
michael@75 99
michael@75 100 # use the internal getopt definitions
michael@75 101 cd lib && %{l_make} %{l_mflags} getopt.h iconv_.h
michael@75 102
michael@75 103 # build using parallel make
michael@75 104 %{l_make} %{l_mflags -O}
michael@75 105
michael@75 106 %install
michael@75 107 # remove previously existing installations
michael@75 108 rm -rf $RPM_BUILD_ROOT
michael@75 109
michael@75 110 # run the native installation logic
michael@75 111 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
michael@75 112
michael@75 113 # create additional installation paths
michael@75 114 %{l_shtool} mkdir -f -p -m 755 \
michael@89 115 $RPM_BUILD_ROOT%{l_prefix}/share/gmediaserver \
michael@75 116 $RPM_BUILD_ROOT%{l_prefix}/var/gmediaserver/log \
michael@75 117 $RPM_BUILD_ROOT%{l_prefix}/var/gmediaserver/run
michael@75 118
michael@75 119 # correct the installation hierarchy
michael@75 120 mv $RPM_BUILD_ROOT%{l_prefix}/share/man \
michael@75 121 $RPM_BUILD_ROOT%{l_prefix}/
michael@75 122 mv $RPM_BUILD_ROOT%{l_prefix}/share/info \
michael@75 123 $RPM_BUILD_ROOT%{l_prefix}/
michael@75 124
michael@75 125 # strip binaries laden with symbols
michael@75 126 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
michael@75 127
michael@75 128 # install runcommand script
michael@75 129 %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
michael@75 130 %{l_shtool} install -c -m 755 %{l_value -s -a} \
michael@75 131 %{SOURCE rc.gmediaserver} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
michael@75 132
michael@75 133 # install OSSP fsl configuration
michael@75 134 %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
michael@75 135 %{l_shtool} install -c -m 644 %{l_value -s -a} \
michael@75 136 %{SOURCE fsl.gmediaserver} \
michael@75 137 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
michael@75 138
michael@75 139 # determine installation files
michael@75 140 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
michael@75 141 %{l_files_std} \
michael@75 142 '%not %dir %{l_prefix}/etc/fsl' \
michael@75 143 '%config %{l_prefix}/etc/fsl/fsl.gmediaserver'
michael@75 144
michael@75 145 %files -f files
michael@75 146
michael@75 147 %clean
michael@75 148 rm -rf $RPM_BUILD_ROOT
michael@75 149
michael@75 150 %pre
michael@75 151 # before upgrading package, record runtime status and stop service
michael@75 152 [ $1 -eq 2 ] || exit 0
michael@75 153 eval `%{l_rc} gmediaserver status 2>/dev/null | tee %{l_tmpfile}`
michael@75 154 %{l_rc} gmediaserver stop 2>/dev/null
michael@75 155 exit 0
michael@75 156
michael@75 157 %post
michael@75 158 if [ $1 -eq 2 ]; then
michael@75 159 # after upgrading package, restore runtime status
michael@75 160 eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile} >/dev/null 2>&1 || true
michael@89 161 [ ".$gmediaserver_active" = .yes ] && sleep 2 && %{l_rc} gmediaserver start
michael@75 162 fi
michael@75 163 exit 0
michael@75 164
michael@75 165 %preun
michael@75 166 # before removing package, stop service and remove log files
michael@75 167 [ $1 -eq 0 ] || exit 0
michael@75 168 %{l_rc} gmediaserver stop 2>/dev/null
michael@75 169 rm -f $RPM_INSTALL_PREFIX/var/gmediaserver/log/* >/dev/null 2>&1 || true
michael@75 170 exit 0
michael@75 171

mercurial