On Tue, Mar 05, 2013 at 02:16:53PM -0500, Stephen Gallagher wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I've been meaning to put these together and submit them for a while.
This is the set of macros and aliases I've been using for years to
build SSSD. I played around with them today, adding some
auto-detection for the platform being built, so it should be pretty
robust. I've only tested it on Fedora 18 x86_64 though.
Basically, one should only need to do:
. /path/to/sssd-source/contrib/fedora/bashrc_sssd
cd /path/to/sssd-source
reconfig && chmake
(optionally) sssinstall
And have a working install of the latest sources on the current
machine. The 'remake' and 'warn' aliases come in handy as well. Last
of all it includes a 'genpatch' alias that makes creating patches that
meet our submission guidelines easy.
p.s. These are submitted to the sssd/contrib/fedora directory because
I do not expect them to work on a non-Fedora system (though it may
work on RHEL 6 and later).
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (GNU/Linux)
Comment: Using GnuPG with Thunderbird -
http://www.enigmail.net/
iEYEARECAAYFAlE2RKUACgkQeiVVYja6o6M2wACcCEhk7alWMlk6QQG8WaXdLNVM
5icAnAm+tLAKyB35N5hLP6oyq5kaQkeY
=ad5f
-----END PGP SIGNATURE-----
From
18ddc067a74923efc2edf0a938b5b5aa3c82a133 Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <sgallagh(a)redhat.com>
Date: Tue, 5 Mar 2013 14:07:23 -0500
Subject: [PATCH] BUILD: Add contributed macros and aliases to simplify
building
---
contrib/fedora/bashrc_sssd | 78 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 78 insertions(+)
create mode 100644 contrib/fedora/bashrc_sssd
diff --git a/contrib/fedora/bashrc_sssd b/contrib/fedora/bashrc_sssd
new file mode 100644
index 0000000000000000000000000000000000000000..9db8e9513876923c03a0be3230d6334a6b2911d3
--- /dev/null
+++ b/contrib/fedora/bashrc_sssd
@@ -0,0 +1,78 @@
+# For best results, add the following lines to ~/.bashrc:
+# if [ -f /path/to/sssd-source/contrib/fedora/bashrc_sssd ]
+# . /path/to/sssd-source/contrib/fedora/bashrc_sssd
+# fi
+
+# Determine the architecture of the platform we're running on
+SSS_ARCH=`uname -p`
+
+# Determine the lib and libdir locations
+SSS_LIB=`rpm --eval %{_lib}`
+SSS_LIBDIR=`rpm --eval %{_libdir}`
+
I personally prefer $() to backticks, but that may be just my
preference.
+# Determine the number of available processors on the system for
parallel make
+# invocation.
+PROCESSORS=`/usr/bin/getconf _NPROCESSORS_ONLN`
+
+# Configure invocation for use on Fedora systems, based on the %configure RPM
+# macro from the redhat-rpm-config package. This macro assumes you are building
+# in a parallel build directory beneath the source directory. All other macros
+# in this script will assume that the location is /path/to/sssd-source/$SSS_ARCH
+alias fedconfig='../configure \
+ --build=$SSS_ARCH-unknown-linux-gnu \
+ --host=$SSS_ARCH-unknown-linux-gnu \
+ --target=$SSS_ARCH-redhat-linux-gnu \
+ --program-prefix= --prefix=/usr \
+ --exec-prefix=/usr \
+ --bindir=/usr/bin \
+ --sbindir=/usr/sbin \
+ --sysconfdir=/etc \
+ --datadir=/usr/share \
+ --includedir=/usr/include \
+ --libdir=$SSS_LIBDIR \
+ --libexecdir=/usr/libexec \
+ --localstatedir=/var \
+ --sharedstatedir=/var/lib \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --enable-nsslibdir=/$SSS_LIB \
+ --enable-pammoddir=/$SSS_LIB/security \
+ --with-krb5-rcache-dir=/var/cache/krb5rcache \
+ --with-initscript=systemd \
+ --with-test-dir=/dev/shm \
+ --enable-all-experimental-features \
+ --with-default-ccache-dir=/run/user/%U \
+ --with-default-ccname-template=DIR:%d/ccdir \
+ --cache-file=/tmp/fedconfig.cache \
+ $SSSD_NO_MANPAGES'
+
+# Quick alias to completely purge the current working directory, then recreate
+# and reconfigure it. This is best used when you are making changes to the m4
+# macros or the configure scripts.
+alias reconfig='autoreconf -if && rm -Rf $SSS_ARCH/ && mkdir
$SSS_ARCH/ && cd $SSS_ARCH/ && fedconfig'
+
+# Set the list of warnings that you want to detect (and in the case of remake
+# and chmake want to treat as errors)
+WARNINGS='-Wall -Wextra -Wno-unused-parameter -Wno-sign-compare
-Wformat-security'
+
+# Clean the build directory and rebuild all objects, then run the build-tests
+# against them.
+alias remake='make clean > /dev/null && make V=0 CFLAGS+="-ggdb3 -O0
$WARNINGS -Werror" -j%PROCESSORS check'
+
+# Build (or finish building) all objects and then run the build-tests against
+# them.
+alias chmake='make V=0 CFLAGS+="-ggdb3 -O0 $WARNINGS -Werror"
-j$PROCESSORS check'
+
+# Clean the build directory and rebuild all objects, hiding most of the build
+# output except for warnings and errors.
+alias warn='make clean >/dev/null && make CFLAGS+="$WARNINGS"
-j$PROCESSORS tests > /dev/null'
+
+# Install the built sources to the current system, cleaning up the LDB modules
+# and making sure that the NSS and PAM modules have the right SELinux context.
+alias sssinstall='sudo make -j$PROCESSORS install && sudo rm -f
/usr/lib64/ldb/modules/ldb/memberof.la && sudo restorecon -v
/usr/lib64/libnss_sss.so.2 /usr/lib64/security/pam_sss.so'
^^^
I think SSS_LIB should be used to remove the memberof module instead.
The rest looks good to me as far as contrib/ stuff goes.
+
+# Alias to generate a patch or series of patches that meet SSSD submission
+# guidelines.
+# Usage:
+# genpatch -N (where N is the number of patches to submit)
+alias genpatch='git format-patch -M -C --patience --full-index'
--
1.8.1.4
_______________________________________________
sssd-devel mailing list
sssd-devel(a)lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/sssd-devel