apache/apache.spec

Mon, 17 Sep 2012 19:01:16 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Mon, 17 Sep 2012 19:01:16 +0200
changeset 684
f805be991d7f
child 685
d612d08c0455
permissions
-rw-r--r--

Import package vendor original spec for necessary manipulations.

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@684 35 Release: 20120205
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@684 83
michael@684 84 # build information
michael@684 85 BuildPreReq: OpenPKG, openpkg >= 20100101, perl, make
michael@684 86 PreReq: OpenPKG, openpkg >= 20100101, perl
michael@684 87 BuildPreReq: apr, pcre
michael@684 88 PreReq: apr, pcre
michael@684 89 %if "%{with_mpm_worker}" == "yes" || "%{with_mpm_event}" == "yes" || "%{with_mod_memcache}" == "yes"
michael@684 90 BuildPreReq: apr::with_threads = yes
michael@684 91 PreReq: apr::with_threads = yes
michael@684 92 %endif
michael@684 93 %if "%{with_mod_ldap}" == "yes"
michael@684 94 BuildPreReq: apr::with_ldap = yes
michael@684 95 PreReq: apr::with_ldap = yes
michael@684 96 %endif
michael@684 97 %if "%{with_mod_ssl}" == "yes"
michael@684 98 BuildPreReq: openssl >= 0.9.8
michael@684 99 PreReq: openssl >= 0.9.8
michael@684 100 PreReq: x509
michael@684 101 %endif
michael@684 102 %if "%{with_mod_deflate}" == "yes"
michael@684 103 BuildPreReq: zlib
michael@684 104 PreReq: zlib
michael@684 105 %endif
michael@684 106
michael@684 107 %description
michael@684 108 The Apache Project is a collaborative software development effort
michael@684 109 aimed at creating a robust, commercial-grade, featureful, and
michael@684 110 freely-available source code implementation of an HTTP (Web) server.
michael@684 111 The project is jointly managed by a group of volunteers located
michael@684 112 around the world, using the Internet and the Web to communicate,
michael@684 113 plan, and develop the server and its related documentation. These
michael@684 114 volunteers are known as the Apache Group. In addition, hundreds
michael@684 115 of users have contributed ideas, code, and documentation to the
michael@684 116 project.
michael@684 117
michael@684 118 %track
michael@684 119 prog apache = {
michael@684 120 version = %{version}
michael@684 121 url = http://www.apache.org/dist/httpd/
michael@684 122 regex = httpd-(2\.\d*[02468]\.\d+)\.tar\.(bz2|gz)
michael@684 123 }
michael@684 124
michael@684 125 %prep
michael@684 126 # unpack Apache distribution
michael@684 127 %setup -q -n httpd-%{version}
michael@684 128 %patch -p0
michael@684 129 %{l_shtool} subst \
michael@684 130 -e 's;(" PLATFORM ");(%{l_openpkg_release -F "OpenPKG/%%t"});g' \
michael@684 131 server/core.c
michael@684 132
michael@684 133 %build
michael@684 134 # configure package
michael@684 135 ( echo "ac_cv_func_uuid_create=no"
michael@684 136 ) >config.cache
michael@684 137 export CC="%{l_cc}"
michael@684 138 export CFLAGS="%{l_cflags -O}"
michael@684 139 export CPPFLAGS="%{l_cppflags}"
michael@684 140 export LDFLAGS="%{l_ldflags}"
michael@684 141 export LIBS=""
michael@684 142 case "%{l_platform -t}" in
michael@684 143 *-sunos* ) LIBS="$LIBS -lrt" ;;
michael@684 144 esac
michael@684 145 %if "%{with_mod_ldap}" == "yes"
michael@684 146 LIBS="$LIBS -lssl -lcrypto"
michael@684 147 %endif
michael@684 148 ./configure \
michael@684 149 --cache-file=./config.cache \
michael@684 150 --enable-layout=GNU \
michael@684 151 --prefix=%{l_prefix} \
michael@684 152 --with-program-name=apache \
michael@684 153 --sysconfdir=%{l_prefix}/etc/apache \
michael@684 154 --libexecdir=%{l_prefix}/libexec/apache \
michael@684 155 --includedir=%{l_prefix}/include/apache \
michael@684 156 --datadir=%{l_prefix}/share/apache \
michael@684 157 --localstatedir=%{l_prefix}/var/apache \
michael@684 158 --with-apr=%{l_prefix}/bin/apr-1-config \
michael@684 159 --with-apr-util=%{l_prefix}/bin/apu-1-config \
michael@684 160 --with-pcre=%{l_prefix} \
michael@684 161 %if "%{with_mpm_prefork}" == "yes"
michael@684 162 --with-mpm="prefork" \
michael@684 163 %endif
michael@684 164 %if "%{with_mpm_worker}" == "yes"
michael@684 165 --with-mpm="worker" \
michael@684 166 %endif
michael@684 167 %if "%{with_mpm_event}" == "yes"
michael@684 168 --with-mpm="event" \
michael@684 169 %endif
michael@684 170 %if "%{with_mpm_worker}" == "yes" || "%{with_mpm_event}" == "yes" || "%{with_mod_memcache}" == "yes"
michael@684 171 --enable-threads \
michael@684 172 %else
michael@684 173 --disable-threads \
michael@684 174 %endif
michael@684 175 %if "%{with_suexec}" == "yes"
michael@684 176 --enable-suexec \
michael@684 177 --with-suexec-bin=%{l_prefix}/sbin/suexec \
michael@684 178 --with-suexec-caller=%{with_suexec_caller} \
michael@684 179 --with-suexec-userdir=%{with_suexec_userdir} \
michael@684 180 --with-suexec-logfile=%{l_prefix}/var/apache/log/suexec.log \
michael@684 181 %endif
michael@684 182 %if "%{with_mod_deflate}" == "yes"
michael@684 183 --enable-deflate \
michael@684 184 --with-z=%{l_prefix} \
michael@684 185 %endif
michael@684 186 %if "%{with_mod_ext_filter}" == "yes"
michael@684 187 --enable-ext-filter \
michael@684 188 %endif
michael@684 189 %if "%{with_mod_substitute}" == "yes"
michael@684 190 --enable-substitute \
michael@684 191 %endif
michael@684 192 %if "%{with_mod_ssl}" == "yes"
michael@684 193 --enable-ssl \
michael@684 194 --with-ssl=%{l_prefix} \
michael@684 195 %endif
michael@684 196 %if "%{with_mod_dav}" == "yes"
michael@684 197 --enable-dav \
michael@684 198 --enable-dav-fs \
michael@684 199 --enable-dav-lock \
michael@684 200 %endif
michael@684 201 %if "%{with_mod_ldap}" == "yes"
michael@684 202 --enable-ldap \
michael@684 203 --enable-authnz-ldap \
michael@684 204 %endif
michael@684 205 %if "%{with_mod_dbd}" == "yes"
michael@684 206 --enable-dbd \
michael@684 207 --enable-authn-dbd \
michael@684 208 %endif
michael@684 209 %if "%{with_mod_proxy}" == "yes"
michael@684 210 --enable-proxy \
michael@684 211 --enable-proxy-connect \
michael@684 212 --enable-proxy-http \
michael@684 213 --enable-proxy-ftp \
michael@684 214 --enable-proxy-ajp \
michael@684 215 --enable-proxy-balancer \
michael@684 216 %endif
michael@684 217 %if "%{with_mod_cache}" == "yes"
michael@684 218 --enable-cache \
michael@684 219 %if "%{with_mod_diskcache}" == "yes"
michael@684 220 --enable-disk-cache \
michael@684 221 %endif
michael@684 222 %if "%{with_mod_memcache}" == "yes"
michael@684 223 --enable-mem-cache \
michael@684 224 %endif
michael@684 225 %endif
michael@684 226 %if "%{with_mod_filecache}" == "yes"
michael@684 227 --enable-file-cache \
michael@684 228 %endif
michael@684 229 %if "%{with_mod_authn_alias}" == "yes"
michael@684 230 --enable-authn-alias \
michael@684 231 %endif
michael@684 232 --enable-filter \
michael@684 233 --enable-reqtimeout \
michael@684 234 --enable-usertrack \
michael@684 235 --enable-expires \
michael@684 236 --enable-so \
michael@684 237 --enable-speling \
michael@684 238 --enable-rewrite \
michael@684 239 --enable-headers \
michael@684 240 --enable-info \
michael@684 241 --enable-mime-magic \
michael@684 242 --enable-vhost-alias \
michael@684 243 --enable-auth-digest \
michael@684 244 --enable-auth-dbm \
michael@684 245 --enable-authz-dbm \
michael@684 246 --enable-authz-owner \
michael@684 247 --enable-unique-id \
michael@684 248 --enable-logio \
michael@684 249 --disable-shared
michael@684 250
michael@684 251 # build package
michael@684 252 %{l_make} %{l_mflags}
michael@684 253
michael@684 254 %install
michael@684 255 # install package
michael@684 256 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
michael@684 257
michael@684 258 # create additional directories
michael@684 259 %{l_shtool} mkdir -f -p -m 755 \
michael@684 260 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
michael@684 261 $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d \
michael@684 262 $RPM_BUILD_ROOT%{l_prefix}/var/apache/run/apache.dav \
michael@684 263 $RPM_BUILD_ROOT%{l_prefix}/var/apache/run/apache.cache
michael@684 264
michael@684 265 # adjust GNU libtool configuration for apxs(1) runtime
michael@684 266 %{l_shtool} install -c -m 755 \
michael@684 267 -e 's;^build_libtool_libs=no;build_libtool_libs=yes;' \
michael@684 268 %{l_prefix}/share/apr/build-1/libtool \
michael@684 269 $RPM_BUILD_ROOT%{l_prefix}/share/apache/build/libtool
michael@684 270
michael@684 271 # install shell environment script
michael@684 272 %{l_shtool} install -c -m 644 %{l_value -s -a} \
michael@684 273 -e 's;@l_path@;%{l_build_path};' \
michael@684 274 -e 's;@l_ld_library_path@;%{l_build_ldlp};' \
michael@684 275 %{SOURCE apache.sh} \
michael@684 276 $RPM_BUILD_ROOT%{l_prefix}/etc/apache/
michael@684 277
michael@684 278 # create default configuration
michael@684 279 l_hostname=`%{l_shtool} echo -e %h`
michael@684 280 l_domainname=`%{l_shtool} echo -e %d | cut -c2-`
michael@684 281 %{l_shtool} install -c -m 644 %{l_value -s -a} \
michael@684 282 -e "s;@l_hostname@;$l_hostname;g" \
michael@684 283 -e "s;@l_domainname@;$l_domainname;g" \
michael@684 284 %{SOURCE apache.base} \
michael@684 285 %{SOURCE apache.conf} \
michael@684 286 $RPM_BUILD_ROOT%{l_prefix}/etc/apache/
michael@684 287 mv $RPM_BUILD_ROOT%{l_prefix}/etc/apache/magic \
michael@684 288 $RPM_BUILD_ROOT%{l_prefix}/etc/apache/mime.magic
michael@684 289
michael@684 290 # install run-command script
michael@684 291 %{l_shtool} install -c -m 755 %{l_value -s -a} \
michael@684 292 -e 's;@with_mod_filecache@;%{with_mod_filecache};g' \
michael@684 293 %{SOURCE rc.apache} \
michael@684 294 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
michael@684 295
michael@684 296 # strip down installation
michael@684 297 find $RPM_BUILD_ROOT%{l_prefix}/share/apache -name "*.orig" -print | xargs rm -f
michael@684 298 rm -f $RPM_BUILD_ROOT%{l_prefix}/share/apache/htdocs/apache_pb*
michael@684 299 rm -rf $RPM_BUILD_ROOT%{l_prefix}/etc/apache/{extra,original}
michael@684 300 rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/apache
michael@684 301 rm -f $RPM_BUILD_ROOT%{l_prefix}/cgi/test-cgi
michael@684 302 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
michael@684 303 strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
michael@684 304 ( cd $RPM_BUILD_ROOT%{l_prefix}/share/apache/manual
michael@684 305 find . -name "*.xml" -print | xargs rm -f
michael@684 306 find . -name "*.xml.*" -print | xargs rm -f
michael@684 307 find . -name "*.xsl" -print | xargs rm -f
michael@684 308 rm -rf style/xsl
michael@684 309 rm -rf style/latex
michael@684 310 ) || exit $?
michael@684 311
michael@684 312 # determine installation files
michael@684 313 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
michael@684 314 %{l_files_std} \
michael@684 315 %if "%{with_suexec}" == "yes"
michael@684 316 '%attr(4755,%{l_susr},%{l_mgrp}) %{l_prefix}/sbin/suexec' \
michael@684 317 %endif
michael@684 318 '%config %{l_prefix}/etc/apache/*' \
michael@684 319 '%config %attr(444,%{l_musr},%{l_mgrp}) %{l_prefix}/etc/apache/apache.base' \
michael@684 320 '%dir %attr(750,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/apache/run/apache.dav' \
michael@684 321 '%dir %attr(750,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/apache/run/apache.cache'
michael@684 322
michael@684 323 %files -f files
michael@684 324
michael@684 325 %clean
michael@684 326
michael@684 327 %post
michael@684 328 # after upgrade, restart service
michael@684 329 [ $1 -eq 2 ] || exit 0
michael@684 330 eval `%{l_rc} apache status 2>/dev/null`
michael@684 331 [ ".$apache_active" = .yes ] && %{l_rc} apache restart
michael@684 332 exit 0
michael@684 333
michael@684 334 %preun
michael@684 335 # before erase, stop service and remove log files
michael@684 336 [ $1 -eq 0 ] || exit 0
michael@684 337 %{l_rc} apache stop 2>/dev/null
michael@684 338 rm -f $RPM_INSTALL_PREFIX/var/apache/log/* >/dev/null 2>&1 || true
michael@684 339 rm -f $RPM_INSTALL_PREFIX/var/apache/run/*/* >/dev/null 2>&1 || true
michael@684 340 rm -f $RPM_INSTALL_PREFIX/var/apache/run/* >/dev/null 2>&1 || true
michael@684 341 exit 0
michael@684 342

mercurial