Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
How to package your own mod_auth_openid 0.9 for Ubuntu
# Ubuntu version of package:
# FPM man page:
# FPM instructions for autotools:
# install build-time dependencies
# yes, apache2 is a build-time dependency, otherwise APXS breaks:
# "checking Apache version... configure: error: /usr/bin/apxs2 says that your apache binary lives at /usr/sbin/apache2 but that file isn't executable."
sudo aptitude -y install \
git \
apache2 \
apache2-dev \
libopkele-dev \
libcppunit-dev \
autoconf \
libtool \
ruby \
# install the FPM packaging utility
sudo gem install fpm
# check out my version of mod_auth_openid
# should default to the mysql-sessions branch
git clone
cd mod_auth_openid
# creates configure script, then runs it
# actually compile things
# directory for package contents to go in
mkdir pkgtmp
# APXS ignores $DESTDIR, so we can't use make install DESTDIR=... for this package
# instead, copy files manually:
# copy Apache module
mkdir -p pkgtmp/usr/lib/apache2/modules
cp src/.libs/ pkgtmp/usr/lib/apache2/modules/
# copy table maintenance tool
mkdir -p pkgtmp/usr/bin
cp src/modauthopenid_tables pkgtmp/usr/bin/
# create Apache config for module loading
mkdir -p pkgtmp/etc/apache2/mods-available
echo "LoadModule authopenid_module /usr/lib/apache2/modules/" \
> pkgtmp/etc/apache2/mods-available/authopenid.load
# set permissions for package contents
chmod -x pkgtmp/usr/lib/apache2/modules/
chmod -R u=rwX,go=rX pkgtmp
# create package with FPM
fpm \
-s dir \
-C pkgtmp \
-t deb \
--name libapache2-mod-auth-openid \
--version 0.9.0 \
--architecture native \
--depends libc6 \
--depends libgcc1 \
--depends libstdc++6 \
--depends libapr1 \
--depends libaprutil1 \
--depends libopkele3 \
--depends libcurl3-gnutls \
--depends libpcre3 \
etc usr
# package should now exist as libapache2-mod-auth-openid_0.9.0_amd64.deb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.