File strongswan-spec.diff of Package strongswan

--- strongswan-5.1.3-oSF.spec	2014-09-15 15:27:37.680878168 +0100
+++ strongswan.spec	2014-09-18 16:31:54.185538726 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           strongswan
-Version:        5.1.3
+Version:        5.2.0
 Release:        0
 %define         upstream_version     %{version}
 %define         strongswan_docdir    %{_docdir}/%{name}
@@ -64,6 +64,7 @@ Source5:        %{name}.keyring
 Patch1:         %{name}_modprobe_syslog.patch
 Patch2:         %{name}_ipsec_service.patch
 Patch3:         %{name}-fips-disablegcrypt.patch
+Patch4:		%{name}_configure.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildRequires:  bison
 BuildRequires:  curl-devel
@@ -95,7 +96,9 @@ BuildRequires:  pkgconfig(systemd)
 %endif
 BuildRequires:  iptables
 %{!?_rundir: %global _rundir /run}
+%if %{with systemd}
 %{!?_tmpfilesdir: %global _tmpfilesdir /usr/lib/tmpfiles.d}
+%endif
 
 %description
 StrongSwan is an OpenSource IPsec-based VPN Solution for Linux
@@ -135,7 +138,7 @@ Authors:
     and others
 
 %package doc
-BuildArch:      noarch
+#BuildArch:      noarch
 Summary:        OpenSource IPsec-based VPN Solution
 Group:          Productivity/Networking/Security
 
@@ -245,34 +248,40 @@ and the load testing plugin for IKEv2 da
 %patch1 -p0
 %patch2 -p0
 %patch3 -p1
+%patch4 -p0
 sed -e 's|@libexecdir@|%_libexecdir|g'    \
      < $RPM_SOURCE_DIR/strongswan.init.in \
      > strongswan.init
 
 %build
-CFLAGS="$RPM_OPT_FLAGS -W -Wall -Wno-pointer-sign -Wno-strict-aliasing -Wno-unused-parameter"
+CFLAGS="$RPM_OPT_FLAGS -W -Wall -Wno-pointer-sign -Wno-strict-aliasing -Wno-unused-parameter -I$RPM_SOURCE_DIR/%{name}-%{version}/src/include -I/usr/include"
 export RPM_OPT_FLAGS CFLAGS
 #libtoolize --force
 #autoreconf
 %configure \
+%if ! 0%{?sles_version}
 	--enable-conftest \
+%endif
 	--enable-integrity-test \
 	--with-capabilities=libcap \
 	--with-plugindir=%{strongswan_plugins} \
-	--with-fips=2 \
+%if ! 0%{?sles_version}
+	--with-fips-mode=2 \
+%endif
 	--with-resolv-conf=%{_rundir}/%{name}/resolv.conf \
 	--with-piddir=%{_rundir}/%{name} \
 	--enable-pkcs11 \
 	--enable-openssl \
 	--enable-agent \
-	--enable-gcrypt \
 	--enable-blowfish \
 	--enable-ctr \
 	--enable-ccm \
 	--enable-gcm \
 	--enable-unity \
 	--enable-md4 \
+%if ! 0%{?sles_version}
 	--enable-af-alg \
+%endif
 	--enable-eap-sim \
 	--enable-eap-sim-file \
 	--enable-eap-sim-pcsc \
@@ -305,7 +314,9 @@ export RPM_OPT_FLAGS CFLAGS
 	--enable-imv-scanner \
 	--enable-ha \
 	--enable-dhcp \
+%if ! 0%{?sles_version}
 	--enable-farp \
+%endif
 	--enable-smp \
 	--enable-sql \
 	--enable-attr-sql \
@@ -373,22 +384,35 @@ install -c -m644 TODO NEWS README COPYIN
 install -c -m644 ${RPM_SOURCE_DIR}/README.SUSE \
 		 ${RPM_BUILD_ROOT}%{strongswan_docdir}/
 
+%if %{with systemd}
 %{__install} -d -m 0755 %{buildroot}%{_tmpfilesdir}
 echo 'd %{_rundir}/%{name} 0770 root root' > %{buildroot}%{_tmpfilesdir}/%{name}.conf
+%endif
+
+%if ! %{with mysql}
+rm -f $RPM_BUILD_ROOT%{strongswan_templates}/database/sql/mysql.sql
+%endif
+
+%if ! %{with sqlite}
+rm -f $RPM_BUILD_ROOT%{strongswan_templates}/database/sql/sqlite.sql
+%endif
 
 %post libs0 -p /sbin/ldconfig
 
 %postun libs0 -p /sbin/ldconfig
 
 %pre ipsec
+%if %{with systemd}
 %service_add_pre %{name}.service
+%endif
 
 %post ipsec
 %if ! %{with systemd}
 %{fillup_and_insserv ipsec}
-%endif
+%else
 %{?tmpfiles_create: %tmpfiles_create %{_tmpfilesdir}/%{name}.conf }
 %service_add_post %{name}.service
+%endif
 
 %preun ipsec
 %if ! %{with systemd}
@@ -402,14 +426,16 @@ if test -s %{_sysconfdir}/ipsec.conf.rpm
 	cp -p --backup=numbered %{_sysconfdir}/ipsec.conf.rpmsave \
 	                        %{_sysconfdir}/ipsec.conf.rpmsave.old
 fi
+%if %{with systemd}
 %service_del_preun %{name}.service
+%endif
 
 %postun ipsec
 %if ! %{with systemd}
 %{insserv_cleanup}
-%endif
-
+%else
 %service_del_postun %{name}.service
+%endif
 
 %files
 %defattr(-,root,root)
@@ -446,7 +472,9 @@ fi
 %{_libexecdir}/ipsec/_copyright
 %{_libexecdir}/ipsec/_updown
 %{_libexecdir}/ipsec/_updown_espmark
+%if ! 0%{?sles_version}
 %{_libexecdir}/ipsec/conftest
+%endif
 %{_libexecdir}/ipsec/duplicheck
 %{_libexecdir}/ipsec/pool
 %{_libexecdir}/ipsec/pt-tls-client
@@ -459,7 +487,9 @@ fi
 %dir %{strongswan_plugins}
 %{strongswan_plugins}/libstrongswan-stroke.so
 %{strongswan_plugins}/libstrongswan-updown.so
+%if %{with systemd}
 %{_tmpfilesdir}/%{name}.conf
+%endif
 
 %files doc
 %defattr(-,root,root)
@@ -486,10 +516,14 @@ fi
 %config(noreplace) %attr(600,root,root) %{strongswan_configs}/pool.conf
 %config(noreplace) %attr(600,root,root) %{strongswan_configs}/starter.conf
 %config(noreplace) %attr(600,root,root) %{strongswan_configs}/tnc.conf
-%config(noreplace) %attr(600,root,root) %{strongswan_configs}/tools.conf
+%config(noreplace) %attr(600,root,root) %{strongswan_configs}/pki.conf
+%config(noreplace) %attr(600,root,root) %{strongswan_configs}/scepclient.conf
+#%config(noreplace) %attr(600,root,root) %{strongswan_configs}/tools.conf
 %config(noreplace) %attr(600,root,root) %{strongswan_configs}/charon/addrblock.conf
 %config(noreplace) %attr(600,root,root) %{strongswan_configs}/charon/aes.conf
+%if ! 0%{?sles_version}
 %config(noreplace) %attr(600,root,root) %{strongswan_configs}/charon/af-alg.conf
+%endif
 %config(noreplace) %attr(600,root,root) %{strongswan_configs}/charon/agent.conf
 %config(noreplace) %attr(600,root,root) %{strongswan_configs}/charon/attr.conf
 %config(noreplace) %attr(600,root,root) %{strongswan_configs}/charon/attr-sql.conf
@@ -523,10 +557,14 @@ fi
 %config(noreplace) %attr(600,root,root) %{strongswan_configs}/charon/eap-tls.conf
 %config(noreplace) %attr(600,root,root) %{strongswan_configs}/charon/eap-tnc.conf
 %config(noreplace) %attr(600,root,root) %{strongswan_configs}/charon/eap-ttls.conf
+%if ! 0%{?sles_version}
 %config(noreplace) %attr(600,root,root) %{strongswan_configs}/charon/farp.conf
+%endif
 %config(noreplace) %attr(600,root,root) %{strongswan_configs}/charon/fips-prf.conf
 %config(noreplace) %attr(600,root,root) %{strongswan_configs}/charon/gcm.conf
+%if %{with gcrypt}
 %config(noreplace) %attr(600,root,root) %{strongswan_configs}/charon/gcrypt.conf
+%endif
 %config(noreplace) %attr(600,root,root) %{strongswan_configs}/charon/gmp.conf
 %config(noreplace) %attr(600,root,root) %{strongswan_configs}/charon/ha.conf
 %config(noreplace) %attr(600,root,root) %{strongswan_configs}/charon/hmac.conf
@@ -591,7 +629,9 @@ fi
 %dir %{strongswan_plugins}
 %{strongswan_plugins}/libstrongswan-addrblock.so
 %{strongswan_plugins}/libstrongswan-aes.so
+%if ! 0%{?sles_version}
 %{strongswan_plugins}/libstrongswan-af-alg.so
+%endif
 %{strongswan_plugins}/libstrongswan-agent.so
 %{strongswan_plugins}/libstrongswan-attr.so
 %{strongswan_plugins}/libstrongswan-attr-sql.so
@@ -625,7 +665,9 @@ fi
 %{strongswan_plugins}/libstrongswan-eap-tls.so
 %{strongswan_plugins}/libstrongswan-eap-tnc.so
 %{strongswan_plugins}/libstrongswan-eap-ttls.so
+%if ! 0%{?sles_version}
 %{strongswan_plugins}/libstrongswan-farp.so
+%endif
 %{strongswan_plugins}/libstrongswan-fips-prf.so
 %{strongswan_plugins}/libstrongswan-gcm.so
 %if %{with gcrypt}
@@ -685,7 +727,9 @@ fi
 %{strongswan_templates}/config/strongswan.conf
 %{strongswan_templates}/config/plugins/addrblock.conf
 %{strongswan_templates}/config/plugins/aes.conf
+%if ! 0%{?sles_version}
 %{strongswan_templates}/config/plugins/af-alg.conf
+%endif
 %{strongswan_templates}/config/plugins/agent.conf
 %{strongswan_templates}/config/plugins/attr-sql.conf
 %{strongswan_templates}/config/plugins/attr.conf
@@ -719,10 +763,14 @@ fi
 %{strongswan_templates}/config/plugins/eap-tls.conf
 %{strongswan_templates}/config/plugins/eap-tnc.conf
 %{strongswan_templates}/config/plugins/eap-ttls.conf
+%if ! 0%{?sles_version}
 %{strongswan_templates}/config/plugins/farp.conf
+%endif
 %{strongswan_templates}/config/plugins/fips-prf.conf
 %{strongswan_templates}/config/plugins/gcm.conf
+%if %{with gcrypt}
 %{strongswan_templates}/config/plugins/gcrypt.conf
+%endif
 %{strongswan_templates}/config/plugins/gmp.conf
 %{strongswan_templates}/config/plugins/ha.conf
 %{strongswan_templates}/config/plugins/hmac.conf
@@ -774,9 +822,12 @@ fi
 %{strongswan_templates}/config/strongswan.d/pool.conf
 %{strongswan_templates}/config/strongswan.d/starter.conf
 %{strongswan_templates}/config/strongswan.d/tnc.conf
-%{strongswan_templates}/config/strongswan.d/tools.conf
+%{strongswan_templates}/config/strongswan.d/pki.conf
+%{strongswan_templates}/config/strongswan.d/scepclient.conf
+#%{strongswan_templates}/config/strongswan.d/tools.conf
 %{strongswan_templates}/database/imv/data.sql
 %{strongswan_templates}/database/imv/tables.sql
+%{strongswan_templates}/database/imv/tables-mysql.sql
 
 %if %{with nm}
openSUSE Build Service is sponsored by