DESTDIR=`cd $(top_builddir) && pwd`/destdir; rm -rf $$DESTDIR; \
$(SHELL) $(srcdir)/mkinstalldirs $$DESTDIR/$(timedir) && \
$(MAKE) install DESTDIR=$$DESTDIR && \
- $(SHELL) $(srcdir)/pp \
+ $(SHELL) $(srcdir)/pp $(PPFLAGS) \
--destdir=$$DESTDIR \
$(srcdir)/sudo.pp \
bindir=$(bindir) \
sudoers_uid=$(sudoers_uid) \
sudoers_gid=$(sudoers_gid) \
sudoers_mode=$(sudoers_mode) \
- version=$(VERSION)
+ version=$(VERSION) $(PPVARS)
.PHONY: ChangeLog
#!/bin/sh
#
# Build a binary package using polypkg
-# Usage: mkpkg
+# Usage: mkpkg [--debug] [--flavor flavor] [--platform platform]
#
# Make sure IFS is set to space, tab, newline in that order.
'
IFS=" $nl"
+# Parse arguments
+usage="usage: mkpkg [--debug] [--flavor flavor] [--platform platform]"
+debug=0
+while test $# -gt 0; do
+ case "$1" in
+ --debug)
+ set -x
+ PPFLAGS="--debug${PPFLAGS+ }${PPFLAGS}"
+ ;;
+ --flavor=?*)
+ arg=`echo "$1" | sed -n 's/^--flavor=\(.*\)/\1/p'`
+ PPVARS="${PPVARS}${PPVARS+ }flavor=$arg"
+ ;;
+ --flavor)
+ if [ $# -lt 2 ]; then
+ echo "$usage" 1>&2
+ exit 1
+ fi
+ PPVARS="${PPVARS}${PPVARS+ }flavor=$2"
+ shift
+ ;;
+ --platform=?*)
+ arg=`echo "$1" | sed -n 's/^--platform=\(.*\)/\1/p'`
+ PPVARS="${PPVARS}${PPVARS+ }platform=$arg"
+ ;;
+ --platform)
+ if [ $# -lt 2 ]; then
+ echo "$usage" 1>&2
+ exit 1
+ fi
+ PPVARS="${PPVARS}${PPVARS+ }platform=$2"
+ shift
+ ;;
+ esac
+ shift
+done
+
top_srcdir=`dirname $0`
platform=`$top_srcdir/pp --probe` || exit 1
set -- $configure_opts
IFS="$OIFS"
$top_srcdir/configure "$@" || exit 1
-make $make_opts && make $make_opts package
+make $make_opts && make $make_opts PPFLAGS="$PPFLAGS" PPVARS="$PPVARS" package
%set
- if test -n "$SUDO_FLAVOR"; then
- name="sudo-$SUDO_FLAVOR"
+ if test -n "$flavor"; then
+ name="sudo-$flavor"
else
name="sudo"
fi
# create symlink to ease transition to new path for ldap config
# if old config file exists and new one doesn't
- if test X"%{SUDO_FLAVOR}" = X"ldap" -a \
+ if test X"%{flavor}" = X"ldap" -a \
-r /etc/ldap/ldap.conf -a ! -r /etc/sudo-ldap.conf; then
ln -s /etc/ldap/ldap.conf /etc/sudo-ldap.conf
fi
%preun [deb]
# Remove the /etc/ldap/ldap.conf -> /etc/sudo-ldap.conf symlink if
# it matches what we created in the postinstall script.
- if test X"%{SUDO_FLAVOR}" = X"ldap" -a \
+ if test X"%{flavor}" = X"ldap" -a \
X"`readlink /etc/sudo-ldap.conf 2>/dev/null`" = X"/etc/ldap/ldap.conf"; then
rm -f /etc/sudo-ldap.conf
fi