Skip to content

Instantly share code, notes, and snippets.

@droopy4096
Last active July 1, 2016 16:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save droopy4096/09ab4ff04de4481a28d9546bdab0ed34 to your computer and use it in GitHub Desktop.
Save droopy4096/09ab4ff04de4481a28d9546bdab0ed34 to your computer and use it in GitHub Desktop.
%if 0%{?scl:1}
%scl_package webauth
%global sub_prefix sclo-%{scl_prefix}
%endif
%if 0%{?scl:1}
%define scl_prefix httpd24
%{!?_httpd24_apxs: %{expand: %%global _httpd24_apxs %%{_sbindir}/apxs}}
%{!?_httpd24_mmn: %{expand: %%global _httpd24_mmn %%(cat %{_includedir}/httpd/.mmn 2>/dev/null || echo missing-httpd-devel)}}
%{!?_httpd24_confdir: %{expand: %%global _httpd24_confdir %%{_sysconfdir}/httpd/conf.d}}
# /etc/httpd/conf.d with httpd < 2.4 and defined as /etc/httpd/conf.modules.d with httpd >= 2.4
%{!?_httpd24_modconfdir: %{expand: %%global _httpd24_modconfdir %%{_sysconfdir}/httpd/conf.d}}
%{!?_httpd24_moddir: %{expand: %%global _httpd24_moddir %%{_libdir}/httpd/modules}}
%else
%{!?_httpd_apxs: %{expand: %%global _httpd_apxs %%{_sbindir}/apxs}}
%{!?_httpd_mmn: %{expand: %%global _httpd_mmn %%(cat %{_includedir}/httpd/.mmn 2>/dev/null || echo missing-httpd-devel)}}
%{!?_httpd_confdir: %{expand: %%global _httpd_confdir %%{_sysconfdir}/httpd/conf.d}}
# /etc/httpd/conf.d with httpd < 2.4 and defined as /etc/httpd/conf.modules.d with httpd >= 2.4
%{!?_httpd_modconfdir: %{expand: %%global _httpd_modconfdir %%{_sysconfdir}/httpd/conf.d}}
%{!?_httpd_moddir: %{expand: %%global _httpd_moddir %%{_libdir}/httpd/modules}}
%endif
%if 0%{?rhel} < 7
%define my_rundir /var/run
%else
%define my_rundir %{_rundir}
%endif
%define vers 4.6.1
%define scl_name httpd24
%define _scl_prefix /opt/rh/
%{!?scl:%global pkg_name %{name}}
# This spec is really maintained only for RHEL 5 and 6 at this time.
# Building on Fedora is only an afterthought.
#
# comment the line below if you have CentOS, Fedora Core, or another OS
%define rel %(if [ -f /etc/redhat-release ]; then cat /etc/redhat-release | cut -d' ' -f7 | cut -d'.' -f1; fi)
# uncomment the line below and add a leading "%" to try to gather the
# version of CentOS
#define rel %(if [ -f /etc/redhat-release ]; then cat /etc/redhat-release | cut -d' ' -f3 | cut -d'.' -f1; fi)
# uncomment the line below and add a leading "%" to try to gather the
# version of FC
#define rel %(if [ -f /etc/fedora-release ]; then cat /etc/fedora-release | cut -d' ' -f4; fi)
Summary: Web authentication (webauth) module for the Apache 2.x web servers
#Name: webauth
Name: %{?scl_prefix}webauth
Version: %{vers}
# set the appropriate release if possible
# Change the "EL" portion of the release below if you want.
Release: 1.EL%{rel}
Group: System Environment/Daemons
URL: http://webauth.stanford.edu
Source: http://webauth.stanford.edu/dist/webauth-%{vers}.tar.xz
Patch0: webauth.load.i386.diff
Patch1: webauth.load.x86_64.diff
#Patch2: rhel5.diff
License: MIT
#BuildRoot: /var/tmp/%{name}-buildroot
Vendor: Stanford University
Distribution: EL
BuildRequires: openssl-devel >= 0.9.7, e2fsprogs-devel, krb5-devel, curl-devel
%if 0%{?scl:1}
BuildRequires: httpd24-httpd-devel >= 2.0.40-11
Requires: httpd24
Requires: httpd24-mod_ssl
%else
BuildRequires: httpd-devel
Requires: httpd
Requires: mod_ssl
%endif
Requires: cyrus-sasl-gssapi
Requires: curl
BuildRequires: libtool
BuildRequires: openldap-devel
BuildRequires: glibc-common
# %{?scl:Requires: %scl_runtime}
%ifarch i386
BuildArch: i686
%endif
%description
WebAuth is an authentication system for web pages and web applications. The
first time a user attempts to access a web page protected by WebAuth, they will
be sent to a central login server (weblogin.stanford.edu at Stanford) and
prompted to authenticate. Normally, they will be asked for a username and
password, although other authentication methods are possible. Once the user has
logged in, the weblogin server will send their encrypted identity back to the
original web page they were trying to access. Their identity will also be
stored in a cookie set by the weblogin server and they will not need to
authenticate again until their credentials expire, even if they visit multiple
protected web sites.
%prep
%setup -q -n %{pkg_name}-%{version}
#%patch2 -p1
# patch for either x86_64 or i386
%ifarch x86_64
%patch1
%else
%patch0
%endif
%build
# ./configure --with-openssl=/usr --with-curl=/usr --with-apxs=/usr/sbin/apxs --with-ldap=/usr --with-krb5=/usr --without-remctl
MY_PATH=$(pwd)
echo "%configure --prefix=/usr --with-openssl=/usr --with-curl=/usr --with-apxs=/opt/rh/httpd24/root/usr/bin/apxs --with-ldap=/usr --with-krb5=/usr --without-remctl" | scl enable httpd24 -
##foobarred ./configure --with-openssl=/usr --with-curl=/usr --with-apxs=/opt/rh/httpd24/root/usr/bin/apxs --with-ldap=/usr --with-krb5=/usr --without-remctl
make
%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
#ifarch x86_64
#define _libdir /usr/lib64
#endif
make install DESTDIR=${RPM_BUILD_ROOT}/opt/rh/httpd24/root
###DISABLE mkdir -p $RPM_BUILD_ROOT%{_libdir}/httpd/modules
###DISABLE install -m 755 lib/.libs/libwebauth.so.11.0.0 $RPM_BUILD_ROOT%{_libdir}
###DISABLE
###DISABLE install -m 755 modules/ldap/.libs/mod_webauthldap.so $RPM_BUILD_ROOT%{_libdir}/httpd/modules
###DISABLE install -m 755 modules/webauth/.libs/mod_webauth.so $RPM_BUILD_ROOT%{_libdir}/httpd/modules
###DISABLE
###DISABLE ln -sf libwebauth.so.11.0.0 $RPM_BUILD_ROOT%{_libdir}/libwebauth.so
###DISABLE ln -sf libwebauth.so.11.0.0 $RPM_BUILD_ROOT%{_libdir}/libwebauth.so.11
###DISABLE
###DISABLE mkdir -p $RPM_BUILD_ROOT%{_bindir} $RPM_BUILD_ROOT%{_datadir}/man/man1/
###DISABLE install -m 755 tools/.libs/wa_keyring $RPM_BUILD_ROOT%{_bindir}
###DISABLE install -m 644 tools/wa_keyring.1 $RPM_BUILD_ROOT%{_datadir}/man/man1/wa_keyring.1
###DISABLE gzip $RPM_BUILD_ROOT%{_datadir}/man/man1/wa_keyring.1
###DISABLE
###DISABLE
###DISABLE mkdir -p $RPM_BUILD_ROOT/$RPM_DOC_DIR/webauth-%{vers}
###DISABLE install -m 644 INSTALL $RPM_BUILD_ROOT/$RPM_DOC_DIR/webauth-%{vers}
###DISABLE install -m 644 README $RPM_BUILD_ROOT/$RPM_DOC_DIR/webauth-%{vers}/README
###DISABLE install -m 644 NEWS $RPM_BUILD_ROOT/$RPM_DOC_DIR/webauth-%{vers}
###DISABLE cp -rp conf $RPM_BUILD_ROOT/$RPM_DOC_DIR/webauth-%{vers}
###DISABLE # convert to UTF-8
###DISABLE # cp -rp docs $RPM_BUILD_ROOT/$RPM_DOC_DIR/webauth-%{vers}
###DISABLE for i in `ls docs | grep -v diagram| grep -v scripts`; do
###DISABLE iconv -f ISO-8859-1 -t UTF-8 docs/$i > $RPM_BUILD_ROOT/$RPM_DOC_DIR/webauth-%{vers}/$i
###DISABLE done
%__mkdir_p %{buildroot}%{_httpd24_confdir}
# mkdir -p $RPM_BUILD_ROOT/etc/httpd/conf.d
%__cp -rp conf/debian/webauth.conf $RPM_BUILD_ROOT%{_httpd24_confdir}
%__cp -rp conf/debian/webauth.load $RPM_BUILD_ROOT%{_httpd24_confdir}/webauth-load.conf
%__cp -rp conf/debian/webauthldap.conf $RPM_BUILD_ROOT%{_httpd24_confdir}
%__cp -rp conf/debian/webauthldap.load $RPM_BUILD_ROOT%{_httpd24_confdir}/webauthldap-load.conf
# %__mkdir_p $RPM_BUILD_ROOT%{_sysconfdir}/webauth/
# %__mkdir_p $RPM_BUILD_ROOT%{_localstatedir}/lib/webauth/
%clean
# [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
/opt
###DISABLE %{_libdir}/httpd/modules/*
###DISABLE %{_libdir}/libweb*
###DISABLE %{_bindir}/wa_keyring
###DISABLE %config(noreplace) %{_sysconfdir}/httpd/conf.d/*
###DISABLE %doc %{_docdir}/webauth-%{vers}
###DISABLE %doc %{_datadir}/man/man1/wa_keyring.1*
###DISABLE %dir %{_sysconfdir}/webauth
###DISABLE %defattr(-,root,apache,0770)
###DISABLE %dir %{_localstatedir}/lib/webauth/
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%changelog
* Wed Jul 25 2012 Darren Patterson <darrenp1@stanford.edu> 4.2.2-1
- updated to 4.2.2
* Thu Mar 29 2012 Darren Patterson <darrenp1@stanford.edu> 4.1.0-2
- adjust configure: --without-remctl
* Wed Mar 28 2012 Darren Patterson <darrenp1@stanford.edu> 4.1.0-1
- updated to 4.1.0, remove unneeded req remctl-client/devel
* Fri Dec 2 2011 Darren Patterson <darrenp1@stanford.edu> 4.0.2-1
- updated to 4.0.2
* Tue Oct 11 2011 Darren Patterson <darrenp1@stanford.edu> 4.0.1-1
- updated to 4.0.1
* Fri Sep 23 2011 Darren Patterson <darrenp1@stanford.edu> 3.7.4-1
- updated to 3.7.4
* Fri Aug 13 2010 Darren Patterson <darrenp1@stanford.edu> 3.7.3-1
- updated to 3.7.3
* Fri Aug 13 2010 Darren Patterson <darrenp1@stanford.edu> 3.7.2-1
- updated to 3.7.2
* Fri Jul 23 2010 Darren Patterosn <darrenp1@stanford.edu> 3.7.1-1
- updated to 3.7.1
* Thu Nov 11 2009 Darren Patterson <darrenp1@stanford.edu> 3.6.1-3
- removed httpd condrestart.
* Mon Nov 9 2009 Darren Patterson <darrenp1@stanford.edu> 3.6.1-2
- include real wa_keyring.
- rpmlint cleanup.
- removed RHEL3 support (hack to use ancient krb5-SU).
* Thu Jul 16 2009 Darren Patterson <darrenp1@stanford.edu> 3.6.1-1
- built 3.6.1
* Fri Jun 13 2008 Darren Patterson <darrenp1@stanford.edu> 3.6.0-2
- rebuild without krb5-SU
* Wed Apr 2 2008 Darren Patterson <darrenp1@stanford.edu> 3.6.0-1
- updated to 3.6.0.
* Mon May 7 2007 Darren Patterson <darrenp1@stanford.edu> 3.5.4-1
- update to 3.5.4
* Wed Apr 4 2007 Darren Patterson <darrenp1@stanford.edu> 3.5.3-2
- Substantial changes to use configuration as similar to deb as possible.
- Stanford users will now need the stanford-server RPM.
* Thu Oct 5 2006 Darren Patterson <darrenp1@stanford.edu> 3.5.3-1
- updated for 3.5.3
* Tue Sep 12 2006 Digant C Kasundra <digant@stanford.edu> 3.5.1-4
- Moved stanford-webauth.conf back into the httpd conf.d dir to match the behavior of the debian package
* Thu Jun 28 2006 Darren Patterson <darrenp1@stanford.edu> 3.5.1-3
- Changed rhel3 requirements to include openldap
* Thu Jun 12 2006 Darren Patterson <darrenp1@stanford.edu> 3.5.1-2
- Made an attempt to support fedora core and added comments for users who may want to try and change/update the spec later to fix FC/CentOS(/other OS?) build issues.
- Moved stanford-webauth.conf to doc dir instead of httpd conf.d dir.
* Wed Jun 11 2006 Darren Patterson <darrenp1@stanford.edu> 3.5.1-1
- updated release for 64-bit fixes
* Wed May 31 2006 Darren Patterson <darrenp1@stanford.edu> 3.5.0-2
- removed configure option that made rhel3 balk
* Tue May 30 2006 Darren Patterson <darrenp1@stanford.edu>
- added rel option for different rhel releases
* Mon May 22 2006 Darren Patterson <darrenp1@stanford.edu>
- changed httpd restart to "condrestart"
* Fri May 19 2006 Darren Patterson <darrenp1@stanford.edu> 3.5.0
- updated to latest release
- removed module *.la and *.a files because they are extraneous.
- changed README to install as README instead of LICENSE
* Thu Apr 14 2005 Joe Little <jlittle@stanford.edu> 3.2.4-2
- fixed inclusion of default configs
* Thu Mar 10 2005 Joe Little <jlittle@stanford.edu> 3.2.4-1
- fixed webauthldap/webauth mod builds
- fixed library versioning of symlinks
- still lacks webkdc build
* Tue Apr 1 2003 Joe Little <jlittle@stanford.edu> 3.0.0-1
- first build
- enable-perl is not used; no perl bindings packaged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment