bashrc_sssd revision 3c77599361395caeffe91ad5b7553f29e7859942
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher# For best results, add the following lines to ~/.bashrc:
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher# if [ -f /path/to/sssd-source/contrib/fedora/bashrc_sssd ]; then
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher# . /path/to/sssd-source/contrib/fedora/bashrc_sssd
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher# Determine the architecture of the platform we're running on
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen GallagherSSS_ARCH=$(uname -p)
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher# Determine the lib and libdir locations
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen GallagherSSS_LIB=$(rpm --eval %{_lib})
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen GallagherSSS_LIBDIR=$(rpm --eval %{_libdir})
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher# Add the following line to your .bashrc if you want SSSD to throw errors on
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher# compiler warnings (recommended)
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher# SSS_WERROR=-Werror
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher# Determine the number of available processors on the system for parallel make
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen GallagherPROCESSORS=$(/usr/bin/getconf _NPROCESSORS_ONLN)
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher# Configure invocation for use on Fedora systems, based on the %configure RPM
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher# macro from the redhat-rpm-config package. This macro assumes you are building
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher# in a parallel build directory beneath the source directory. All other macros
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher# in this script will assume that the location is
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagheralias fedconfig='../configure \
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher --build=$SSS_ARCH-unknown-linux-gnu \
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher --host=$SSS_ARCH-unknown-linux-gnu \
3c77599361395caeffe91ad5b7553f29e7859942Stephen Gallagher --program-prefix= \
3c77599361395caeffe91ad5b7553f29e7859942Stephen Gallagher --prefix=/usr \
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher --exec-prefix=/usr \
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher --sysconfdir=/etc \
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher --libdir=$SSS_LIBDIR \
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher --localstatedir=/var \
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher --sharedstatedir=/var/lib \
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher --enable-nsslibdir=/$SSS_LIB \
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher --enable-pammoddir=/$SSS_LIB/security \
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher --with-krb5-rcache-dir=/var/cache/krb5rcache \
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher --with-initscript=systemd \
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher --with-test-dir=/dev/shm \
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher --enable-all-experimental-features \
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher $SSSD_NO_MANPAGES'
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher# Quick alias to completely purge the current working directory, then recreate
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher# and reconfigure it. This is best used when you are making changes to the m4
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher# macros or the configure scripts.
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagheralias reconfig='autoreconf -if \
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher && rm -Rf $SSS_ARCH/ \
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher && mkdir $SSS_ARCH/ \
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher && cd $SSS_ARCH/ \
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher# Set the list of warnings that you want to detect (and in the case of remake
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher# and chmake want to treat as errors)
2930ff3863961403d89a0b1147c14b82f91ad7ebStephen GallagherSSS_WARNINGS='-Wall \
2930ff3863961403d89a0b1147c14b82f91ad7ebStephen Gallagher -Wno-unused-parameter \
2930ff3863961403d89a0b1147c14b82f91ad7ebStephen Gallagher -Wno-sign-compare \
2930ff3863961403d89a0b1147c14b82f91ad7ebStephen Gallagher -Wformat-security'
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher# Build (or finish building) all objects and then run the build-tests against
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher# them. This builds with optimizations turned off and GDB debugging symbols.
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagheralias chmake='make V=0 CFLAGS+="-ggdb3 -O0 $SSS_WARNINGS $SSS_WERROR" \
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher -j$PROCESSORS check'
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher# Clean the build directory and rebuild all objects, then run the build-tests
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher# against them. This builds with optimizations turned off and GDB debugging
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagheralias remake='make clean > /dev/null && chmake'
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher# Clean the build directory and rebuild all objects, hiding most of the build
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher# output except for warnings and errors. This builds with standard CFLAGS.
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagheralias warn='make clean >/dev/null \
2930ff3863961403d89a0b1147c14b82f91ad7ebStephen Gallagher && make CFLAGS+="$SSS_WARNINGS" -j$PROCESSORS tests > /dev/null'
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher# Install the built sources to the current system, cleaning up the LDB modules
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher# and making sure that the NSS and PAM modules have the right SELinux context.
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagheralias sssinstall='sudo make -j$PROCESSORS install \
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher && sudo rm -f $SSS_LIBDIR/ldb/modules/ldb/memberof.la \
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher && sudo restorecon -v /$SSS_LIB/libnss_sss.so.2 \
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher# Alias to generate a patch or series of patches that meet SSSD submission
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagher# genpatch -N (where N is the number of patches to submit)
ccaea33f064842b16c7c9efeb50028cacdee6b2fStephen Gallagheralias genpatch='git format-patch -M -C --patience --full-index'