1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
|
# $Id: /local/php5.1/debian/module.packages 719 2005-09-24T11:08:42.619419Z dexter $
# convert package name to macro name
%define pkgname %`echo %{package} | tr '-' '_'`
# some of modules are available only for specific SAPI
%define sapilist_default apache apache2 cgi cli fcgi
%define sapilist %{sapilist_%{?sapilist_%{pkgname}:%{pkgname}}%{!?sapilist_%{pkgname}:default}}
# some of packages have different dsoname name
%define dsoname_default %{pkgname}
%define dsoname %{dsoname_%{?dsoname_%{pkgname}:%{pkgname}}%{!?dsoname_%{pkgname}:default}}
# some of packages depends on other modules
%define depends_default
%define depends %{depends_%{?depends_%{pkgname}:%{pkgname}}%{!?depends_%{pkgname}:default}}
# the priority for package
%define priority_default 500
%define priority %{priority_%{?priority_%{pkgname}:%{pkgname}}%{!?priority_%{pkgname}:default}}
# the architecture of the package
%define architecture_default any
%define architecture %{architecture_%{?architecture_%{pkgname}:%{pkgname}}%{!?architecture_%{pkgname}:default}}
# Macros:
# package=%{package}
# pkgname=%{pkgname}
# extname=%{extname}
# dsoname=%{dsoname}
# sapilist=%{sapilist}
# depends=%{depends}
# priority=%{priority}
# architecture=%{architecture}
Package: php%{php_pkg_version}-%{package}
Architecture: %{architecture}
Provides: php%{php_major_version}-%{package}
Depends: php%{php_pkg_version}-common (= ${Source-Version}),
Depends: phpapi-%{phpapi_version}
Depends: %`for i in %{depends}; do printf 'php%{php_pkg_version}-%s (= %{VERSION}), ' $i; done`
Depends: []
Install: sh
sapilist=""
for SAPI in %{sapilist}; do
sapilist="$sapilist $SAPI"
done
sapilist=$(eval echo $sapilist)
if [ -n "$sapilist" ]; then
yada install -lib -into /usr/lib/php%{php_pkg_version}/%{phpapi_version} modules-build/modules/%{dsoname}.so
yada install -dir /etc/php%{php_pkg_version}/conf.d
(
test "%{depends}" != "%{depends_default}" && echo "; depends=%{depends}"
test "%{sapilist}" != "%{sapilist_default}" && echo "; sapilist=%{sapilist}"
echo "extension=%{dsoname}.so"
) > $ROOT/etc/php%{php_pkg_version}/conf.d/%{priority}%{package}.ini
fi
for f in ext/%{dsoname}/package.xml ext/%{dsoname}/[ABCDEFGHIJKLMNOPQRSTUVWXYZ]*; do
if [ -s "$f" ]; then
yada install -doc "$f"
yada remove -doc INSTALL
fi
done
Preinst: sh
if [ "$1" = "install" ] && [ -z "$2" ]; then
# Set the stamps for each package before calling php-modconf
mkdir -p /etc/php%{php_pkg_version}/conf.d
echo "# php%{php_pkg_version}-modconf stamp. You can safely remove this file." \
> /etc/php%{php_pkg_version}/conf.d/%{priority}%{package}.ini.stamp.dpkg-tmp
fi
Postinst: sh
if [ "$1" = "configure" ] && [ -z "$2" ]; then
# Find stamps for ini files.
stamp=$(echo /etc/php%{php_pkg_version}/conf.d/*.ini.stamp.dpkg-tmp)
# Show debconf dialog if only one stamp still exists.
if [ "$stamp" = "/etc/php%{php_pkg_version}/conf.d/%{priority}%{package}.ini.stamp.dpkg-tmp" ]; then
quiet=
else
quiet=quiet
fi
for SAPI in %{sapilist}; do
if [ -d /etc/php%{php_pkg_version}/$SAPI/conf.d ]; then
php%{php_pkg_version}-modconf $SAPI enable %{dsoname} $quiet
fi
done
fi
if [ "$1" = "configure" ]; then
# Remove the stamp after calling php-modconf
rm -f /etc/php%{php_pkg_version}/conf.d/%{priority}%{package}.ini.stamp.dpkg-tmp
fi
Prerm: sh
if [ "$1" = "remove" ]; then
for SAPI in %{sapilist}; do
if [ -d /etc/php%{php_pkg_version}/$SAPI/conf.d ]; then
php%{php_pkg_version}-modconf $SAPI disable %{dsoname} quiet
fi
done
fi
Postrm: sh
# Remove the stamp on package removing or install failure
rm -f /etc/php%{php_pkg_version}/conf.d/%{priority}%{package}.ini.stamp.dpkg-tmp || true
rmdir -p /etc/php%{php_pkg_version}/conf.d >/dev/null 2>&1 || true
Overrides:
description-synopsis-starts-with-a-capital-letter
package-name-doesnt-match-sonames %{dsoname}.so
|