Browse Source

- add warning comment - use better PAM support - use %ifndef...%endif

master
parent
commit
0484c4b3a5
  1. 80
      apache/apache.spec

80
apache/apache.spec

@ -23,21 +23,60 @@
## SUCH DAMAGE.
##
# the additionally used Apache modules
## ATTENTION: This package specification is a cruel one. It allows
## one to build an Apache package in hundreds of variants with just
## a single specification through the use of lots of condition
## variables. The reason for this attempt is that it was born out of
## the needs from the daily practice at an ISP. So do not treat this
## specification as a reference example of any kind, except perhaps as
## a example of what is maximum possible with RPM and how far one can
## go with the macro mechanism. But do not try to repeat this!
# the additionally used Apache modules (can be enabled without thinking)
%ifndef mod_ssl
%define mod_ssl no
%endif
%ifndef mod_perl
%define mod_perl no
%endif
%ifndef mod_php
%define mod_php no
%endif
%ifndef mod_dav
%define mod_dav no
%endif
%ifndef mod_layout
%define mod_layout no
%endif
%ifndef mod_macro
%define mod_macro no
%endif
# the additionally used Apache modules (you have to know what you do)
%ifndef mod_auth_pam
%define mod_auth_pam no
%endif
%ifndef mod_gzip
%define mod_gzip no
%endif
%ifndef mod_zmod
%define mod_zmod no
%endif
%ifndef mod_fastcgi
%define mod_fastcgi no
%endif
%ifndef mod_throttle
%define mod_throttle no
%endif
%ifndef mod_access_referer
%define mod_access_referer no
%endif
%ifndef mod_roaming
%define mod_roaming no
%endif
%ifndef mod_relocate
%define mod_relocate no
%endif
# more optional settings
# (requires mod_php set to "yes" above)
@ -85,9 +124,9 @@ Vendor: Apache Software Foundation
Packager: The OpenPKG Project
Distribution: OpenPKG [REL]
Group: Web
License: BSD-style
License: ASF
Version: %{V_apache}
Release: 20020311
Release: 20020315
# list of sources
Source0: http://httpd.apache.org/dist/httpd/apache_%{V_apache}.tar.gz
@ -141,8 +180,8 @@ Source23: rc.apache
# build information
Prefix: %{l_prefix}
BuildRoot: %{l_buildroot}
BuildPreReq: openpkg >= 20020206
PreReq: openpkg >= 20020206
BuildPreReq: openpkg >= 20020222
PreReq: openpkg >= 20020222
%if "%{mod_ssl}" == "yes"
BuildPreReq: openssl, mm
%endif
@ -186,6 +225,10 @@ BuildPreReq: pcre
BuildPreReq: jdk-sun
%endif
%endif
%if "%{mod_auth_pam}" == "yes"
BuildPreReq: PAM
PreReq: PAM
%endif
AutoReq: no
AutoReqProv: no
@ -456,14 +499,21 @@ AutoReqProv: no
)
%endif
( cd apache_%{V_apache}
cflags="%{l_cflags -O}"
ldflags=""
libs=""
%if "%{with_pam}" == "yes"
cflags="$cflags -I`%{l_prefix}/etc/rc --query pam_incdir`"
ldflags="$ldflags -L`%{l_prefix}/etc/rc --query pam_libdir`"
libs="$libs -lpam"
%endif
CC="%{l_cc}" \
CFLAGS="%{l_cflags -O}" \
CFLAGS="$cflags" \
LDFLAGS="$ldflags" \
LIBS="$libs" \
%if "%{mod_ssl}" == "yes"
EAPI_MM="%{l_prefix}" \
SSL_BASE="%{l_prefix}" \
%endif
%if "%{mod_auth_pam}" == "yes"
LIBS="$LIBS -lpam" \
%endif
./configure \
--target=apache \
@ -581,3 +631,15 @@ AutoReqProv: no
%clean
rm -rf $RPM_BUILD_ROOT
%post
%if "%{mod_auth_pam}" == "yes"
# add PAM configuration entry
$RPM_INSTALL_PREFIX/sbin/pamtool -a -s -n "apache"
%endif
%preun
%if "%{mod_auth_pam}" == "yes"
# remove PAM configuration entry
$RPM_INSTALL_PREFIX/sbin/pamtool -r -s -n "apache"
%endif

Loading…
Cancel
Save