Ubuntu: Debian Package Creation- how to define environment variables within the package


I built a package with the sudo-ldap package defined as a dependency in the control file (please see below). I'm going to have people install using the gdebi command to install which should install the package and any required dependencies. Unfortunately, this will require the export SUDO_FORCE_REMOVE=yes variables to be set or the sudo-ldap package will not be installed and will error out the entire package install. How do I define an environment variable for the whole package creation. My ultimate goal is to have a user install this package without having to manually define environment variables...I know I can call this package with a script, but I'd rather not do that.

  Depends: ${misc:Depends} ldap-utils,sudo-ldap  

Thanks so much in advance.


Best I can suggest is two debs. The first one lobotomises sudo's prerm script. The second one depends on sudo-ldap. This approach wouldn't work with APT (installing both in one run) because there's no guarantee that the lobotomisation package would be installed first. However, if driven through gdebi, it should work.

Do you actually need sudo-ldap? Normal sudo works with LDAP, it just doesn't get the sudoers configuration from LDAP...

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »