Starting with version 1.7.4, sudo is distributed in binary package form in addition to the traditional source tarballs. In order to support as many operating system-dependent package formats as possible without having to maintain a large number of configuration files, sudo uses PolyPkg to build the actual packages.
Package configuration is located in the sudo.pp file that is included with the sudo source distribution. The included mkpkg script can be used to configure sudo using the same parameters as the official binary packages and generate a package using the "package" target in the Makefile.
The mkpkg script supports the following options:
./mkpkg [options]from the sudo source directory.
On systems where the vendor sudo package does not include LDAP support, separate packages are built both with and without LDAP support. To build an LDAP-enabled sudo package, run:
./mkpkg --flavor=ldap [options]This will build a "sudo-ldap" package. If you need to pass the path to LDAP libraries and includes to configure, you may use the --with-ldap=/path/to/ldap flag just as you would with configure.
The local and target architectures should be given to mkpkg which will pass them along to configure. If possible, the cross-compiler and tools should be prefixed with the cpu-machine-os triple of the target platform.
For example sudo packages for Solaris/SPARC are cross-compiled on a Solaris/i386 machine as follows:
PATH=/opt/SUNWgccfss/5.10-sparc/usr/bin:$PATH \ LD=sparc-sun-solaris2.10-ld NM="sparc-sun-solaris2.10-nm -p" \ ./mkpkg --build=i386-pc-solaris2.10 --host=sparc-sun-solaris2.10Where the /opt/SUNWgccfss/5.10-sparc/usr/bin directory contains a version of gcc that generates SPARC code. The resulting Solaris .pkg file is suitable for installation on a SPARC architecture machine.
NOTE: prior to sudo version 1.7.4p1 the configure script was missing cross-build defaults for some of the tests. As such you will need to set autoconf cache values for these tests in the environment. E.g.
sudo_cv_func_fnmatch=no \ sudo_cv_sock_sa_len=no \ sudo_cv_uid_t_len=10 \ sudo_cv_type_long_is_quad=no \ sudo_cv_func_fnmatch=no \ sudo_cv_func_unsetenv_void=no \ ac_cv_func_getgroups_works=yes