kumquat-buildroot/package/sudo/sudo.mk
Eric Andersen 732d94d25f fixup a whole steaming pile of insanity. When packages are configured,
they should be configured with --prefix=/usr and we then need to use
make DESTDIR=$(STAGING_DIR) install to get things installed into the
staging directory.  The current situation for many packages, which use
--prefix=$(STAGING_DIR) results in the staging_dir paths getting compiled
into the binary itself.

This also adds in a pile of libtool fixups.  Between broken pkgconfig,
broken libtool handling, and broken --prefix settings, its a wonder
things have worked as well as they have up till now.
 -Erik
2007-01-14 03:52:21 +00:00

87 lines
2.3 KiB
Makefile

#############################################################
#
# sudo
#
#############################################################
SUDO_VER:=1.6.8p12
SUDO_SOURCE:=sudo-$(SUDO_VER).tar.gz
SUDO_SITE:=http://www.courtesan.com/sudo/dist
SUDO_DIR:=$(BUILD_DIR)/sudo-$(SUDO_VER)
SUDO_UNZIP:=$(ZCAT)
$(DL_DIR)/$(SUDO_SOURCE):
$(WGET) -P $(DL_DIR) $(SUDO_SITE)/$(SUDO_SOURCE)
sudo-source: $(DL_DIR)/$(SUDO_SOURCE) $(SUDO_CONFIG_FILE)
$(SUDO_DIR)/.unpacked: $(DL_DIR)/$(SUDO_SOURCE)
$(SUDO_UNZIP) $(DL_DIR)/$(SUDO_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
toolchain/patch-kernel.sh $(SUDO_DIR) package/sudo sudo\*.patch
touch $(SUDO_DIR)/.unpacked
$(SUDO_DIR)/.configured: $(SUDO_DIR)/.unpacked $(SUDO_CONFIG_FILE)
(cd $(SUDO_DIR); rm -rf config.cache; \
$(TARGET_CONFIGURE_OPTS) \
./configure \
CFLAGS="$(TARGET_CFLAGS)" \
--target=$(GNU_TARGET_NAME) \
--host=$(GNU_TARGET_NAME) \
--build=$(GNU_HOST_NAME) \
--prefix=/usr \
--exec-prefix=/usr \
--bindir=/usr/bin \
--sbindir=/usr/sbin \
--libdir=/lib \
--libexecdir=/usr/lib \
--sysconfdir=/etc \
--datadir=/usr/share \
--localstatedir=/var \
--mandir=/usr/man \
--infodir=/usr/info \
$(DISABLE_LARGEFILE) \
--without-lecture \
--without-sendmail \
--without-umask \
--with-logging=syslog \
--without-interfaces \
--disable-authentication \
$(SUDO_EXTRA_CONFIG) \
);
touch $(SUDO_DIR)/.configured
$(SUDO_DIR)/sudo: $(SUDO_DIR)/.configured
$(MAKE) -C $(SUDO_DIR)
touch -c $(SUDO_DIR)/sudo
$(TARGET_DIR)/usr/bin/sudo: $(SUDO_DIR)/sudo
$(INSTALL) -m 4555 -D $(SUDO_DIR)/sudo $(TARGET_DIR)/usr/bin/sudo
$(INSTALL) -m 0555 -D $(SUDO_DIR)/visudo $(TARGET_DIR)/usr/sbin/visudo
$(INSTALL) -m 0440 -D $(SUDO_DIR)/sudoers $(TARGET_DIR)/etc/sudoers
$(STRIP) $(TARGET_DIR)/usr/bin/sudo $(TARGET_DIR)/usr/sbin/visudo
touch -c $(TARGET_DIR)/usr/bin/sudo
sudo: uclibc $(TARGET_DIR)/usr/bin/sudo
sudo-clean:
rm -f $(TARGET_DIR)/usr/bin/sudo $(TARGET_DIR)/etc/sudoers \
$(TARGET_DIR)/usr/sbin/visudo
-$(MAKE) -C $(SUDO_DIR) clean
sudo-dirclean:
rm -rf $(SUDO_DIR)
#############################################################
#
# Toplevel Makefile options
#
#############################################################
ifeq ($(strip $(BR2_PACKAGE_SUDO)),y)
TARGETS+=sudo
endif
ifeq ($(strip $(BR2_PACKAGE_LIBPAM)),y)
SUDO_EXTRA_CONFIG=--enable-pam
sudo: libpam
endif