Группа :: Система/Серверы
Пакет: apache2
Главная Изменения Спек Патчи Загрузить Bugs and FR
%define apache_version 2.0.59
%def_with M24
%def_without M30
%def_without libdb44
%define apache_release alt1
%if_with libdb44
%define apache_release alt1.1.libdb4.4
%endif
%if_with M24
%define apache_release alt0.M24.1
%endif
%if_with M30
%define apache_release alt0.M30.1
%endif
%define mmn 20020903
%define n_aprver 0.9.7
%define n_dbver 4.3
%if_with libdb44
%define n_dbver 4.4
%endif
%if_with M24
%define n_dbver 4.2
%endif
# do we need to co-exist with apache-ru ?
%def_enable apache_ru_compat
# if we do, what suffix to use ?
%define branch 2
# do we use native apr/apu ?
%def_disable apache_native_apr
%def_disable static
# handle initscript style change
%define dist_tag Sisyphus
%if_with M24
%define dist_tag Master
%endif
# name pkg-config pakage
%define n_pkgconfig pkg-config
%if_with M24
%define n_pkgconfig pkgconfig
%endif
%if_enabled apache_ru_compat
%define apache_branch %branch
%else
%define apache_branch %nil
%endif
%define a_name apache%apache_branch
%define apache_basedir %_sysconfdir/httpd%apache_branch
%define apache_confdir %apache_basedir/conf
%define apache_addonconfdir %apache_confdir/addon.d
%define apache_vhostconfdir %apache_confdir/vhost.d
%define apache_addonvhostconfdir %apache_confdir/vhost.d-addon
%define apache_vhosttempldir %apache_confdir/vhost.templ
%define apache_moduledir %_libdir/%a_name/modules
%define apache_logdir %_logdir/httpd%apache_branch
%define apache_datadir %srv_dir/%a_name
%define apache_htdocsdir %apache_datadir/html
%define apache_cgibindir %apache_datadir/cgi-bin
%define apache_apxs %_sbindir/apxs%apache_branch
%define apache_user apache%apache_branch
%define apache_group apache%apache_branch
%define apache_webmaster webmaster
%define suexec_docroot /home
%define apache_webmaster webmaster
%define a_prefix %apache_basedir
%define a_exec_prefix %prefix
%define a_bindir %_bindir
%define a_sbindir %_sbindir
%define a_libdir %_libdir/%a_name
%define a_libexecdir %a_libdir/modules
%define a_mandir %_mandir
%define a_sysconfdir %apache_confdir
%define a_datadir %apache_datadir
%define a_iconsdir %apache_datadir/icons
%define a_htdocsdir %apache_htdocsdir
%define a_manualdir %apache_datadir/manual
%define a_cgidir %apache_cgibindir
%define a_includedir %_includedir/apache%apache_branch
%define a_localstatedir %_var
%define a_runtimedir %_var/run/httpd%apache_branch
%define a_logfiledir %apache_logdir
%define a_proxycachedir %_cachedir/httpd%apache_branch
%define a_infodir %_infodir
%define a_installbuilddir %a_libdir/build
%define a_errordir %apache_datadir/error
%define apache_addondocdir %apache_datadir/manual-addons
%if_enabled apache_native_apr
%define apache_apr_buildreq "%a_name-libapr-devel %a_name-libaprutil-devel"
%define apache_apr_config %a_bindir/apr-config%apache_branch
%define apache_apu_config %a_bindir/apu-config%apache_branch
%else
%define apache_apr_buildreq "libapr-devel libaprutil-devel"
%define apache_apr_config %_bindir/apr-config
%define apache_apu_config %_bindir/apu-config
%endif
Name: %a_name
Version: %apache_version
Release: %apache_release
License: Apache Software License
Group: System/Servers
Url: http://httpd.apache.org/
Packager: Aleksey Avdeev <solo at altlinux.ru>
Summary: The most widely used Web server on the Internet
Summary(ru_RU.KOI8-R): Самый популярный веб-сервер Internet
Summary(uk_UA.KOI8-U): Найб╕льш популярний веб-сервер Internet
Source0: http://www.apache.org/dist/httpd/httpd-%version.tar.bz2
Source1: apache2.favour
#Source2: http://www.apache.org/dist/httpd/httpd-%version.tar.bz2.md5
Source30: altlinux.html
Source31: altlinux.png
# initscripts for ALM2.2 and friends and current Sisyphus
Source33: httpd2.init.Master
Source35: httpd2.init.Sisyphus
Patch1: httpd-2.0.55-alt-build.patch
Provides: webserver %name = %apache_version-%apache_release
Provides: %name-mmn = %mmn
%if_disabled apache_ru_compat
Conflicts: apache-common apache apache-mod_perl
%endif
Requires: vhosts-filesystem
Requires: perl-DBM perl-Digest-SHA1 zlib
%if_enabled apache_native_apr
Requires: %a_name-libapr = %apache_version
%else
Requires: libapr >= %n_aprver
Requires: libaprutil >= %n_aprver
BuildPreReq: libapr-devel >= %n_aprver
BuildPreReq: libaprutil-devel >= %n_aprver
%endif
# Automatically added by buildreq on Fri Mar 31 2006
BuildRequires: libssl-devel openssl zlib-devel
BuildPreReq: %n_pkgconfig
BuildPreReq: vhosts-filesystem-devel
%if_enabled static
BuildPreReq: libdb%n_dbver-devel-static
BuildPreReq: libsasl2-devel-static
%endif
BuildPreReq: libdb%n_dbver-devel
BuildPreReq: libgdbm-devel
BuildPreReq: libexpat-devel
#BuildPreReq: libpcre-devel
BuildPreReq: openldap libldap-devel
BuildPreReq: libsasl2-devel libsasl2-plugin-gssapi
BuildPreReq: openssl libssl-devel
#following is required by dbmmanage
BuildPreReq: perl-DBM perl-Digest-SHA1 zlib-devel
%description
Apache is a powerful, full-featured, efficient and freely-available
Web server.
This package contains a new (and thus not vary good tested) branch
of Apache web server
%description -l ru_RU.KOI8-R
Apache - мощный, функциональный, высокопроизводительный и
свободно распространяемый веб-сервер.
Этот пакет содержит новую и поэтому не очень хорошо оттестированную версию
веб-сервера Apache.
%package devel
Summary: Module development tools for the Apache web server
Summary(ru_RU.KOI8-R): Средства разработки модулей для веб-сервера Apache
Group: Development/C
Obsoletes: secureweb-devel
PreReq: %name = %apache_version-%apache_release
%if_disabled apache_native_apr
Obsoletes: %a_name-libapr %a_name-libapr-devel %a_name-libapr-devel %a_name-libaprutil %a_name-libaprutil-devel %a_name-libaprutil-devel
Requires: libapr-devel libaprutil-devel
%else
Requires: %a_name-libapr-devel %a_name-libaprutil-devel
%endif
%description devel
The apache-devel package contains the source code for the Apache
Web server you'll need to build Dynamic
Shared Objects (DSOs) for Apache.
If you are installing the Apache Web server and
you want to be able to compile or develop additional modules
for Apache, you'll need to install this package.
%description -l ru_RU.KOI8-R devel
Пакет содержит заголовочные файлы из исходных текстов веб-сервера Apache,
необходимые для сборки динамически подключаемых модулей (DSO).
Если Вы устанавливаете веб-сервер Apache и собираетесь компилировать или
разрабатывать для него дополнительные модули, Вам нужно установить этот пакет.
%package manual
Summary: Apache Manual
Summary(ru_RU.KOI8-R): Документация по Apache
Group: Books/Other
PreReq: %name = %apache_version-%apache_release
AutoReq: no
%description manual
This package contains the Apache server documentation in HTML format.
%description -l ru_RU.KOI8-R manual
Этот пакет содержит документацию к веб-серверу Apache в формате HTML.
%package mod_ssl
Group: System/Servers
Summary: SSL/TLS module for the Apache HTTP server
Serial: 1
BuildPreReq: libssl-devel
PreReq: openssl
Requires: %name, %name-mmn = %mmn
%description mod_ssl
The mod_ssl module provides strong cryptography for the Apache Web
server via the Secure Sockets Layer (SSL) and Transport Layer
Security (TLS) protocols.
%package suexec
Summary: Suexec binary for Apache
Summary(ru_RU.KOI8-R): Программа suexec для Apache
Summary(uk_UA.KOI8-U): Програма suexec для Apache
Group: System/Servers
PreReq: %name = %apache_version-%apache_release
%description suexec
This package adds suexec to Apache. Suexec provides Apache users the ability
to run CGI and SSI programs under user IDs different from the user ID of the
calling web-server. Normally, when a CGI or SSI program executes, it runs as
the same user who is running the web server.
%description -l ru_RU.KOI8-R suexec
Этот пакет добавляет к Apache suexec. Эта программа позволяет запускать CGI-
и SSI-программы под идентификаторами пользователя, отличными от UID
веб-сервера.
%description -l uk_UA.KOI8-U suexec
Цей пакунок дода╓ до Apache suexec. Ця програма дозволя╓ запускати CGI-
та SSI-програми п╕д ╕дентиф╕каторами користувача, що в╕др╕зняються в╕д
UID веб-серверу.
%if_enabled apache_native_apr
%package -n %a_name-libapr
Summary: Apache Portable Runtime shared libraries used by Apache2
Group: System/Servers
#Provides: libapr = %n_aprver
%description -n %a_name-libapr
The mission of the Apache Portable Runtime (APR) is to provide a free
library of C data structures and routines, forming a system portability
layer to as many operating systems as possible, including Unices,
MS Win32, BeOS and OS/2.
%package -n %a_name-libapr-devel
Summary: Development files for Apache Portable Runtime used by Apache2
Group: Development/C
Requires: %a_name-libapr = %apache_version
#Provides: libapr-devel = %n_aprver
%description -n %a_name-libapr-devel
Development files for Apache Portable Runtime used by Apache2
%package -n %a_name-libapr-devel-static
Summary: Static libraries for Apache Portable Runtime used by Apache2
Group: Development/C
Requires: %a_name-libapr-devel = %apache_version
#Provides: libapr-devel-static = %n_aprver
%description -n %a_name-libapr-devel-static
Static libraries for Apache Portable Runtime used by Apache2
%package -n %a_name-libaprutil
Summary: Apache Portable Runtime Utility shared libraries used by Apache2
Group: System/Servers
#Provides: libaprutil = %n_aprver
%description -n %a_name-libaprutil
Apache Portable Runtime Utility shared libraries used by Apache2
%package -n %a_name-libaprutil-devel
Summary: Development files for Apache Portable Runtime Utility libraries used by Apache2
Group: Development/C
Requires: %a_name-libaprutil = %apache_version
#Provides: libaprutil-devel = %n_aprver
%description -n %a_name-libaprutil-devel
Development files for Apache Portable Runtime Utility libraries used by Apache2
%if_enabled static
%package -n %a_name-libaprutil-devel-static
Summary: Static libraries for Apache Portable Runtime Utility libraries used by Apache2
Group: Development/C
Requires: %a_name-libaprutil-devel = %apache_version
#Provides: libaprutil-devel-static = %n_aprver
%description -n %a_name-libaprutil-devel-static
Static libraries for Apache Portable Runtime Utility libraries used by Apache2
%endif
%endif
%add_findprov_lib_path %a_libdir
%prep
# We dont need to expand builddir yet
%setup -q -n httpd-%version
%patch1 -p1
# generate ALTLinux Apache layout
echo "
# ALTLinux layout
<Layout ALTLinux>
prefix: %a_prefix
exec_prefix: %a_exec_prefix
bindir: %a_bindir
sbindir: %a_sbindir
libdir: %a_libdir
libexecdir: %a_libexecdir
mandir: %a_mandir
sysconfdir: %a_sysconfdir
datadir: %a_datadir
iconsdir: %a_iconsdir
htdocsdir: %a_htdocsdir
manualdir: %a_manualdir
cgidir: %a_cgidir
includedir: %a_includedir
localstatedir: %a_localstatedir
runtimedir: %a_runtimedir
logfiledir: %a_logfiledir
proxycachedir: %a_proxycachedir
infodir: %a_infodir
installbuilddir: %a_installbuilddir
errordir: %a_errordir
</Layout>
" >> config.layout
# Safety check: prevent build if defined MMN does not equal upstream MMN.
vmmn=`echo MODULE_MAGIC_NUMBER_MAJOR | cpp -include $PWD/include/ap_mmn.h | grep -e '^[0-9]'`
if [ "$vmmn" != "%mmn" ]; then
: Error: Upstream MMN is now ${vmmn}, packaged MMN is %mmn.
: Update the mmn macro and rebuild.
exit 1
fi
%build
function mpmbuild()
{
mpm=$1; shift
mkdir $mpm; pushd $mpm
cat > config.cache <<EOF
ac_cv_func_pthread_mutexattr_setpshared=no
ac_cv_func_sem_open=no
EOF
../configure -C \
--enable-layout=ALTLinux \
--with-perl=%__perl \
%if_disabled apache_native_apr
--with-apr=%_bindir/apr-config \
--with-apr-util=%_bindir/apu-config \
%endif
--enable-suexec --with-suexec \
--with-suexec-caller=%apache_user \
--with-suexec-docroot=%suexec_docroot \
--with-suexec-logfile=%a_logfiledir/suexec.log \
--with-suexec-bin=%a_sbindir/suexec%apache_branch \
--with-suexec-uidmin=500 --with-suexec-gidmin=500 \
--with-suexec-userdir=public_html \
--enable-so \
--with-mpm=$mpm \
--with-devrandom \
--with-ldap --enable-ldap --enable-auth-ldap \
--enable-cache --enable-disk-cache --enable-mem-cache \
--enable-ssl --with-ssl \
--enable-deflate --enable-cgid \
--enable-proxy --enable-proxy-connect \
--enable-proxy-http --enable-proxy-ftp \
--enable-charset_lite=shared \
$*
%make_build
popd
}
%__autoconf
# Only bother enabling optional modules for main build.
mpmbuild prefork --enable-mods-shared=all --with-program-name=httpd%apache_branch
# To prevent most modules being built statically into httpd.worker,
# easiest way seems to be enable them shared.
mpmbuild worker --enable-mods-shared=all --with-program-name=httpd%apache_branch.worker
# Verify that the same modules were built into the two httpd binaries
./prefork/httpd%apache_branch -l | grep -v prefork > prefork.mods
./worker/httpd%apache_branch.worker -l | grep -v worker > worker.mods
if ! diff -u prefork.mods worker.mods; then
: Different modules built into httpd binaries, will not proceed
exit 1
fi
%install
# Classify ab and logresolve as section 1 commands, as they are in /usr/bin
pushd docs/man
%__mv ab.8 ab%apache_branch.1
%if_enabled apache_ru_compat
MANS="apachectl.8 apxs.8 dbmmanage.1 htdigest.1 htpasswd.1 httpd.8 rotatelogs.8 logresolve.8 suexec.8"
for manpage in $MANS; do
%__mv ${manpage} `echo ${manpage}|sed -e "s/\./%apache_branch./"`
done
%endif
%__mv logresolve%apache_branch.8 logresolve%apache_branch.1
popd
pushd prefork
make DESTDIR=%buildroot install
popd
# install worker binary
WDIR=worker
%if_enabled apache_native_apr
WDIR="$WDIR/.libs"
%endif
%__install -m 755 $WDIR/httpd%apache_branch.worker %buildroot%a_sbindir/
#-----------------------------------------------------------------------------------
# Tune up executibles to co-exist with apache-ru
#
pushd %buildroot%a_sbindir
%if_enabled apache_ru_compat
#rename suexec binary to be named that apache is expect it to be
%__mv suexec suexec%apache_branch
#
# rename tools
# Maybe it's better to push ru-apache-devel before installing devel package
%__rm envvars-std
for tool in apxs checkgid dbmmanage envvars rotatelogs httxt2dbm; do
mv ${tool} ${tool}%apache_branch
done
#fix apxs
%__subst 's|\(\/envvars\)"|\1%apache_branch"|
s|\(apachectl\)|\1%apache_branch|
%if_enabled apache_native_apr
s|\(apr-config\)|\1%apache_branch|
s|\(apu-config\)|\1%apache_branch|
%endif
' apxs%apache_branch
%endif
# move&rename utilities to /usr/bin
TOOLS="ab htdbm logresolve htpasswd htdigest"
for tool in $TOOLS; do
%__mv ${tool} %buildroot%a_bindir/${tool}%apache_branch
done
popd
%if_enabled apache_ru_compat
%if_enabled apache_native_apr
pushd %buildroot%a_bindir
# rename ap?-config
for tool in ap?-config; do
%__mv ${tool} ${tool}%apache_branch
done
popd
%endif
%endif
#
#-----------------------------------------------------------------------------------
# mod_ssl bits
for suffix in crl crt csr key prm; do
mkdir %buildroot%a_sysconfdir/ssl.${suffix}
done
# Makefiles for certificate management
#for ext in crt crl; do
# install -m 644 ./build/rpm/mod_ssl-Makefile.${ext} \
# $RPM_BUILD_ROOT%_sysconfdir/httpd/conf/ssl.${ext}/Makefile.${ext}
#done
#ln -s ../../../usr/share/ssl/certs/Makefile $RPM_BUILD_ROOT/etc/httpd/conf
# for holding mod_dav lock database
mkdir -p %buildroot%a_localstatedir/lib/dav
# create a prototype session cache
mkdir -p %buildroot%a_proxycachedir/mod_ssl
touch %buildroot%a_proxycachedir/mod_ssl/scache.{dir,pag,sem}
# Make the MMN accessible to module packages
echo %mmn > %buildroot%a_includedir/.mmn
# docroot
rm -r %buildroot%a_manualdir/style
#rm %buildroot%a_manualdir/*/*.xml
# symlinks for /etc/httpd
ln -s %a_logfiledir %buildroot%apache_basedir/logs
ln -s %a_runtimedir %buildroot%apache_basedir/run
ln -s %a_libexecdir %buildroot%apache_basedir/modules
ln -s %a_installbuilddir %buildroot%apache_basedir/build
# create config dirs for additional modules and Virtual hosts
%__mkdir %buildroot%apache_addonconfdir
%__mkdir %buildroot%apache_vhostconfdir
%__mkdir %buildroot%apache_addonvhostconfdir
#------------------------------------------------------------------------------------
# tune up configuration files
pushd %buildroot%a_sysconfdir
%__subst '/### Section 3: Virtual Hosts/{
i \
### \
# Load config files from the config directory "%apache_addonconfdir". \
# \
Include %apache_addonconfdir/A.*.conf \
}' httpd*.conf
%__subst '/Listen 80/{
c \
\
### \
# This is a hack to run proxified Apache2 in case Apache1 is running \
# \
<IfDefine A1PROXIED> \
Listen localhost:8088 \
</IfDefine> \
\
<IfDefine !A1PROXIED> \
Listen 80 \
</IfDefine> \
}
/#NameVirtualHost \*:80/{
c \
<IfDefine A1PROXIED> \
#NameVirtualHost *:8088 \
</IfDefine> \
\
<IfDefine !A1PROXIED> \
#NameVirtualHost *:80 \
</IfDefine> \
}
/AliasMatch \^\/manual(/{
i \
Alias /manual/addons "%apache_addondocdir" \
}
/^<Directory .*manual/{
i \
<Directory "%apache_addondocdir"> \
AllowOverride None \
Options +Indexes +MultiViews \
Order allow,deny \
Allow from all \
</Directory> \
}
s/^User .*/User %apache_user/
s/^Group .*/Group %apache_group/
s/^ServerAdmin you/ServerAdmin %apache_webmaster/
' httpd*.conf
echo '
###
# Load Virual Hosts config files from the config directory "%apache_vhostconfdir".
#
Include %apache_addonvhostconfdir/A.*.conf
Include %apache_vhostconfdir/A.*.conf
' >> httpd%apache_branch.conf
# For now just clone config for worker httpd
cp httpd%apache_branch.conf httpd%apache_branch.worker.conf
popd
# Provide default template fot virtual hosts
%__mkdir %buildroot%apache_vhosttempldir
echo '
<VirtualHost *>
ServerName www.-=name=-.ru
ServerAlias -=name=-.ru
ServerAdmin www-adm at -=name=-.ru
DocumentRoot %vhosts_dir/-=name=-/htdocs
ScriptAlias /cgi-bin/ %vhosts_dir/-=name=-/feedback/cgis/
ErrorLog %vhosts_dir/-=name=-/log/error_log_a2
TransferLog %vhosts_dir/-=name=-/log/access_log_a2
AddDefaultCharset WINDOWS-1251
CharsetSourceEnc WINDOWS-1251
CharsetDefault WINDOWS-1251
# CharsetRecodeMultipartForms Off
</VirtualHost>
'>%buildroot%apache_vhosttempldir/default.conf
#------------------------------------------------------------------------------------
#install ALT misc documentation and logos
for f in %buildroot%a_htdocsdir/index.html*; do
%__subst '/<\/[bB][oO][dD][yY]>/{
i \
<center> \
<p><a href="manual/addons/">Addon modules documentation</a></p> \
<img SRC="icons/altlinux.png" ALT="ALT Linux" > \
</center>
}' $f
done
#%__install -m644 %SOURCE30 %buildroot%a_htdocsdir
%__install -m644 %SOURCE31 %buildroot%a_iconsdir
%__perl -pi -e "s|/usr/local/bin/perl|%__perl|g;" \
%buildroot%a_manualdir/search/manual-index.cgi
# install the init script
%__mkdir_p %buildroot%_initdir
%if "%dist_tag" == "Master"
%__install -m755 %SOURCE33 \
%buildroot%_initdir/httpd%apache_branch
%else
%__install -m755 %SOURCE35 \
%buildroot%_initdir/httpd%apache_branch
%endif
#substitute the real paths in initscript
%__subst 's|-=name=-|httpd%apache_branch|g
s|-=pidfile=-|%a_runtimedir/httpd.pid|g
s|-=conffile=-|%apache_confdir/httpd%apache_branch.conf|g
s|-=modules=-|%apache_moduledir|g' %buildroot%_initdir/httpd%apache_branch
# generate sysconfig settings file
%__mkdir_p %buildroot%_sysconfdir/sysconfig
echo "# Set HTTPD=httpd%apache_branch.worker to use a server
# with the thread-based "worker" MPM; BE WARNED that some modules may not
# work correctly with a thread-based MPM; notably PHP will refuse to start.
# Dont't forget to create httpd.worker.conf config file. copying existing
# httpd.conf could be a good starting point.
# (!) Warning: Stop httpd2 service BEFORE changing the following line
#HTTPD=httpd%apache_branch.worker
#
# If you like to include specific options, do it here
# To start with SSL defined uncomment the next line
#OPTIONS="-DSSL"
# If you want to force proxied (for example by Apache1) mode, which is
# autodetected by default you could add "-DA1PROXIED"
#OPTIONS="-DA1PROXIED"
" > %buildroot%_sysconfdir/sysconfig/httpd%apache_branch
# Generate macros for rpm
%__mkdir_p %buildroot%_sysconfdir/rpm/macros.d
echo "apache_version %apache_version
apache_release %apache_release
# first we define apache-ru compatible macroses
apache_basedir %apache_basedir
apache_confdir %apache_confdir
apache_addonconfdir %apache_addonconfdir
apache_vhostconfdir %apache_vhostconfdir
apache_addonvhostconfdir %apache_addonvhostconfdir
apache_moduledir %apache_moduledir
apache_logdir %apache_logdir
apache_addondocdir %apache_addondocdir
apache_datadir %apache_datadir
apache_htdocsdir %apache_htdocsdir
apache_cgibindir %apache_cgibindir
apache_apxs %apache_apxs
apache_user %apache_user
apache_group %apache_group
apache_webmaster %apache_webmaster
suexec_docroot %suexec_docroot
# This tells apache-based packages what
# APR to require and use
apache_apr_buildreq %apache_apr_buildreq
apache_apr_config %apache_apr_config
apache_apu_config %apache_apu_config
# here goes apache2 specific macroses
# (although not all of them are required
# for building modules)
a_name %a_name
a_prefix %a_prefix
a_exec_prefix %a_exec_prefix
a_bindir %a_bindir
a_sbindir %a_sbindir
a_libdir %a_libdir
a_libexecdir %a_libexecdir
a_mandir %a_mandir
a_sysconfdir %a_sysconfdir
a_datadir %a_datadir
a_iconsdir %a_iconsdir
a_htdocsdir %a_htdocsdir
a_manualdir %a_manualdir
a_cgidir %a_cgidir
a_includedir %a_includedir
a_localstatedir %a_localstatedir
a_runtimedir %a_runtimedir
a_logfiledir %a_logfiledir
a_proxycachedir %a_proxycachedir
a_infodir %a_infodir
a_installbuilddir %a_installbuilddir
a_errordir %a_errordir
"|%__sed -e 's/^\([[:alpha:]]\+\)/%%\1/' > %buildroot%_sysconfdir/rpm/macros.d/%name
# replace the "official" apachectl by a symlink to the init script
%__rm -f %buildroot%a_sbindir/apachectl*
%__ln_s -f %_initdir/httpd%apache_branch \
%buildroot%a_sbindir/apachectl%apache_branch
# Generate logrotate file
%__mkdir_p %buildroot%_sysconfdir/logrotate.d
echo '%a_logfiledir/*log {
missingok
notifempty
sharedscripts
create 0644 root %apache_group
delaycompress
postrotate
/sbin/service httpd%apache_branch condreload >/dev/null
endscript
}
'>%buildroot%_sysconfdir/logrotate.d/%a_name
# install addon documentation root
%__mkdir_p %buildroot%apache_addondocdir
###
## Install apachkconfig favour description file
#
%__mkdir_p %buildroot%apachk_favours_dir
%__install -m 600 %SOURCE1 %buildroot%apachk_favours_dir/
%__subst "s:-=apache_addonconfdir=-:%apache_addonconfdir:" %buildroot%apachk_favours_dir/apache2.favour
###
## now remove installed files we ain't gonna use
#
%__rm -f %buildroot%a_installbuilddir/config.nice \
%buildroot%a_libexecdir/httpd.exp \
%buildroot%a_mandir/man8/apachectl* \
%buildroot%a_errordir/README
#============ S C R I P T S ==================================================
#
#
%pre
%_sbindir/groupadd -r -f %apache_group 2>/dev/null ||:
%_sbindir/groupadd -r -f %apache_webmaster 2>/dev/null ||:
%_sbindir/useradd -g %apache_group -c 'Apache2 WWW server' -d %apache_datadir -s '/dev/null' \
-r %apache_user 2>/dev/null
exit 0
%preun
if [ $1 = 0 ]; then
%preun_service httpd%apache_branch
fi
%post
%post_service httpd%apache_branch
%post manual
%__ln_s -nf %a_manualdir %_docdir/%a_name-%apache_version/manual
%preun manual
if [ $1 = 0 ]; then
%__rm -f %_docdir/%a_name-manual-%apache_version/manual
fi
%post mod_ssl
#%_sbindir/ldconfig ### is this needed?
umask 077
if [ ! -f %a_sysconfdir/ssl.key/server.key ] ; then
%_bindir/openssl genrsa -rand /proc/apm:/proc/cpuinfo:/proc/dma:/proc/filesystems:/proc/interrupts:/proc/ioports:/proc/pci:/proc/rtc:/proc/uptime 1024 > %a_sysconfdir/ssl.key/server.key 2> /dev/null
fi
FQDN=`hostname`
if [ "x${FQDN}" = "x" ]; then
FQDN=localhost.localdomain
fi
if [ ! -f %a_sysconfdir/ssl.crt/server.crt ] ; then
cat << EOF | %_bindir/openssl req -new -key %a_sysconfdir/ssl.key/server.key -x509 -days 365 -out %a_sysconfdir/ssl.crt/server.crt 2>/dev/null
--
SomeState
SomeCity
SomeOrganization
SomeOrganizationalUnit
${FQDN}
root at ${FQDN}
EOF
fi
%files
%doc ABOUT_APACHE README CHANGES LICENSE
%dir %apache_basedir/
%apache_basedir/logs
%apache_basedir/run
%apache_basedir/modules
%dir %a_sysconfdir/
%config(noreplace) %a_sysconfdir/h*.conf
%config(noreplace) %a_sysconfdir/magic
%config(noreplace) %a_sysconfdir/mime.types
%dir %apache_addonconfdir/
%dir %apache_vhostconfdir/
%dir %apache_addonvhostconfdir/
%dir %apache_vhosttempldir/
%apache_vhosttempldir/default.conf
%attr(0644,root,root) %config(noreplace) %_sysconfdir/logrotate.d/%a_name
%config %_initdir/httpd%apache_branch
%attr(0600,root,root) %config(noreplace) %_sysconfdir/sysconfig/httpd%apache_branch
%dir %a_runtimedir/
%apachk_favours_dir/apache2.favour
%a_bindir/ab*
%a_bindir/ht*
%a_bindir/logresolve*
%a_sbindir/httpd%apache_branch
%a_sbindir/httpd%apache_branch.worker
%a_sbindir/apachectl*
%a_sbindir/rotatelogs*
%a_sbindir/checkgid*
%a_sbindir/dbmmanage*
%a_sbindir/httxt2dbm*
%dir %a_libdir/
%dir %a_libexecdir/
# everything but mod_ssl.so:
%a_libexecdir/mod_[a-r]*.so
%a_libexecdir/mod_s[petu]*.so
%a_libexecdir/mod_[t-z]*.so
%dir %apache_datadir/
%dir %a_cgidir/
%attr(2775,root,%apache_webmaster) %dir %a_htdocsdir/
%dir %a_iconsdir/
%dir %a_errordir/
%dir %a_errordir/include/
%a_iconsdir/*
%a_htdocsdir/*
%a_cgidir/*
%config(noreplace) %a_errordir/*.var
%config(noreplace) %a_errordir/include/*.html
%attr(0750,root,%apache_group) %dir %a_logfiledir
%attr(0700,%apache_user,%apache_group) %dir %a_localstatedir/lib/dav
%a_mandir/man1/*
%a_mandir/man8/rotatelogs*
%a_mandir/man8/suexec*
%a_mandir/man8/httpd*
%files manual
%a_manualdir
%apache_addondocdir
%files mod_ssl
%a_libexecdir/mod_ssl.so
%config(noreplace) %a_sysconfdir/s*.conf
%attr(0700,root,root) %dir %a_sysconfdir/ssl.*
#%config %_sysconfdir/httpd/conf/Makefile
#%dir %_sysconfdir/httpd/conf/ssl.*
%attr(0700,%apache_user,root) %dir %a_proxycachedir/mod_ssl
%attr(0600,%apache_user,root) %ghost %a_proxycachedir/mod_ssl/scache.dir
%attr(0600,%apache_user,root) %ghost %a_proxycachedir/mod_ssl/scache.pag
%attr(0600,%apache_user,root) %ghost %a_proxycachedir/mod_ssl/scache.sem
%files devel
%apache_basedir/build
%a_includedir/.mmn
%a_includedir/ap_*
%a_includedir/[hmoprsu]*
#%a_libexecdir/httpd.exp
#%a_installbuilddir/config.nice
%a_sbindir/apxs*
%a_mandir/man8/apxs*
%dir %a_installbuilddir
%a_installbuilddir/[clprs]*.mk
%a_installbuilddir/instdso.sh
%a_sbindir/envvars*
%attr(0644,root,root) %_sysconfdir/rpm/macros.d/*
%files suexec
%attr(4510,root,%apache_group) %a_sbindir/suexec*
%if_enabled apache_native_apr
%files -n %a_name-libapr
%a_libdir/libapr-0.so.*
%files -n %a_name-libapr-devel
%a_libdir/libapr-0.so
%a_libdir/libapr-0.la
%a_libdir/apr.exp
%a_installbuilddir/libtool
%a_installbuilddir/apr_rules.mk
%a_includedir/apr*.h
%a_bindir/apr-config*
%if_enabled static
%files -n %a_name-libapr-devel-static
%a_libdir/libapr-0.a
%files -n %a_name-libaprutil-devel-static
%a_libdir/libaprutil-0.a
%endif
%files -n %a_name-libaprutil
%a_libdir/libaprutil-0.so.*
%files -n %a_name-libaprutil-devel
%a_libdir/libaprutil-0.so
%a_libdir/libaprutil-0.la
%a_libdir/aprutil.exp
%a_includedir/apu*.h
%a_bindir/apu-config*
%files -n %a_name-libaprutil-devel-static
%a_libdir/libaprutil-0.a
%endif
%changelog
…
Полный changelog можно просмотреть здесь
%def_with M24
%def_without M30
%def_without libdb44
%define apache_release alt1
%if_with libdb44
%define apache_release alt1.1.libdb4.4
%endif
%if_with M24
%define apache_release alt0.M24.1
%endif
%if_with M30
%define apache_release alt0.M30.1
%endif
%define mmn 20020903
%define n_aprver 0.9.7
%define n_dbver 4.3
%if_with libdb44
%define n_dbver 4.4
%endif
%if_with M24
%define n_dbver 4.2
%endif
# do we need to co-exist with apache-ru ?
%def_enable apache_ru_compat
# if we do, what suffix to use ?
%define branch 2
# do we use native apr/apu ?
%def_disable apache_native_apr
%def_disable static
# handle initscript style change
%define dist_tag Sisyphus
%if_with M24
%define dist_tag Master
%endif
# name pkg-config pakage
%define n_pkgconfig pkg-config
%if_with M24
%define n_pkgconfig pkgconfig
%endif
%if_enabled apache_ru_compat
%define apache_branch %branch
%else
%define apache_branch %nil
%endif
%define a_name apache%apache_branch
%define apache_basedir %_sysconfdir/httpd%apache_branch
%define apache_confdir %apache_basedir/conf
%define apache_addonconfdir %apache_confdir/addon.d
%define apache_vhostconfdir %apache_confdir/vhost.d
%define apache_addonvhostconfdir %apache_confdir/vhost.d-addon
%define apache_vhosttempldir %apache_confdir/vhost.templ
%define apache_moduledir %_libdir/%a_name/modules
%define apache_logdir %_logdir/httpd%apache_branch
%define apache_datadir %srv_dir/%a_name
%define apache_htdocsdir %apache_datadir/html
%define apache_cgibindir %apache_datadir/cgi-bin
%define apache_apxs %_sbindir/apxs%apache_branch
%define apache_user apache%apache_branch
%define apache_group apache%apache_branch
%define apache_webmaster webmaster
%define suexec_docroot /home
%define apache_webmaster webmaster
%define a_prefix %apache_basedir
%define a_exec_prefix %prefix
%define a_bindir %_bindir
%define a_sbindir %_sbindir
%define a_libdir %_libdir/%a_name
%define a_libexecdir %a_libdir/modules
%define a_mandir %_mandir
%define a_sysconfdir %apache_confdir
%define a_datadir %apache_datadir
%define a_iconsdir %apache_datadir/icons
%define a_htdocsdir %apache_htdocsdir
%define a_manualdir %apache_datadir/manual
%define a_cgidir %apache_cgibindir
%define a_includedir %_includedir/apache%apache_branch
%define a_localstatedir %_var
%define a_runtimedir %_var/run/httpd%apache_branch
%define a_logfiledir %apache_logdir
%define a_proxycachedir %_cachedir/httpd%apache_branch
%define a_infodir %_infodir
%define a_installbuilddir %a_libdir/build
%define a_errordir %apache_datadir/error
%define apache_addondocdir %apache_datadir/manual-addons
%if_enabled apache_native_apr
%define apache_apr_buildreq "%a_name-libapr-devel %a_name-libaprutil-devel"
%define apache_apr_config %a_bindir/apr-config%apache_branch
%define apache_apu_config %a_bindir/apu-config%apache_branch
%else
%define apache_apr_buildreq "libapr-devel libaprutil-devel"
%define apache_apr_config %_bindir/apr-config
%define apache_apu_config %_bindir/apu-config
%endif
Name: %a_name
Version: %apache_version
Release: %apache_release
License: Apache Software License
Group: System/Servers
Url: http://httpd.apache.org/
Packager: Aleksey Avdeev <solo at altlinux.ru>
Summary: The most widely used Web server on the Internet
Summary(ru_RU.KOI8-R): Самый популярный веб-сервер Internet
Summary(uk_UA.KOI8-U): Найб╕льш популярний веб-сервер Internet
Source0: http://www.apache.org/dist/httpd/httpd-%version.tar.bz2
Source1: apache2.favour
#Source2: http://www.apache.org/dist/httpd/httpd-%version.tar.bz2.md5
Source30: altlinux.html
Source31: altlinux.png
# initscripts for ALM2.2 and friends and current Sisyphus
Source33: httpd2.init.Master
Source35: httpd2.init.Sisyphus
Patch1: httpd-2.0.55-alt-build.patch
Provides: webserver %name = %apache_version-%apache_release
Provides: %name-mmn = %mmn
%if_disabled apache_ru_compat
Conflicts: apache-common apache apache-mod_perl
%endif
Requires: vhosts-filesystem
Requires: perl-DBM perl-Digest-SHA1 zlib
%if_enabled apache_native_apr
Requires: %a_name-libapr = %apache_version
%else
Requires: libapr >= %n_aprver
Requires: libaprutil >= %n_aprver
BuildPreReq: libapr-devel >= %n_aprver
BuildPreReq: libaprutil-devel >= %n_aprver
%endif
# Automatically added by buildreq on Fri Mar 31 2006
BuildRequires: libssl-devel openssl zlib-devel
BuildPreReq: %n_pkgconfig
BuildPreReq: vhosts-filesystem-devel
%if_enabled static
BuildPreReq: libdb%n_dbver-devel-static
BuildPreReq: libsasl2-devel-static
%endif
BuildPreReq: libdb%n_dbver-devel
BuildPreReq: libgdbm-devel
BuildPreReq: libexpat-devel
#BuildPreReq: libpcre-devel
BuildPreReq: openldap libldap-devel
BuildPreReq: libsasl2-devel libsasl2-plugin-gssapi
BuildPreReq: openssl libssl-devel
#following is required by dbmmanage
BuildPreReq: perl-DBM perl-Digest-SHA1 zlib-devel
%description
Apache is a powerful, full-featured, efficient and freely-available
Web server.
This package contains a new (and thus not vary good tested) branch
of Apache web server
%description -l ru_RU.KOI8-R
Apache - мощный, функциональный, высокопроизводительный и
свободно распространяемый веб-сервер.
Этот пакет содержит новую и поэтому не очень хорошо оттестированную версию
веб-сервера Apache.
%package devel
Summary: Module development tools for the Apache web server
Summary(ru_RU.KOI8-R): Средства разработки модулей для веб-сервера Apache
Group: Development/C
Obsoletes: secureweb-devel
PreReq: %name = %apache_version-%apache_release
%if_disabled apache_native_apr
Obsoletes: %a_name-libapr %a_name-libapr-devel %a_name-libapr-devel %a_name-libaprutil %a_name-libaprutil-devel %a_name-libaprutil-devel
Requires: libapr-devel libaprutil-devel
%else
Requires: %a_name-libapr-devel %a_name-libaprutil-devel
%endif
%description devel
The apache-devel package contains the source code for the Apache
Web server you'll need to build Dynamic
Shared Objects (DSOs) for Apache.
If you are installing the Apache Web server and
you want to be able to compile or develop additional modules
for Apache, you'll need to install this package.
%description -l ru_RU.KOI8-R devel
Пакет содержит заголовочные файлы из исходных текстов веб-сервера Apache,
необходимые для сборки динамически подключаемых модулей (DSO).
Если Вы устанавливаете веб-сервер Apache и собираетесь компилировать или
разрабатывать для него дополнительные модули, Вам нужно установить этот пакет.
%package manual
Summary: Apache Manual
Summary(ru_RU.KOI8-R): Документация по Apache
Group: Books/Other
PreReq: %name = %apache_version-%apache_release
AutoReq: no
%description manual
This package contains the Apache server documentation in HTML format.
%description -l ru_RU.KOI8-R manual
Этот пакет содержит документацию к веб-серверу Apache в формате HTML.
%package mod_ssl
Group: System/Servers
Summary: SSL/TLS module for the Apache HTTP server
Serial: 1
BuildPreReq: libssl-devel
PreReq: openssl
Requires: %name, %name-mmn = %mmn
%description mod_ssl
The mod_ssl module provides strong cryptography for the Apache Web
server via the Secure Sockets Layer (SSL) and Transport Layer
Security (TLS) protocols.
%package suexec
Summary: Suexec binary for Apache
Summary(ru_RU.KOI8-R): Программа suexec для Apache
Summary(uk_UA.KOI8-U): Програма suexec для Apache
Group: System/Servers
PreReq: %name = %apache_version-%apache_release
%description suexec
This package adds suexec to Apache. Suexec provides Apache users the ability
to run CGI and SSI programs under user IDs different from the user ID of the
calling web-server. Normally, when a CGI or SSI program executes, it runs as
the same user who is running the web server.
%description -l ru_RU.KOI8-R suexec
Этот пакет добавляет к Apache suexec. Эта программа позволяет запускать CGI-
и SSI-программы под идентификаторами пользователя, отличными от UID
веб-сервера.
%description -l uk_UA.KOI8-U suexec
Цей пакунок дода╓ до Apache suexec. Ця програма дозволя╓ запускати CGI-
та SSI-програми п╕д ╕дентиф╕каторами користувача, що в╕др╕зняються в╕д
UID веб-серверу.
%if_enabled apache_native_apr
%package -n %a_name-libapr
Summary: Apache Portable Runtime shared libraries used by Apache2
Group: System/Servers
#Provides: libapr = %n_aprver
%description -n %a_name-libapr
The mission of the Apache Portable Runtime (APR) is to provide a free
library of C data structures and routines, forming a system portability
layer to as many operating systems as possible, including Unices,
MS Win32, BeOS and OS/2.
%package -n %a_name-libapr-devel
Summary: Development files for Apache Portable Runtime used by Apache2
Group: Development/C
Requires: %a_name-libapr = %apache_version
#Provides: libapr-devel = %n_aprver
%description -n %a_name-libapr-devel
Development files for Apache Portable Runtime used by Apache2
%package -n %a_name-libapr-devel-static
Summary: Static libraries for Apache Portable Runtime used by Apache2
Group: Development/C
Requires: %a_name-libapr-devel = %apache_version
#Provides: libapr-devel-static = %n_aprver
%description -n %a_name-libapr-devel-static
Static libraries for Apache Portable Runtime used by Apache2
%package -n %a_name-libaprutil
Summary: Apache Portable Runtime Utility shared libraries used by Apache2
Group: System/Servers
#Provides: libaprutil = %n_aprver
%description -n %a_name-libaprutil
Apache Portable Runtime Utility shared libraries used by Apache2
%package -n %a_name-libaprutil-devel
Summary: Development files for Apache Portable Runtime Utility libraries used by Apache2
Group: Development/C
Requires: %a_name-libaprutil = %apache_version
#Provides: libaprutil-devel = %n_aprver
%description -n %a_name-libaprutil-devel
Development files for Apache Portable Runtime Utility libraries used by Apache2
%if_enabled static
%package -n %a_name-libaprutil-devel-static
Summary: Static libraries for Apache Portable Runtime Utility libraries used by Apache2
Group: Development/C
Requires: %a_name-libaprutil-devel = %apache_version
#Provides: libaprutil-devel-static = %n_aprver
%description -n %a_name-libaprutil-devel-static
Static libraries for Apache Portable Runtime Utility libraries used by Apache2
%endif
%endif
%add_findprov_lib_path %a_libdir
%prep
# We dont need to expand builddir yet
%setup -q -n httpd-%version
%patch1 -p1
# generate ALTLinux Apache layout
echo "
# ALTLinux layout
<Layout ALTLinux>
prefix: %a_prefix
exec_prefix: %a_exec_prefix
bindir: %a_bindir
sbindir: %a_sbindir
libdir: %a_libdir
libexecdir: %a_libexecdir
mandir: %a_mandir
sysconfdir: %a_sysconfdir
datadir: %a_datadir
iconsdir: %a_iconsdir
htdocsdir: %a_htdocsdir
manualdir: %a_manualdir
cgidir: %a_cgidir
includedir: %a_includedir
localstatedir: %a_localstatedir
runtimedir: %a_runtimedir
logfiledir: %a_logfiledir
proxycachedir: %a_proxycachedir
infodir: %a_infodir
installbuilddir: %a_installbuilddir
errordir: %a_errordir
</Layout>
" >> config.layout
# Safety check: prevent build if defined MMN does not equal upstream MMN.
vmmn=`echo MODULE_MAGIC_NUMBER_MAJOR | cpp -include $PWD/include/ap_mmn.h | grep -e '^[0-9]'`
if [ "$vmmn" != "%mmn" ]; then
: Error: Upstream MMN is now ${vmmn}, packaged MMN is %mmn.
: Update the mmn macro and rebuild.
exit 1
fi
%build
function mpmbuild()
{
mpm=$1; shift
mkdir $mpm; pushd $mpm
cat > config.cache <<EOF
ac_cv_func_pthread_mutexattr_setpshared=no
ac_cv_func_sem_open=no
EOF
../configure -C \
--enable-layout=ALTLinux \
--with-perl=%__perl \
%if_disabled apache_native_apr
--with-apr=%_bindir/apr-config \
--with-apr-util=%_bindir/apu-config \
%endif
--enable-suexec --with-suexec \
--with-suexec-caller=%apache_user \
--with-suexec-docroot=%suexec_docroot \
--with-suexec-logfile=%a_logfiledir/suexec.log \
--with-suexec-bin=%a_sbindir/suexec%apache_branch \
--with-suexec-uidmin=500 --with-suexec-gidmin=500 \
--with-suexec-userdir=public_html \
--enable-so \
--with-mpm=$mpm \
--with-devrandom \
--with-ldap --enable-ldap --enable-auth-ldap \
--enable-cache --enable-disk-cache --enable-mem-cache \
--enable-ssl --with-ssl \
--enable-deflate --enable-cgid \
--enable-proxy --enable-proxy-connect \
--enable-proxy-http --enable-proxy-ftp \
--enable-charset_lite=shared \
$*
%make_build
popd
}
%__autoconf
# Only bother enabling optional modules for main build.
mpmbuild prefork --enable-mods-shared=all --with-program-name=httpd%apache_branch
# To prevent most modules being built statically into httpd.worker,
# easiest way seems to be enable them shared.
mpmbuild worker --enable-mods-shared=all --with-program-name=httpd%apache_branch.worker
# Verify that the same modules were built into the two httpd binaries
./prefork/httpd%apache_branch -l | grep -v prefork > prefork.mods
./worker/httpd%apache_branch.worker -l | grep -v worker > worker.mods
if ! diff -u prefork.mods worker.mods; then
: Different modules built into httpd binaries, will not proceed
exit 1
fi
%install
# Classify ab and logresolve as section 1 commands, as they are in /usr/bin
pushd docs/man
%__mv ab.8 ab%apache_branch.1
%if_enabled apache_ru_compat
MANS="apachectl.8 apxs.8 dbmmanage.1 htdigest.1 htpasswd.1 httpd.8 rotatelogs.8 logresolve.8 suexec.8"
for manpage in $MANS; do
%__mv ${manpage} `echo ${manpage}|sed -e "s/\./%apache_branch./"`
done
%endif
%__mv logresolve%apache_branch.8 logresolve%apache_branch.1
popd
pushd prefork
make DESTDIR=%buildroot install
popd
# install worker binary
WDIR=worker
%if_enabled apache_native_apr
WDIR="$WDIR/.libs"
%endif
%__install -m 755 $WDIR/httpd%apache_branch.worker %buildroot%a_sbindir/
#-----------------------------------------------------------------------------------
# Tune up executibles to co-exist with apache-ru
#
pushd %buildroot%a_sbindir
%if_enabled apache_ru_compat
#rename suexec binary to be named that apache is expect it to be
%__mv suexec suexec%apache_branch
#
# rename tools
# Maybe it's better to push ru-apache-devel before installing devel package
%__rm envvars-std
for tool in apxs checkgid dbmmanage envvars rotatelogs httxt2dbm; do
mv ${tool} ${tool}%apache_branch
done
#fix apxs
%__subst 's|\(\/envvars\)"|\1%apache_branch"|
s|\(apachectl\)|\1%apache_branch|
%if_enabled apache_native_apr
s|\(apr-config\)|\1%apache_branch|
s|\(apu-config\)|\1%apache_branch|
%endif
' apxs%apache_branch
%endif
# move&rename utilities to /usr/bin
TOOLS="ab htdbm logresolve htpasswd htdigest"
for tool in $TOOLS; do
%__mv ${tool} %buildroot%a_bindir/${tool}%apache_branch
done
popd
%if_enabled apache_ru_compat
%if_enabled apache_native_apr
pushd %buildroot%a_bindir
# rename ap?-config
for tool in ap?-config; do
%__mv ${tool} ${tool}%apache_branch
done
popd
%endif
%endif
#
#-----------------------------------------------------------------------------------
# mod_ssl bits
for suffix in crl crt csr key prm; do
mkdir %buildroot%a_sysconfdir/ssl.${suffix}
done
# Makefiles for certificate management
#for ext in crt crl; do
# install -m 644 ./build/rpm/mod_ssl-Makefile.${ext} \
# $RPM_BUILD_ROOT%_sysconfdir/httpd/conf/ssl.${ext}/Makefile.${ext}
#done
#ln -s ../../../usr/share/ssl/certs/Makefile $RPM_BUILD_ROOT/etc/httpd/conf
# for holding mod_dav lock database
mkdir -p %buildroot%a_localstatedir/lib/dav
# create a prototype session cache
mkdir -p %buildroot%a_proxycachedir/mod_ssl
touch %buildroot%a_proxycachedir/mod_ssl/scache.{dir,pag,sem}
# Make the MMN accessible to module packages
echo %mmn > %buildroot%a_includedir/.mmn
# docroot
rm -r %buildroot%a_manualdir/style
#rm %buildroot%a_manualdir/*/*.xml
# symlinks for /etc/httpd
ln -s %a_logfiledir %buildroot%apache_basedir/logs
ln -s %a_runtimedir %buildroot%apache_basedir/run
ln -s %a_libexecdir %buildroot%apache_basedir/modules
ln -s %a_installbuilddir %buildroot%apache_basedir/build
# create config dirs for additional modules and Virtual hosts
%__mkdir %buildroot%apache_addonconfdir
%__mkdir %buildroot%apache_vhostconfdir
%__mkdir %buildroot%apache_addonvhostconfdir
#------------------------------------------------------------------------------------
# tune up configuration files
pushd %buildroot%a_sysconfdir
%__subst '/### Section 3: Virtual Hosts/{
i \
### \
# Load config files from the config directory "%apache_addonconfdir". \
# \
Include %apache_addonconfdir/A.*.conf \
}' httpd*.conf
%__subst '/Listen 80/{
c \
\
### \
# This is a hack to run proxified Apache2 in case Apache1 is running \
# \
<IfDefine A1PROXIED> \
Listen localhost:8088 \
</IfDefine> \
\
<IfDefine !A1PROXIED> \
Listen 80 \
</IfDefine> \
}
/#NameVirtualHost \*:80/{
c \
<IfDefine A1PROXIED> \
#NameVirtualHost *:8088 \
</IfDefine> \
\
<IfDefine !A1PROXIED> \
#NameVirtualHost *:80 \
</IfDefine> \
}
/AliasMatch \^\/manual(/{
i \
Alias /manual/addons "%apache_addondocdir" \
}
/^<Directory .*manual/{
i \
<Directory "%apache_addondocdir"> \
AllowOverride None \
Options +Indexes +MultiViews \
Order allow,deny \
Allow from all \
</Directory> \
}
s/^User .*/User %apache_user/
s/^Group .*/Group %apache_group/
s/^ServerAdmin you/ServerAdmin %apache_webmaster/
' httpd*.conf
echo '
###
# Load Virual Hosts config files from the config directory "%apache_vhostconfdir".
#
Include %apache_addonvhostconfdir/A.*.conf
Include %apache_vhostconfdir/A.*.conf
' >> httpd%apache_branch.conf
# For now just clone config for worker httpd
cp httpd%apache_branch.conf httpd%apache_branch.worker.conf
popd
# Provide default template fot virtual hosts
%__mkdir %buildroot%apache_vhosttempldir
echo '
<VirtualHost *>
ServerName www.-=name=-.ru
ServerAlias -=name=-.ru
ServerAdmin www-adm at -=name=-.ru
DocumentRoot %vhosts_dir/-=name=-/htdocs
ScriptAlias /cgi-bin/ %vhosts_dir/-=name=-/feedback/cgis/
ErrorLog %vhosts_dir/-=name=-/log/error_log_a2
TransferLog %vhosts_dir/-=name=-/log/access_log_a2
AddDefaultCharset WINDOWS-1251
CharsetSourceEnc WINDOWS-1251
CharsetDefault WINDOWS-1251
# CharsetRecodeMultipartForms Off
</VirtualHost>
'>%buildroot%apache_vhosttempldir/default.conf
#------------------------------------------------------------------------------------
#install ALT misc documentation and logos
for f in %buildroot%a_htdocsdir/index.html*; do
%__subst '/<\/[bB][oO][dD][yY]>/{
i \
<center> \
<p><a href="manual/addons/">Addon modules documentation</a></p> \
<img SRC="icons/altlinux.png" ALT="ALT Linux" > \
</center>
}' $f
done
#%__install -m644 %SOURCE30 %buildroot%a_htdocsdir
%__install -m644 %SOURCE31 %buildroot%a_iconsdir
%__perl -pi -e "s|/usr/local/bin/perl|%__perl|g;" \
%buildroot%a_manualdir/search/manual-index.cgi
# install the init script
%__mkdir_p %buildroot%_initdir
%if "%dist_tag" == "Master"
%__install -m755 %SOURCE33 \
%buildroot%_initdir/httpd%apache_branch
%else
%__install -m755 %SOURCE35 \
%buildroot%_initdir/httpd%apache_branch
%endif
#substitute the real paths in initscript
%__subst 's|-=name=-|httpd%apache_branch|g
s|-=pidfile=-|%a_runtimedir/httpd.pid|g
s|-=conffile=-|%apache_confdir/httpd%apache_branch.conf|g
s|-=modules=-|%apache_moduledir|g' %buildroot%_initdir/httpd%apache_branch
# generate sysconfig settings file
%__mkdir_p %buildroot%_sysconfdir/sysconfig
echo "# Set HTTPD=httpd%apache_branch.worker to use a server
# with the thread-based "worker" MPM; BE WARNED that some modules may not
# work correctly with a thread-based MPM; notably PHP will refuse to start.
# Dont't forget to create httpd.worker.conf config file. copying existing
# httpd.conf could be a good starting point.
# (!) Warning: Stop httpd2 service BEFORE changing the following line
#HTTPD=httpd%apache_branch.worker
#
# If you like to include specific options, do it here
# To start with SSL defined uncomment the next line
#OPTIONS="-DSSL"
# If you want to force proxied (for example by Apache1) mode, which is
# autodetected by default you could add "-DA1PROXIED"
#OPTIONS="-DA1PROXIED"
" > %buildroot%_sysconfdir/sysconfig/httpd%apache_branch
# Generate macros for rpm
%__mkdir_p %buildroot%_sysconfdir/rpm/macros.d
echo "apache_version %apache_version
apache_release %apache_release
# first we define apache-ru compatible macroses
apache_basedir %apache_basedir
apache_confdir %apache_confdir
apache_addonconfdir %apache_addonconfdir
apache_vhostconfdir %apache_vhostconfdir
apache_addonvhostconfdir %apache_addonvhostconfdir
apache_moduledir %apache_moduledir
apache_logdir %apache_logdir
apache_addondocdir %apache_addondocdir
apache_datadir %apache_datadir
apache_htdocsdir %apache_htdocsdir
apache_cgibindir %apache_cgibindir
apache_apxs %apache_apxs
apache_user %apache_user
apache_group %apache_group
apache_webmaster %apache_webmaster
suexec_docroot %suexec_docroot
# This tells apache-based packages what
# APR to require and use
apache_apr_buildreq %apache_apr_buildreq
apache_apr_config %apache_apr_config
apache_apu_config %apache_apu_config
# here goes apache2 specific macroses
# (although not all of them are required
# for building modules)
a_name %a_name
a_prefix %a_prefix
a_exec_prefix %a_exec_prefix
a_bindir %a_bindir
a_sbindir %a_sbindir
a_libdir %a_libdir
a_libexecdir %a_libexecdir
a_mandir %a_mandir
a_sysconfdir %a_sysconfdir
a_datadir %a_datadir
a_iconsdir %a_iconsdir
a_htdocsdir %a_htdocsdir
a_manualdir %a_manualdir
a_cgidir %a_cgidir
a_includedir %a_includedir
a_localstatedir %a_localstatedir
a_runtimedir %a_runtimedir
a_logfiledir %a_logfiledir
a_proxycachedir %a_proxycachedir
a_infodir %a_infodir
a_installbuilddir %a_installbuilddir
a_errordir %a_errordir
"|%__sed -e 's/^\([[:alpha:]]\+\)/%%\1/' > %buildroot%_sysconfdir/rpm/macros.d/%name
# replace the "official" apachectl by a symlink to the init script
%__rm -f %buildroot%a_sbindir/apachectl*
%__ln_s -f %_initdir/httpd%apache_branch \
%buildroot%a_sbindir/apachectl%apache_branch
# Generate logrotate file
%__mkdir_p %buildroot%_sysconfdir/logrotate.d
echo '%a_logfiledir/*log {
missingok
notifempty
sharedscripts
create 0644 root %apache_group
delaycompress
postrotate
/sbin/service httpd%apache_branch condreload >/dev/null
endscript
}
'>%buildroot%_sysconfdir/logrotate.d/%a_name
# install addon documentation root
%__mkdir_p %buildroot%apache_addondocdir
###
## Install apachkconfig favour description file
#
%__mkdir_p %buildroot%apachk_favours_dir
%__install -m 600 %SOURCE1 %buildroot%apachk_favours_dir/
%__subst "s:-=apache_addonconfdir=-:%apache_addonconfdir:" %buildroot%apachk_favours_dir/apache2.favour
###
## now remove installed files we ain't gonna use
#
%__rm -f %buildroot%a_installbuilddir/config.nice \
%buildroot%a_libexecdir/httpd.exp \
%buildroot%a_mandir/man8/apachectl* \
%buildroot%a_errordir/README
#============ S C R I P T S ==================================================
#
#
%pre
%_sbindir/groupadd -r -f %apache_group 2>/dev/null ||:
%_sbindir/groupadd -r -f %apache_webmaster 2>/dev/null ||:
%_sbindir/useradd -g %apache_group -c 'Apache2 WWW server' -d %apache_datadir -s '/dev/null' \
-r %apache_user 2>/dev/null
exit 0
%preun
if [ $1 = 0 ]; then
%preun_service httpd%apache_branch
fi
%post
%post_service httpd%apache_branch
%post manual
%__ln_s -nf %a_manualdir %_docdir/%a_name-%apache_version/manual
%preun manual
if [ $1 = 0 ]; then
%__rm -f %_docdir/%a_name-manual-%apache_version/manual
fi
%post mod_ssl
#%_sbindir/ldconfig ### is this needed?
umask 077
if [ ! -f %a_sysconfdir/ssl.key/server.key ] ; then
%_bindir/openssl genrsa -rand /proc/apm:/proc/cpuinfo:/proc/dma:/proc/filesystems:/proc/interrupts:/proc/ioports:/proc/pci:/proc/rtc:/proc/uptime 1024 > %a_sysconfdir/ssl.key/server.key 2> /dev/null
fi
FQDN=`hostname`
if [ "x${FQDN}" = "x" ]; then
FQDN=localhost.localdomain
fi
if [ ! -f %a_sysconfdir/ssl.crt/server.crt ] ; then
cat << EOF | %_bindir/openssl req -new -key %a_sysconfdir/ssl.key/server.key -x509 -days 365 -out %a_sysconfdir/ssl.crt/server.crt 2>/dev/null
--
SomeState
SomeCity
SomeOrganization
SomeOrganizationalUnit
${FQDN}
root at ${FQDN}
EOF
fi
%files
%doc ABOUT_APACHE README CHANGES LICENSE
%dir %apache_basedir/
%apache_basedir/logs
%apache_basedir/run
%apache_basedir/modules
%dir %a_sysconfdir/
%config(noreplace) %a_sysconfdir/h*.conf
%config(noreplace) %a_sysconfdir/magic
%config(noreplace) %a_sysconfdir/mime.types
%dir %apache_addonconfdir/
%dir %apache_vhostconfdir/
%dir %apache_addonvhostconfdir/
%dir %apache_vhosttempldir/
%apache_vhosttempldir/default.conf
%attr(0644,root,root) %config(noreplace) %_sysconfdir/logrotate.d/%a_name
%config %_initdir/httpd%apache_branch
%attr(0600,root,root) %config(noreplace) %_sysconfdir/sysconfig/httpd%apache_branch
%dir %a_runtimedir/
%apachk_favours_dir/apache2.favour
%a_bindir/ab*
%a_bindir/ht*
%a_bindir/logresolve*
%a_sbindir/httpd%apache_branch
%a_sbindir/httpd%apache_branch.worker
%a_sbindir/apachectl*
%a_sbindir/rotatelogs*
%a_sbindir/checkgid*
%a_sbindir/dbmmanage*
%a_sbindir/httxt2dbm*
%dir %a_libdir/
%dir %a_libexecdir/
# everything but mod_ssl.so:
%a_libexecdir/mod_[a-r]*.so
%a_libexecdir/mod_s[petu]*.so
%a_libexecdir/mod_[t-z]*.so
%dir %apache_datadir/
%dir %a_cgidir/
%attr(2775,root,%apache_webmaster) %dir %a_htdocsdir/
%dir %a_iconsdir/
%dir %a_errordir/
%dir %a_errordir/include/
%a_iconsdir/*
%a_htdocsdir/*
%a_cgidir/*
%config(noreplace) %a_errordir/*.var
%config(noreplace) %a_errordir/include/*.html
%attr(0750,root,%apache_group) %dir %a_logfiledir
%attr(0700,%apache_user,%apache_group) %dir %a_localstatedir/lib/dav
%a_mandir/man1/*
%a_mandir/man8/rotatelogs*
%a_mandir/man8/suexec*
%a_mandir/man8/httpd*
%files manual
%a_manualdir
%apache_addondocdir
%files mod_ssl
%a_libexecdir/mod_ssl.so
%config(noreplace) %a_sysconfdir/s*.conf
%attr(0700,root,root) %dir %a_sysconfdir/ssl.*
#%config %_sysconfdir/httpd/conf/Makefile
#%dir %_sysconfdir/httpd/conf/ssl.*
%attr(0700,%apache_user,root) %dir %a_proxycachedir/mod_ssl
%attr(0600,%apache_user,root) %ghost %a_proxycachedir/mod_ssl/scache.dir
%attr(0600,%apache_user,root) %ghost %a_proxycachedir/mod_ssl/scache.pag
%attr(0600,%apache_user,root) %ghost %a_proxycachedir/mod_ssl/scache.sem
%files devel
%apache_basedir/build
%a_includedir/.mmn
%a_includedir/ap_*
%a_includedir/[hmoprsu]*
#%a_libexecdir/httpd.exp
#%a_installbuilddir/config.nice
%a_sbindir/apxs*
%a_mandir/man8/apxs*
%dir %a_installbuilddir
%a_installbuilddir/[clprs]*.mk
%a_installbuilddir/instdso.sh
%a_sbindir/envvars*
%attr(0644,root,root) %_sysconfdir/rpm/macros.d/*
%files suexec
%attr(4510,root,%apache_group) %a_sbindir/suexec*
%if_enabled apache_native_apr
%files -n %a_name-libapr
%a_libdir/libapr-0.so.*
%files -n %a_name-libapr-devel
%a_libdir/libapr-0.so
%a_libdir/libapr-0.la
%a_libdir/apr.exp
%a_installbuilddir/libtool
%a_installbuilddir/apr_rules.mk
%a_includedir/apr*.h
%a_bindir/apr-config*
%if_enabled static
%files -n %a_name-libapr-devel-static
%a_libdir/libapr-0.a
%files -n %a_name-libaprutil-devel-static
%a_libdir/libaprutil-0.a
%endif
%files -n %a_name-libaprutil
%a_libdir/libaprutil-0.so.*
%files -n %a_name-libaprutil-devel
%a_libdir/libaprutil-0.so
%a_libdir/libaprutil-0.la
%a_libdir/aprutil.exp
%a_includedir/apu*.h
%a_bindir/apu-config*
%files -n %a_name-libaprutil-devel-static
%a_libdir/libaprutil-0.a
%endif
%changelog
…
Полный changelog можно просмотреть здесь