Skip to content

Instantly share code, notes, and snippets.

@SteelPangolin
Created June 14, 2014 17:37
Show Gist options
  • Save SteelPangolin/6fa9ac5ee9b34ceb0a08 to your computer and use it in GitHub Desktop.
Save SteelPangolin/6fa9ac5ee9b34ceb0a08 to your computer and use it in GitHub Desktop.
How to package your own mod_auth_openid 0.9 for Ubuntu
#!/bin/bash
# Ubuntu version of package: http://packages.ubuntu.com/trusty/libapache2-mod-auth-openid
# FPM man page: https://github.com/jordansissel/fpm/wiki
# FPM instructions for autotools: https://github.com/jordansissel/fpm/wiki/PackageMakeInstall
# 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 \
ruby-dev
# 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 https://github.com/SteelPangolin/mod_auth_openid.git
cd mod_auth_openid
# creates configure script, then runs it
./autogen.sh
# actually compile things
make
# 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/mod_auth_openid.so 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/mod_auth_openid.so" \
> pkgtmp/etc/apache2/mods-available/authopenid.load
# set permissions for package contents
chmod -x pkgtmp/usr/lib/apache2/modules/mod_auth_openid.so
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