diff options
author | Karl MacMillan <kmacmill@redhat.com> | 2007-10-18 15:16:07 -0400 |
---|---|---|
committer | Karl MacMillan <kmacmill@redhat.com> | 2007-10-18 15:16:07 -0400 |
commit | 4c59be2b0d00afdc6bfe58fa813cb3570657b3d4 (patch) | |
tree | 4ef11fba63c2d0f8d114414626e89f1e61e589a2 | |
parent | 6249f20526006c3576fb099491132d403bb66cbe (diff) | |
download | freeipa-4c59be2b0d00afdc6bfe58fa813cb3570657b3d4.tar.gz freeipa-4c59be2b0d00afdc6bfe58fa813cb3570657b3d4.tar.xz freeipa-4c59be2b0d00afdc6bfe58fa813cb3570657b3d4.zip |
Fix autogen.sh to correctly compare versions and removed .la files from packages.
-rwxr-xr-x | ipa-client/autogen.sh | 55 | ||||
-rwxr-xr-x | ipa-server/autogen.sh | 53 | ||||
-rwxr-xr-x | ipa-server/freeipa-server.spec | 8 | ||||
-rw-r--r-- | ipa-server/freeipa-server.spec.in | 8 |
4 files changed, 85 insertions, 39 deletions
diff --git a/ipa-client/autogen.sh b/ipa-client/autogen.sh index 072bd15aa..c95b6dbc6 100755 --- a/ipa-client/autogen.sh +++ b/ipa-client/autogen.sh @@ -2,7 +2,7 @@ # Run this to generate all the initial makefiles, etc. set -e -PACKAGE=freeipa-client +PACKAGE=freeipa-server LIBTOOLIZE=${LIBTOOLIZE-libtoolize} LIBTOOLIZE_FLAGS="--copy --force" @@ -33,6 +33,26 @@ ORIGDIR=`pwd` cd $srcdir +# Usage: +# compare_versions MIN_VERSION ACTUAL_VERSION +# returns true if ACTUAL_VERSION >= MIN_VERSION +compare_versions() { + ch_min_version=$1 + ch_actual_version=$2 + ch_status=0 + IFS="${IFS= }"; ch_save_IFS="$IFS"; IFS="." + set $ch_actual_version + for ch_min in $ch_min_version; do + ch_cur=`echo $1 | sed 's/[^0-9].*$//'`; shift # remove letter suffixes + if [ -z "$ch_min" ]; then break; fi + if [ -z "$ch_cur" ]; then ch_status=1; break; fi + if [ $ch_cur -gt $ch_min ]; then break; fi + if [ $ch_cur -lt $ch_min ]; then ch_status=1; break; fi + done + IFS="$ch_save_IFS" + return $ch_status +} + if ($AUTOCONF --version) < /dev/null > /dev/null 2>&1 ; then if ($AUTOCONF --version | head -n 1 | awk 'NR==1 { if( $(NF) >= '$autoconf_min_vers') \ exit 1; exit 0; }'); @@ -78,23 +98,24 @@ fi # aren't sufficiently new. # if ($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 ; then - if ($AUTOMAKE --version | head -n 1 | awk 'NR==1 { if( $(NF) >= '$automake_min_vers') \ - exit 1; exit 0; }'); - then - echo "$ARGV0: ERROR: \`$AUTOMAKE' is too old." - $AUTOMAKE --version - echo " (version $automake_min_vers or newer is required)" - DIE="yes" - fi + automake_actual_version=`$AUTOMAKE --version | head -n 1 | \ + sed 's/^.*[ ]\([0-9.]*[a-z]*\).*$/\1/'` + if ! compare_versions $automake_min_vers $automake_actual_version; then + echo "$ARGV0: ERROR: \`$AUTOMAKE' is too old." + $AUTOMAKE --version + echo " (version $automake_min_vers or newer is required)" + DIE="yes" + fi if ($ACLOCAL --version) < /dev/null > /dev/null 2>&1; then - if ($ACLOCAL --version | head -n 1 | awk 'NR==1 { if( $(NF) >= '$aclocal_min_vers' ) \ - exit 1; exit 0; }' ); - then - echo "$ARGV0: ERROR: \`$ACLOCAL' is too old." - $ACLOCAL --version - echo " (version $aclocal_min_vers or newer is required)" - DIE="yes" - fi + aclocal_actual_version=`$ACLOCAL --version | head -n 1 | \ + sed 's/^.*[ ]\([0-9.]*[a-z]*\).*$/\1/'` + + if ! compare_versions $aclocal_min_vers $aclocal_actual_version; then + echo "$ARGV0: ERROR: \`$ACLOCAL' is too old." + $ACLOCAL --version + echo " (version $aclocal_min_vers or newer is required)" + DIE="yes" + fi else echo $ACLOCAL: command not found echo diff --git a/ipa-server/autogen.sh b/ipa-server/autogen.sh index 2e80fc216..c95b6dbc6 100755 --- a/ipa-server/autogen.sh +++ b/ipa-server/autogen.sh @@ -33,6 +33,26 @@ ORIGDIR=`pwd` cd $srcdir +# Usage: +# compare_versions MIN_VERSION ACTUAL_VERSION +# returns true if ACTUAL_VERSION >= MIN_VERSION +compare_versions() { + ch_min_version=$1 + ch_actual_version=$2 + ch_status=0 + IFS="${IFS= }"; ch_save_IFS="$IFS"; IFS="." + set $ch_actual_version + for ch_min in $ch_min_version; do + ch_cur=`echo $1 | sed 's/[^0-9].*$//'`; shift # remove letter suffixes + if [ -z "$ch_min" ]; then break; fi + if [ -z "$ch_cur" ]; then ch_status=1; break; fi + if [ $ch_cur -gt $ch_min ]; then break; fi + if [ $ch_cur -lt $ch_min ]; then ch_status=1; break; fi + done + IFS="$ch_save_IFS" + return $ch_status +} + if ($AUTOCONF --version) < /dev/null > /dev/null 2>&1 ; then if ($AUTOCONF --version | head -n 1 | awk 'NR==1 { if( $(NF) >= '$autoconf_min_vers') \ exit 1; exit 0; }'); @@ -78,23 +98,24 @@ fi # aren't sufficiently new. # if ($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 ; then - if ($AUTOMAKE --version | head -n 1 | awk 'NR==1 { if( $(NF) >= '$automake_min_vers') \ - exit 1; exit 0; }'); - then - echo "$ARGV0: ERROR: \`$AUTOMAKE' is too old." - $AUTOMAKE --version - echo " (version $automake_min_vers or newer is required)" - DIE="yes" - fi + automake_actual_version=`$AUTOMAKE --version | head -n 1 | \ + sed 's/^.*[ ]\([0-9.]*[a-z]*\).*$/\1/'` + if ! compare_versions $automake_min_vers $automake_actual_version; then + echo "$ARGV0: ERROR: \`$AUTOMAKE' is too old." + $AUTOMAKE --version + echo " (version $automake_min_vers or newer is required)" + DIE="yes" + fi if ($ACLOCAL --version) < /dev/null > /dev/null 2>&1; then - if ($ACLOCAL --version | head -n 1 | awk 'NR==1 { if( $(NF) >= '$aclocal_min_vers' ) \ - exit 1; exit 0; }' ); - then - echo "$ARGV0: ERROR: \`$ACLOCAL' is too old." - $ACLOCAL --version - echo " (version $aclocal_min_vers or newer is required)" - DIE="yes" - fi + aclocal_actual_version=`$ACLOCAL --version | head -n 1 | \ + sed 's/^.*[ ]\([0-9.]*[a-z]*\).*$/\1/'` + + if ! compare_versions $aclocal_min_vers $aclocal_actual_version; then + echo "$ARGV0: ERROR: \`$ACLOCAL' is too old." + $ACLOCAL --version + echo " (version $aclocal_min_vers or newer is required)" + DIE="yes" + fi else echo $ACLOCAL: command not found echo diff --git a/ipa-server/freeipa-server.spec b/ipa-server/freeipa-server.spec index a5461cd87..59f69c811 100755 --- a/ipa-server/freeipa-server.spec +++ b/ipa-server/freeipa-server.spec @@ -32,6 +32,11 @@ rm -rf %{buildroot} make install +# Remove .la files from libtool - we don't want to package +# these files +rm %{buildroot}/%{plugin_dir}/libipa_pwd_extop.la +rm %{buildroot}/%{plugin_dir}/libipa-memberof-plugin.la +rm %{buildroot}/%{plugin_dir}/libipa-dna-plugin.la %clean rm -rf %{buildroot} @@ -49,11 +54,8 @@ rm -rf %{buildroot} %{_usr}/share/ipa/* %attr(755,root,root) %{plugin_dir}/libipa_pwd_extop.so -%attr(755,root,root) %{plugin_dir}/libipa_pwd_extop.la %attr(755,root,root) %{plugin_dir}/libipa-memberof-plugin.so -%attr(755,root,root) %{plugin_dir}/libipa-memberof-plugin.la %attr(755,root,root) %{plugin_dir}/libipa-dna-plugin.so -%attr(755,root,root) %{plugin_dir}/libipa-dna-plugin.la %changelog diff --git a/ipa-server/freeipa-server.spec.in b/ipa-server/freeipa-server.spec.in index fc24bb19d..2d9d43011 100644 --- a/ipa-server/freeipa-server.spec.in +++ b/ipa-server/freeipa-server.spec.in @@ -32,6 +32,11 @@ rm -rf %{buildroot} make install +# Remove .la files from libtool - we don't want to package +# these files +rm %{buildroot}/%{plugin_dir}/libipa_pwd_extop.la +rm %{buildroot}/%{plugin_dir}/libipa-memberof-plugin.la +rm %{buildroot}/%{plugin_dir}/libipa-dna-plugin.la %clean rm -rf %{buildroot} @@ -49,11 +54,8 @@ rm -rf %{buildroot} %{_usr}/share/ipa/* %attr(755,root,root) %{plugin_dir}/libipa_pwd_extop.so -%attr(755,root,root) %{plugin_dir}/libipa_pwd_extop.la %attr(755,root,root) %{plugin_dir}/libipa-memberof-plugin.so -%attr(755,root,root) %{plugin_dir}/libipa-memberof-plugin.la %attr(755,root,root) %{plugin_dir}/libipa-dna-plugin.so -%attr(755,root,root) %{plugin_dir}/libipa-dna-plugin.la %changelog |