apache/apache.spec

Mon, 28 Jan 2013 17:37:18 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Mon, 28 Jan 2013 17:37:18 +0100
changeset 758
a2c6460cfb16
parent 684
f805be991d7f
permissions
-rw-r--r--

Correct socket error reporting improvement with IPv6 portable code,
after helpful recommendation by Saúl Ibarra Corretgé on OSips devlist.

michael@684 1 ##
michael@684 2 ## apache.spec -- OpenPKG RPM Package Specification
michael@684 3 ## Copyright (c) 2000-2012 OpenPKG Foundation e.V. <http://openpkg.net/>
michael@684 4 ##
michael@684 5 ## Permission to use, copy, modify, and distribute this software for
michael@684 6 ## any purpose with or without fee is hereby granted, provided that
michael@684 7 ## the above copyright notice and this permission notice appear in all
michael@684 8 ## copies.
michael@684 9 ##
michael@684 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@684 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@684 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@684 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@684 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@684 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@684 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@684 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@684 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@684 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@684 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@684 21 ## SUCH DAMAGE.
michael@684 22 ##
michael@684 23
michael@684 24 # package information
michael@684 25 Name: apache
michael@684 26 Summary: Apache HTTP Server
michael@684 27 URL: http://httpd.apache.org/
michael@684 28 Vendor: Apache Software Foundation
michael@684 29 Packager: OpenPKG Foundation e.V.
michael@684 30 Distribution: OpenPKG Community
michael@684 31 Class: BASE
michael@684 32 Group: Web
michael@684 33 License: ASF
michael@684 34 Version: 2.2.22
michael@685 35 Release: 20120800
michael@684 36
michael@684 37 # package options
michael@684 38 %option with_mpm_prefork yes
michael@684 39 %option with_mpm_worker no
michael@684 40 %option with_mpm_event no
michael@684 41 %option with_suexec yes
michael@684 42 %option with_suexec_caller %{l_nusr}
michael@684 43 %option with_suexec_userdir public_html
michael@684 44 %option with_mod_deflate no
michael@684 45 %option with_mod_ext_filter no
michael@684 46 %option with_mod_substitute no
michael@684 47 %option with_mod_ssl no
michael@684 48 %option with_mod_dav no
michael@684 49 %option with_mod_ldap no
michael@684 50 %option with_mod_dbd no
michael@684 51 %option with_mod_proxy no
michael@684 52 %option with_mod_cache no
michael@684 53 %option with_mod_diskcache no
michael@684 54 %option with_mod_memcache no
michael@684 55 %option with_mod_filecache no
michael@684 56 %option with_mod_authn_alias no
michael@684 57
michael@684 58 # fixing implicit inter-module dependencies and correlations
michael@684 59 %if "%{with_mpm_prefork}" == "yes"
michael@684 60 %undefine with_mpm_worker
michael@684 61 %undefine with_mpm_event
michael@684 62 %endif
michael@684 63 %if "%{with_mpm_worker}" == "yes"
michael@684 64 %undefine with_mpm_prefork
michael@684 65 %undefine with_mpm_event
michael@684 66 %endif
michael@684 67 %if "%{with_mpm_event}" == "yes"
michael@684 68 %undefine with_mpm_prefork
michael@684 69 %undefine with_mpm_worker
michael@684 70 %endif
michael@684 71 %if "%{with_mod_memcache}" == "yes" || "%{with_mod_diskcache}" == "yes"
michael@684 72 %undefine with_mod_cache
michael@684 73 %define with_mod_cache yes
michael@684 74 %endif
michael@684 75
michael@684 76 # list of sources
michael@684 77 Source0: http://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
michael@684 78 Source1: rc.apache
michael@684 79 Source2: apache.base
michael@684 80 Source3: apache.conf
michael@684 81 Source4: apache.sh
michael@684 82 Patch0: apache.patch
michael@685 83 Patch1: apache.patch.davquo
michael@684 84
michael@684 85 # build information
michael@684 86 BuildPreReq: OpenPKG, openpkg >= 20100101, perl, make
michael@684 87 PreReq: OpenPKG, openpkg >= 20100101, perl
michael@684 88 BuildPreReq: apr, pcre
michael@684 89 PreReq: apr, pcre
michael@684 90 %if "%{with_mpm_worker}" == "yes" || "%{with_mpm_event}" == "yes" || "%{with_mod_memcache}" == "yes"
michael@684 91 BuildPreReq: apr::with_threads = yes
michael@684 92 PreReq: apr::with_threads = yes
michael@684 93 %endif
michael@684 94 %if "%{with_mod_ldap}" == "yes"
michael@684 95 BuildPreReq: apr::with_ldap = yes
michael@684 96 PreReq: apr::with_ldap = yes
michael@684 97 %endif
michael@684 98 %if "%{with_mod_ssl}" == "yes"
michael@684 99 BuildPreReq: openssl >= 0.9.8
michael@684 100 PreReq: openssl >= 0.9.8
michael@684 101 PreReq: x509
michael@684 102 %endif
michael@684 103 %if "%{with_mod_deflate}" == "yes"
michael@684 104 BuildPreReq: zlib
michael@684 105 PreReq: zlib
michael@684 106 %endif
michael@684 107
michael@684 108 %description
michael@684 109 The Apache Project is a collaborative software development effort
michael@684 110 aimed at creating a robust, commercial-grade, featureful, and
michael@684 111 freely-available source code implementation of an HTTP (Web) server.
michael@684 112 The project is jointly managed by a group of volunteers located
michael@684 113 around the world, using the Internet and the Web to communicate,
michael@684 114 plan, and develop the server and its related documentation. These
michael@684 115 volunteers are known as the Apache Group. In addition, hundreds
michael@684 116 of users have contributed ideas, code, and documentation to the
michael@684 117 project.
michael@684 118
michael@684 119 %track
michael@684 120 prog apache = {
michael@684 121 version = %{version}
michael@684 122 url = http://www.apache.org/dist/httpd/
michael@684 123 regex = httpd-(2\.\d*[02468]\.\d+)\.tar\.(bz2|gz)
michael@684 124 }
michael@684 125
michael@684 126 %prep
michael@684 127 # unpack Apache distribution
michael@684 128 %setup -q -n httpd-%{version}
michael@684 129 %patch -p0
michael@685 130 %patch -p0 -P 1
michael@684 131 %{l_shtool} subst \
michael@684 132 -e 's;(" PLATFORM ");(%{l_openpkg_release -F "OpenPKG/%%t"});g' \
michael@684 133 server/core.c
michael@684 134
michael@684 135 %build
michael@684 136 # configure package
michael@684 137 ( echo "ac_cv_func_uuid_create=no"
michael@684 138 ) >config.cache
michael@684 139 export CC="%{l_cc}"
michael@684 140 export CFLAGS="%{l_cflags -O}"
michael@684 141 export CPPFLAGS="%{l_cppflags}"
michael@684 142 export LDFLAGS="%{l_ldflags}"
michael@684 143 export LIBS=""
michael@684 144 case "%{l_platform -t}" in
michael@684 145 *-sunos* ) LIBS="$LIBS -lrt" ;;
michael@684 146 esac
michael@684 147 %if "%{with_mod_ldap}" == "yes"
michael@684 148 LIBS="$LIBS -lssl -lcrypto"
michael@684 149 %endif
michael@684 150 ./configure \
michael@684 151 --cache-file=./config.cache \
michael@684 152 --enable-layout=GNU \
michael@684 153 --prefix=%{l_prefix} \
michael@684 154 --with-program-name=apache \
michael@684 155 --sysconfdir=%{l_prefix}/etc/apache \
michael@684 156 --libexecdir=%{l_prefix}/libexec/apache \
michael@684 157 --includedir=%{l_prefix}/include/apache \
michael@684 158 --datadir=%{l_prefix}/share/apache \
michael@684 159 --localstatedir=%{l_prefix}/var/apache \
michael@684 160 --with-apr=%{l_prefix}/bin/apr-1-config \
michael@684 161 --with-apr-util=%{l_prefix}/bin/apu-1-config \
michael@684 162 --with-pcre=%{l_prefix} \
michael@684 163 %if "%{with_mpm_prefork}" == "yes"
michael@684 164 --with-mpm="prefork" \
michael@684 165 %endif
michael@684 166 %if "%{with_mpm_worker}" == "yes"
michael@684 167 --with-mpm="worker" \
michael@684 168 %endif
michael@684 169 %if "%{with_mpm_event}" == "yes"
michael@684 170 --with-mpm="event" \
michael@684 171 %endif
michael@684 172 %if "%{with_mpm_worker}" == "yes" || "%{with_mpm_event}" == "yes" || "%{with_mod_memcache}" == "yes"
michael@684 173 --enable-threads \
michael@684 174 %else
michael@684 175 --disable-threads \
michael@684 176 %endif
michael@684 177 %if "%{with_suexec}" == "yes"
michael@684 178 --enable-suexec \
michael@684 179 --with-suexec-bin=%{l_prefix}/sbin/suexec \
michael@684 180 --with-suexec-caller=%{with_suexec_caller} \
michael@684 181 --with-suexec-userdir=%{with_suexec_userdir} \
michael@684 182 --with-suexec-logfile=%{l_prefix}/var/apache/log/suexec.log \
michael@684 183 %endif
michael@684 184 %if "%{with_mod_deflate}" == "yes"
michael@684 185 --enable-deflate \
michael@684 186 --with-z=%{l_prefix} \
michael@684 187 %endif
michael@684 188 %if "%{with_mod_ext_filter}" == "yes"
michael@684 189 --enable-ext-filter \
michael@684 190 %endif
michael@684 191 %if "%{with_mod_substitute}" == "yes"
michael@684 192 --enable-substitute \
michael@684 193 %endif
michael@684 194 %if "%{with_mod_ssl}" == "yes"
michael@684 195 --enable-ssl \
michael@684 196 --with-ssl=%{l_prefix} \
michael@684 197 %endif
michael@684 198 %if "%{with_mod_dav}" == "yes"
michael@684 199 --enable-dav \
michael@684 200 --enable-dav-fs \
michael@684 201 --enable-dav-lock \
michael@684 202 %endif
michael@684 203 %if "%{with_mod_ldap}" == "yes"
michael@684 204 --enable-ldap \
michael@684 205 --enable-authnz-ldap \
michael@684 206 %endif
michael@684 207 %if "%{with_mod_dbd}" == "yes"
michael@684 208 --enable-dbd \
michael@684 209 --enable-authn-dbd \
michael@684 210 %endif
michael@684 211 %if "%{with_mod_proxy}" == "yes"
michael@684 212 --enable-proxy \
michael@684 213 --enable-proxy-connect \
michael@684 214 --enable-proxy-http \
michael@684 215 --enable-proxy-ftp \
michael@684 216 --enable-proxy-ajp \
michael@684 217 --enable-proxy-balancer \
michael@684 218 %endif
michael@684 219 %if "%{with_mod_cache}" == "yes"
michael@684 220 --enable-cache \
michael@684 221 %if "%{with_mod_diskcache}" == "yes"
michael@684 222 --enable-disk-cache \
michael@684 223 %endif
michael@684 224 %if "%{with_mod_memcache}" == "yes"
michael@684 225 --enable-mem-cache \
michael@684 226 %endif
michael@684 227 %endif
michael@684 228 %if "%{with_mod_filecache}" == "yes"
michael@684 229 --enable-file-cache \
michael@684 230 %endif
michael@684 231 %if "%{with_mod_authn_alias}" == "yes"
michael@684 232 --enable-authn-alias \
michael@684 233 %endif
michael@684 234 --enable-filter \
michael@684 235 --enable-reqtimeout \
michael@684 236 --enable-usertrack \
michael@684 237 --enable-expires \
michael@684 238 --enable-so \
michael@684 239 --enable-speling \
michael@684 240 --enable-rewrite \
michael@684 241 --enable-headers \
michael@684 242 --enable-info \
michael@684 243 --enable-mime-magic \
michael@684 244 --enable-vhost-alias \
michael@684 245 --enable-auth-digest \
michael@684 246 --enable-auth-dbm \
michael@684 247 --enable-authz-dbm \
michael@684 248 --enable-authz-owner \
michael@684 249 --enable-unique-id \
michael@684 250 --enable-logio \
michael@684 251 --disable-shared
michael@684 252
michael@684 253 # build package
michael@684 254 %{l_make} %{l_mflags}
michael@684 255
michael@684 256 %install
michael@684 257 # install package
michael@684 258 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
michael@684 259
michael@684 260 # create additional directories
michael@684 261 %{l_shtool} mkdir -f -p -m 755 \
michael@684 262 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
michael@684 263 $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d \
michael@684 264 $RPM_BUILD_ROOT%{l_prefix}/var/apache/run/apache.dav \
michael@684 265 $RPM_BUILD_ROOT%{l_prefix}/var/apache/run/apache.cache
michael@684 266
michael@684 267 # adjust GNU libtool configuration for apxs(1) runtime
michael@684 268 %{l_shtool} install -c -m 755 \
michael@684 269 -e 's;^build_libtool_libs=no;build_libtool_libs=yes;' \
michael@684 270 %{l_prefix}/share/apr/build-1/libtool \
michael@684 271 $RPM_BUILD_ROOT%{l_prefix}/share/apache/build/libtool
michael@684 272
michael@684 273 # install shell environment script
michael@684 274 %{l_shtool} install -c -m 644 %{l_value -s -a} \
michael@684 275 -e 's;@l_path@;%{l_build_path};' \
michael@684 276 -e 's;@l_ld_library_path@;%{l_build_ldlp};' \
michael@684 277 %{SOURCE apache.sh} \
michael@684 278 $RPM_BUILD_ROOT%{l_prefix}/etc/apache/
michael@684 279
michael@684 280 # create default configuration
michael@684 281 l_hostname=`%{l_shtool} echo -e %h`
michael@684 282 l_domainname=`%{l_shtool} echo -e %d | cut -c2-`
michael@684 283 %{l_shtool} install -c -m 644 %{l_value -s -a} \
michael@684 284 -e "s;@l_hostname@;$l_hostname;g" \
michael@684 285 -e "s;@l_domainname@;$l_domainname;g" \
michael@684 286 %{SOURCE apache.base} \
michael@684 287 %{SOURCE apache.conf} \
michael@684 288 $RPM_BUILD_ROOT%{l_prefix}/etc/apache/
michael@684 289 mv $RPM_BUILD_ROOT%{l_prefix}/etc/apache/magic \
michael@684 290 $RPM_BUILD_ROOT%{l_prefix}/etc/apache/mime.magic
michael@684 291
michael@684 292 # install run-command script
michael@684 293 %{l_shtool} install -c -m 755 %{l_value -s -a} \
michael@684 294 -e 's;@with_mod_filecache@;%{with_mod_filecache};g' \
michael@684 295 %{SOURCE rc.apache} \
michael@684 296 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
michael@684 297
michael@684 298 # strip down installation
michael@684 299 find $RPM_BUILD_ROOT%{l_prefix}/share/apache -name "*.orig" -print | xargs rm -f
michael@684 300 rm -f $RPM_BUILD_ROOT%{l_prefix}/share/apache/htdocs/apache_pb*
michael@684 301 rm -rf $RPM_BUILD_ROOT%{l_prefix}/etc/apache/{extra,original}
michael@684 302 rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/apache
michael@684 303 rm -f $RPM_BUILD_ROOT%{l_prefix}/cgi/test-cgi
michael@684 304 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
michael@684 305 strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
michael@684 306 ( cd $RPM_BUILD_ROOT%{l_prefix}/share/apache/manual
michael@684 307 find . -name "*.xml" -print | xargs rm -f
michael@684 308 find . -name "*.xml.*" -print | xargs rm -f
michael@684 309 find . -name "*.xsl" -print | xargs rm -f
michael@684 310 rm -rf style/xsl
michael@684 311 rm -rf style/latex
michael@684 312 ) || exit $?
michael@684 313
michael@684 314 # determine installation files
michael@684 315 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
michael@684 316 %{l_files_std} \
michael@684 317 %if "%{with_suexec}" == "yes"
michael@684 318 '%attr(4755,%{l_susr},%{l_mgrp}) %{l_prefix}/sbin/suexec' \
michael@684 319 %endif
michael@684 320 '%config %{l_prefix}/etc/apache/*' \
michael@684 321 '%config %attr(444,%{l_musr},%{l_mgrp}) %{l_prefix}/etc/apache/apache.base' \
michael@684 322 '%dir %attr(750,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/apache/run/apache.dav' \
michael@684 323 '%dir %attr(750,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/apache/run/apache.cache'
michael@684 324
michael@684 325 %files -f files
michael@684 326
michael@684 327 %clean
michael@684 328
michael@684 329 %post
michael@684 330 # after upgrade, restart service
michael@684 331 [ $1 -eq 2 ] || exit 0
michael@684 332 eval `%{l_rc} apache status 2>/dev/null`
michael@684 333 [ ".$apache_active" = .yes ] && %{l_rc} apache restart
michael@684 334 exit 0
michael@684 335
michael@684 336 %preun
michael@684 337 # before erase, stop service and remove log files
michael@684 338 [ $1 -eq 0 ] || exit 0
michael@684 339 %{l_rc} apache stop 2>/dev/null
michael@684 340 rm -f $RPM_INSTALL_PREFIX/var/apache/log/* >/dev/null 2>&1 || true
michael@684 341 rm -f $RPM_INSTALL_PREFIX/var/apache/run/*/* >/dev/null 2>&1 || true
michael@684 342 rm -f $RPM_INSTALL_PREFIX/var/apache/run/* >/dev/null 2>&1 || true
michael@684 343 exit 0
michael@684 344

mercurial