Recompile Dovecot with Vpopmail on Debian

Here's a script I use to quickly recompile dovecot with vpopmail support on Debian 6.0. I'm using the backports repository to get the 2.1 version of dovecot.

Now I'm using the following script every time I update and I get a new version of the dovecot packages.

  1. #!/bin/bash
  2.  
  3. BDIR=./dovecot.$(date +%Y-%m-%d_%H-%M-%S)
  4.  
  5. mkdir $BDIR
  6. cd $BDIR
  7.  
  8. sudo apt-get source dovecot-core
  9. sudo apt-get build-dep dovecot-core
  10. dpkg-source -x *.dsc
  11.  
  12. cd $(find ./ -type d |grep dovecot|head -1)
  13.  
  14. sed -r -e 's/with-sqlite \\/with-sqlite \\\n\t\t--with-vpopmail \\/' debian/rules > debian/rules.mod
  15. cat debian/rules.mod > debian/rules
  16.  
  17. DEB_BUILD_OPTIONS="--with-vpopmail" fakeroot debian/rules binary
  18.  
  19. find $BDIR -type f -name "*.deb"|grep -v 'dbg' |xargs dpkg -i
  20.  
  21.  

The last line also installs all the dovecot packages except for the debug one. You might want to change it if you don't want all.

Leave a Reply