/ eurephia.spec
eurephia.spec
  1  Name:           eurephia
  2  Version:        1.0.1
  3  Release:        2%{?betatag:.%{betatag}}%{?dist}
  4  Summary:        An advanced and flexible OpenVPN user authentication plug-in
  5  
  6  Group:          Applications/Internet
  7  License:        GPLv2
  8  URL:            http://www.eurephia.net/
  9  Source0:        http://downloads.sourceforge.net/project/eurephia/eurephia/v1.0/%{name}-%{version}%{?betatag:_%{betatag}}.tar.bz2
 10  Source1:        http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn/openvpn-plugin.h
 11  BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}{?betatag:_%{betatag}}-root-%(%{__id_u} -n)
 12  
 13  BuildRequires:  libxml2-devel libxslt-devel openssl-devel
 14  BuildRequires:  cmake >= 2.6.1
 15  BuildRequires:  sqlite-devel >= 3.0.0
 16  Requires:       openvpn
 17  Requires:       eurephia-sqlite3 = %{version}-%{release}
 18  Obsoletes:      eurephia-iptables < 1.0.1-2
 19  Provides:       eurephia-iptables >= 1.0.1-2
 20  
 21  %description
 22  This plug-in enhances OpenVPN by adding user name and password
 23  authentication in addition. An eurephia user account is a combination of
 24  minimum one OpenVPN SSL certificate and a user name with a password
 25  assigned. It is also possible to setup several eurephia user names to use
 26  a shared OpenVPN certificate.
 27  
 28  In addition, eurephia will blacklist IP addresses, certificates and user names
 29  on too many failed attempts and it supports dynamic update of iptables rules
 30  which restricts network access per connection.
 31  
 32  %package sqlite3
 33  Group:   Applications/Internet
 34  Summary: The eurephia SQLite3 database driver
 35  
 36  %description sqlite3
 37  This package contains the SQLite3 database driver for eurephia
 38  
 39  %package admin
 40  Group:   Applications/Internet
 41  Summary: The eurephia command line administration utility
 42  Requires: eurephia-sqlite3 = %{version}-%{release}
 43  
 44  %description admin
 45  This package contains the command line utility to administer and configure
 46  eurephia
 47  
 48  %package init
 49  Group:   Applications/Internet
 50  Summary: Utility for initializing a new eurephia database
 51  Requires: eurephia-sqlite3 = %{version}-%{release}
 52  
 53  %description init
 54  This package provides a program which will initialize the eurephia
 55  database for you.  It will guide you through several questions and
 56  save the configuration in the database.  When you have configured
 57  and initialized eurephia, this package should be removed from the
 58  system.
 59  
 60  %package utils
 61  Group:   Applications/Internet
 62  Summary: Misc. eurephia utilities
 63  
 64  %description utils
 65  This package contains useful utilities when debugging eurephia.
 66  At the moment you will only find eurephia_saltdecode in this
 67  package, which will provide some information about the password
 68  hash salt.
 69  
 70  
 71  %prep 
 72  %setup -q -n %{name}-%{version}%{?betatag:_%{betatag}}
 73  
 74  # This is needed to ship extra until openvpn-plugin.h becomes part of the OpenVPN RPM
 75  cp -v %{SOURCE1} .
 76  
 77  %build
 78  # The configure script is not an autotools script, but a cmake wrapper script.
 79  CFLAGS="%{optflags}" ./configure --prefix %{_prefix} --bin-dir %{_bindir} --xslt-path %{_datadir}/eurephia/xslt --plug-in-dir %{_libdir}/eurephia --plug-in --openvpn-src . --fw-iptables --db-sqlite3 --sqlite3-path %{_localstatedir}/lib/eurephia --eurephiadm
 80  
 81  # We don't do parallel building, as that might fail.
 82  make VERBOSE=1
 83  
 84  %install
 85  rm -rf %{buildroot}
 86  make install DESTDIR=%{buildroot}
 87  
 88  # Move the eurephia-auth.so file to the default OpenVPN plug-in directory
 89  mkdir -p -m 755 %{buildroot}/%{_libdir}/openvpn
 90  mv %{buildroot}/%{_libdir}/eurephia/eurephia-auth.so %{buildroot}/%{_libdir}/openvpn/
 91  
 92  # These files are not installed by default, but we want to package them for Fedora/RHEL
 93  install -p -m 755 utils/eurephia_init %{buildroot}/%{_bindir}
 94  install -p -m 755 utils/eurephia_saltdecode %{buildroot}/%{_bindir}
 95  install -p -m 644 utils/eurephia_init.7 %{buildroot}/%{_mandir}/man7/
 96  install -p -m 644 utils/eurephia_saltdecode.7 %{buildroot}/%{_mandir}/man7/
 97  
 98  %clean
 99  rm -rf %{buildroot}
100  
101  
102  %files
103  %defattr(-,root,root,-)
104  %doc LICENSE.txt CREDITS.txt
105  %{_libdir}/openvpn/eurephia-auth.so
106  %{_mandir}/man7/eurephia-auth.7.gz
107  %{_mandir}/man7/eurephia-variables.7.gz
108  %{_libdir}/eurephia/efw-iptables.so
109  
110  %files sqlite3
111  %defattr(-,root,root,-)
112  %doc LICENSE.txt CREDITS.txt
113  %dir %{_libdir}/eurephia/
114  %{_libdir}/eurephia/edb-sqlite.so
115  %{_localstatedir}/lib/eurephia/
116  %{_mandir}/man7/edb-sqlite.7.gz
117  
118  %files init
119  %defattr(-,root,root,-)
120  %doc LICENSE.txt CREDITS.txt
121  %{_bindir}/eurephia_init
122  %{_mandir}/man7/eurephia_init.7.gz
123  
124  %files admin
125  %defattr(-,root,root,-)
126  %doc LICENSE.txt CREDITS.txt
127  %{_bindir}/eurephiadm
128  %dir %{_datadir}/eurephia/
129  %dir %{_datadir}/eurephia/xslt
130  %{_datadir}/eurephia/xslt/eurephiadm
131  %{_mandir}/man7/eurephiadm.7.gz
132  %{_mandir}/man7/eurephiadm-*.7.gz
133  
134  %files utils
135  %defattr(-,root,root,-)
136  %doc LICENSE.txt CREDITS.txt
137  %{_bindir}/eurephia_saltdecode
138  %{_mandir}/man7/eurephia_saltdecode.7.gz
139  
140  %changelog
141  * Wed Oct 20 2010 David Sommerseth <dazo@users.sourceforge.net> - 1.0.1-2
142  - Obsolete the eurephia-iptables RPM and move efw-iptables into eurephia.rpm
143  
144  * Thu Jul 15 2010 David Sommerseth <davids@redhat.com> - 1.0.0-8
145  - Fixed silly mistakes
146    - Forgot to move over /usr/lib/eurephia from eurephia to eurephia-sqlite3
147    - Double '=' in eurephia-init
148  
149  * Thu Jul 15 2010 David Sommerseth <davids@redhat.com> - 1.0.0-7
150  - More review fixes
151    - Relocated ownership of directories
152    - Don't hard-code version number in intra-package deps
153    - Use proper fully qualified version number (including revision)
154  
155  * Thu Jul 15 2010 David Sommerseth <davids@redhat.com> - 1.0.0-6
156  - Fixed file duplication between eurephia and eurephia-admin
157  
158  * Thu Jul 15 2010 David Sommerseth <davids@redhat.com> - 1.0.0-5
159  - More review comments from mattias.ellert@fysast.uu.se
160    - Own /usr/lib{,64}/eurephia, /usr/share/eurephia/ and /usr/share/eurephia/xslt
161    - Intra-packages use fully qualified versions
162  
163  * Thu Jul 15 2010 David Sommerseth <davids@redhat.com> - 1.0.0-4
164  - Review comments from mattias.ellert@fysast.uu.se
165    - Better way to copy source1
166    - Removed -b0 from setup macro
167  
168  * Thu Jul  8 2010 David Sommerseth <davids@redhat.com> - 1.0.0-3
169  - Added missing Group tags
170  - Added stricter cmake version requirement
171  
172  * Thu Jul  8 2010 David Sommerseth <davids@redhat.com> - 1.0.0-2
173  - Added missing build dependency for openssl-devel
174  
175  * Wed Jun 30 2010 David Sommerseth <dazo@users.sourceforge.net> - 1.0.0-1
176  - Updated and prepared for the eurephia-1.0.0 release
177  
178  * Wed Nov 18 2009 David Sommerseth <dazo@users.sourceforge.net> - 0.9.6-1.beta
179  - Updated for eurephia-0.9.6_beta and using openvpn-2.1_rc21 source tree
180  
181  * Tue Oct  6 2009 David Sommerseth <dazo@users.sourceforge.net> - 0.9.5-1.beta
182  - Initial eurephia spec file
183