Skip to content

Instantly share code, notes, and snippets.

@h-mochizuki
Last active August 27, 2018 09:57
Show Gist options
  • Save h-mochizuki/7977320ea737344b49dacf188ae87a50 to your computer and use it in GitHub Desktop.
Save h-mochizuki/7977320ea737344b49dacf188ae87a50 to your computer and use it in GitHub Desktop.
Shibboleth 3.0.2 をfastcgiでビルドするスクリプト
#!/bin/sh
# =========================================================
# Shibboleth 3.0.2 FastCGI Bugfix script.
# --
# Please use this script untill bug [SSPCPP-834] fixed.
# =========================================================
_SHIBBOLETH_VERSION=3.0.2
mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
(
# Download specific Shibboleth the latest version
cd ~/rpmbuild/SRPMS
yumdownloader --source "shibboleth-$_SHIBBOLETH_VERSION"
# Install the SRPM's dependencies
yum-builddep -y shibboleth*.src.rpm
rpm -ivh shibboleth*.src.rpm
# Fix shibboleth.spec
cd ~/rpmbuild/SPECS
sed -i.org \
-e '/%files.*rpm.file/a%{?_with_fastcgi:%{_libdir}/shibboleth/shibauthorizer}' \
-e '/%files.*rpm.file/a%{?_with_fastcgi:%{_libdir}/shibboleth/shibresponder}' shibboleth.spec
)
# Is there a way of passing --with fastcgi to yum-builddep or getting PreReq
# installed without manual intervention?
#
# There is also an issue where yum-builddep tries to install a 32-bit httpd-devel
# when run against a .src.rpm on CentOS 6. The same issue doesn't happen
# against the .spec file. Conversely, libmemcached-devel has the same issue in
# reverse on CentOS 7 (installs with .src.rpm and doesn't under .spec).
# See https://github.com/nginx-shib/shibboleth-fastcgi/issues/3
sudo yum install -y \
fcgi-devel \
xmltooling-schemas \
opensaml-schemas \
httpd-devel \
libmemcached-devel
# Build with FastCGI support
rpmbuild -ba --clean ~/rpmbuild/SPECS/shibboleth.spec --with fastcgi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment