Skip to content

Commit

Permalink
MDEV-7305 Difficulties building cracklib_password_check
Browse files Browse the repository at this point in the history
put cracklib_password_check into a separate package.
build it conditionally on Debian/Ubuntu
  • Loading branch information
vuvova committed Feb 17, 2015
1 parent 87eb82d commit 11536f9
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 5 deletions.
12 changes: 11 additions & 1 deletion debian/autobake-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ set -e
# Buildbot, running the test suite from installed .debs on a clean VM.
export DEB_BUILD_OPTIONS="nocheck"

#export MARIADB_OPTIONAL_DEBS="tokudb-engine"
export MARIADB_OPTIONAL_DEBS=""

# Find major.minor version.
#
Expand All @@ -38,6 +38,15 @@ case "${CODENAME}" in
*) LIBREADLINE_DEV=libreadline-gplv2-dev ;;
esac

# add libcrack2 (>= 2.9.0) as a build dependency
# but only where the distribution can possibly satisfy it
if apt-cache madison cracklib2|grep 'cracklib2 *| *2\.[0-8]\.' >/dev/null 2>&1
then
MAYBE_LIBCRACK=''
MARIADB_OPTIONAL_DEBS="${MARIADB_OPTIONAL_DEBS} cracklib-password-check-10.1"
else
MAYBE_LIBCRACK='libcrack2-dev (>= 2.9.0),'
fi

# Clean up build file symlinks that are distro-specific. First remove all, then set
# new links.
Expand All @@ -56,6 +65,7 @@ DISTROFILES="$(ls ./debian/dist/${DISTRO})"
for distrofile in ${DISTROFILES}; do
rm -f "./debian/${distrofile}"
sed -e "s/\\\${LIBREADLINE_DEV}/${LIBREADLINE_DEV}/g" \
-e "s/\\\${MAYBE_LIBCRACK}/${MAYBE_LIBCRACK}/g" \
< "./debian/dist/${DISTRO}/${distrofile}" > "./debian/${distrofile}"
chmod --reference="./debian/dist/${DISTRO}/${distrofile}" "./debian/${distrofile}"
done;
Expand Down
9 changes: 8 additions & 1 deletion debian/dist/Debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Priority: optional
Maintainer: MariaDB Developers <maria-developers@lists.launchpad.net>
XSBC-Original-Maintainer: Maria Developers <maria-developers@lists.launchpad.net>
Uploaders: MariaDB Developers <maria-developers@lists.launchpad.net>
Build-Depends: libtool (>= 1.4.2-7), procps | hurd, debhelper, file (>= 3.28), libncurses5-dev (>= 5.0-6), perl (>= 5.6.0), libwrap0-dev (>= 7.6-8.3), zlib1g-dev (>= 1:1.1.3-5), ${LIBREADLINE_DEV}, libssl-dev, libpam0g-dev, psmisc, po-debconf, chrpath, automake1.9, doxygen, texlive-latex-base, ghostscript | gs-gpl, dpatch, gawk, bison, lsb-release, hardening-wrapper, cmake (>= 2.7), libaio-dev, libjemalloc-dev (>= 3.0.0)
Build-Depends: libtool (>= 1.4.2-7), procps | hurd, debhelper, file (>= 3.28), libncurses5-dev (>= 5.0-6), perl (>= 5.6.0), libwrap0-dev (>= 7.6-8.3), zlib1g-dev (>= 1:1.1.3-5), ${LIBREADLINE_DEV}, libssl-dev, libpam0g-dev, psmisc, po-debconf, chrpath, automake1.9, doxygen, texlive-latex-base, ghostscript | gs-gpl, dpatch, gawk, bison, lsb-release, hardening-wrapper, cmake (>= 2.7), libaio-dev, ${MAYBE_LIBCRACK} libjemalloc-dev (>= 3.0.0)
Standards-Version: 3.8.3
Homepage: http://mariadb.org/
Vcs-Browser: https://github.com/MariaDB/server/tree/10.1/
Expand Down Expand Up @@ -268,3 +268,10 @@ Description: Oqgraph storage engine for MariaDB
The OQGRAPH engine is a computation engine plugin for handling hierarchies
(trees) and graphs (friend-of-a-friend, etc) cleanly through standard SQL.

Package: mariadb-cracklib-password-check-10.1
Section: database
Architecture: any
Depends: mariadb-server-10.1, libcrack2 (>= 2.9.0)
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.
9 changes: 8 additions & 1 deletion debian/dist/Ubuntu/control
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Priority: optional
Maintainer: MariaDB Developers <maria-developers@lists.launchpad.net>
XSBC-Original-Maintainer: Maria Developers <maria-developers@lists.launchpad.net>
Uploaders: MariaDB Developers <maria-developers@lists.launchpad.net>
Build-Depends: libtool (>= 1.4.2-7), procps | hurd, debhelper, file (>= 3.28), libncurses5-dev (>= 5.0-6), perl (>= 5.6.0), libwrap0-dev (>= 7.6-8.3), zlib1g-dev (>= 1:1.1.3-5), ${LIBREADLINE_DEV}, libssl-dev, libpam0g-dev, psmisc, po-debconf, chrpath, automake1.9, doxygen, texlive-latex-base, ghostscript | gs-gpl, dpatch, gawk, bison, lsb-release, hardening-wrapper, cmake (>= 2.7), libaio-dev, libjemalloc-dev (>= 3.0.0)
Build-Depends: libtool (>= 1.4.2-7), procps | hurd, debhelper, file (>= 3.28), libncurses5-dev (>= 5.0-6), perl (>= 5.6.0), libwrap0-dev (>= 7.6-8.3), zlib1g-dev (>= 1:1.1.3-5), ${LIBREADLINE_DEV}, libssl-dev, libpam0g-dev, psmisc, po-debconf, chrpath, automake1.9, doxygen, texlive-latex-base, ghostscript | gs-gpl, dpatch, gawk, bison, lsb-release, hardening-wrapper, cmake (>= 2.7), libaio-dev, ${MAYBE_LIBCRACK} libjemalloc-dev (>= 3.0.0)
Standards-Version: 3.8.2
Homepage: http://mariadb.org/
Vcs-Browser: http://bazaar.launchpad.net/~maria-captains/maria/10.1/files
Expand Down Expand Up @@ -262,3 +262,10 @@ Description: Oqgraph storage engine for MariaDB
The OQGRAPH engine is a computation engine plugin for handling hierarchies
(trees) and graphs (friend-of-a-friend, etc) cleanly through standard SQL.

Package: mariadb-cracklib-password-check-10.1
Section: database
Architecture: any
Depends: mariadb-server-10.1, libcrack2 (>= 2.9.0)
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.
1 change: 1 addition & 0 deletions debian/mariadb-cracklib-password-check-10.1.files
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
usr/lib/mysql/plugin/cracklib_password_check.so
7 changes: 5 additions & 2 deletions plugin/cracklib_password_check/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
INCLUDE (CheckIncludeFiles)
INCLUDE (CheckLibraryExists)

CHECK_INCLUDE_FILES (crack.h HAVE_CRACK_H)
CHECK_LIBRARY_EXISTS(crack FascistCheckUser "" HAVE_LIBCRACK)

SET(CMAKE_REQUIRED_DEFINITIONS -Dsize_t=int) # debian hack, debian bug.
CHECK_INCLUDE_FILES (crack.h HAVE_CRACK_H)

IF (HAVE_ALLOCA_H AND HAVE_CRACK_H AND HAVE_LIBCRACK AND HAVE_MEMCPY)
MYSQL_ADD_PLUGIN(cracklib_password_check cracklib_password_check.c
LINK_LIBRARIES crack MODULE_ONLY)
LINK_LIBRARIES crack MODULE_ONLY
COMPONENT cracklib-password-check)
ENDIF()

0 comments on commit 11536f9

Please sign in to comment.