Commit 1369696b authored by Otto Kekäläinen's avatar Otto Kekäläinen

Deb: Re-factor conditional build dependency checking and injecting

Now we check if a dependency is available and not just if older versions
are available. Also use correct name of libcrack2 to actually detect it.

Use sed to inject dependency at the end of the dependency list.
Otherwise keep the control line clean and parseable by Debian tools.
parent 44dd9a53
......@@ -37,20 +37,33 @@ LOGSTRING="MariaDB build"
CODENAME="$(lsb_release -sc)"
# add libcrack2 (>= 2.9.0) as a build dependency
# but only where the distribution can possibly satisfy it and if not on Travis-CI
if $TRAVIS || apt-cache madison cracklib2|grep 'cracklib2 *| *2\.[0-8]\.' >/dev/null 2>&1
# Add libcrack2 (>= 2.9.0) as a build dependency if available in the distribution
# This matches Debian Jessie, Stretch and Ubuntu Trusty, Wily, Xenial, Yakkety
# Update check when version 2.10 or newer is available.
# On Travis-CI never build cracklib, as it is forbidden on Travis-CI.org
if [[ ! $TRAVIS ]] && apt-cache madison libcrack2-dev | grep 'libcrack2-dev *| *2\.9' >/dev/null 2>&1
then
# Anything in MARIADB_OPTIONAL_DEBS is omitted from the resulting
# packages by snipped in rules file
MARIADB_OPTIONAL_DEBS="${MARIADB_OPTIONAL_DEBS} cracklib-password-check-10.2"
sed -i -e "/\\\${MAYBE_LIBCRACK}/d" debian/control
# Remove package entry from control file completely so that
# resulting Debian source package will actually be buildable
sed -i -e "/Package: mariadb-cracklib-password-check/,+6d" debian/control
else
MAYBE_LIBCRACK='libcrack2-dev (>= 2.9.0),'
sed -i -e "s/\\\${MAYBE_LIBCRACK}/${MAYBE_LIBCRACK}/g" debian/control
sed 's/Standards-Version/,libcrack2-dev (>= 2.9.0)\nStandards-Version/' debian/control
cat <<EOT >> debian/control
Package: mariadb-cracklib-password-check-10.2
Architecture: any
Depends: libcrack2 (>= 2.9.0),
mariadb-server-10.2,
\${misc:Depends},
\${shlibs:Depends}
Description: CrackLib Password Validation Plugin for MariaDB
This password validation plugin uses cracklib to allow only
sufficiently secure (as defined by cracklib) user passwords in MariaDB.
EOT
fi
# Add libpcre3-dev (>= 2:8.35-3.2~) as a build dependency if available in the distribution
# This matches Debian Jessie, Stretch and Ubuntu Wily, Xenial, Yakkety
# Update check when version 2:8.40 or newer is available.
if apt-cache madison libpcre3-dev | grep 'libpcre3-dev *| *2:8\.3[2-9]' >/dev/null 2>&1
then
sed 's/Standards-Version/,libpcre3-dev (>= 2:8.35-3.2~)\nStandards-Version/' debian/control
fi
# Adjust changelog, add new version.
......
......@@ -24,7 +24,6 @@ Build-Depends: bison,
po-debconf,
psmisc,
unixodbc-dev,
${MAYBE_LIBCRACK}
zlib1g-dev (>= 1:1.1.3-5~)
Standards-Version: 3.8.2
Homepage: http://mariadb.org/
......@@ -434,16 +433,6 @@ Description: OQGraph storage engine for MariaDB
(trees) and graphs (friend-of-a-friend, etc) cleanly through standard SQL.
This package contains the OQGraph plugin for MariaDB.
Package: mariadb-cracklib-password-check-10.2
Architecture: any
Depends: libcrack2 (>= 2.9.0),
mariadb-server-10.2,
${misc:Depends},
${shlibs:Depends}
Description: CrackLib Password Validation Plugin for MariaDB
This password validation plugin uses cracklib to allow only
sufficiently secure (as defined by cracklib) user passwords in MariaDB.
Package: mariadb-gssapi-server-10.2
Architecture: any
Depends: libgssapi-krb5-2,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment