diff --git a/strongswan.changes b/strongswan.changes index 1a825fd..0e04f4e 100644 --- a/strongswan.changes +++ b/strongswan.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Fri Jun 20 17:38:07 UTC 2014 - crrodriguez@opensuse.org + +- Fix build in factory +* Do not include var/run directories in package +* Move runtime data to /run and provide tmpfiles.d snippet +* Add proper systemd macros to rpm scriptlets. +* Do not buildRequire library package libnl1, it is not used. + ------------------------------------------------------------------- Mon Apr 14 23:36:07 UTC 2014 - mt@suse.de diff --git a/strongswan.spec b/strongswan.spec index 50c6f26..8a0d5ad 100644 --- a/strongswan.spec +++ b/strongswan.spec @@ -90,10 +90,11 @@ BuildRequires: libgcrypt-devel BuildRequires: NetworkManager-devel %endif %if %{with systemd} -BuildRequires: systemd-devel +BuildRequires: pkgconfig(systemd) %endif BuildRequires: iptables -BuildRequires: libnl >= 1.1 +%{!?_rundir: %global _rundir /run} +%{!?_tmpfilesdir: %global _tmpfilesdir /usr/lib/tmpfiles.d} %description StrongSwan is an OpenSource IPsec-based VPN Solution for Linux @@ -256,7 +257,8 @@ export RPM_OPT_FLAGS CFLAGS --enable-integrity-test \ --with-capabilities=libcap \ --with-plugindir=%{strongswan_plugins} \ - --with-resolv-conf=%{_localstatedir}/run/strongswan/resolv.conf \ + --with-resolv-conf=%{_rundir}/%{name}/resolv.conf \ + --with-piddir=%{_rundir}/%{name} \ --enable-pkcs11 \ --enable-openssl \ --enable-agent \ @@ -331,7 +333,8 @@ export RPM_OPT_FLAGS CFLAGS %endif --enable-ldap \ --enable-soup \ - --enable-curl + --enable-curl \ + --disable-static make %{?_smp_mflags:%_smp_mflags} %install @@ -358,8 +361,7 @@ EOT # rm -f $RPM_BUILD_ROOT%{strongswan_libdir}/lib{charon,hydra,strongswan,pttls}.so rm -f $RPM_BUILD_ROOT%{strongswan_libdir}/lib{radius,simaka,tls,tnccs,imcv}.so -find $RPM_BUILD_ROOT%{strongswan_libdir} \ - -name "*.a" -o -name "*.la" | xargs -r rm -f +find $RPM_BUILD_ROOT%{strongswan_libdir} -type f -name "*.la" -delete # install -d -m755 ${RPM_BUILD_ROOT}%{strongswan_docdir}/ install -c -m644 TODO NEWS README COPYING LICENSE \ @@ -367,20 +369,23 @@ install -c -m644 TODO NEWS README COPYING LICENSE \ ${RPM_BUILD_ROOT}%{strongswan_docdir}/ install -c -m644 ${RPM_SOURCE_DIR}/README.SUSE \ ${RPM_BUILD_ROOT}%{strongswan_docdir}/ -install -d -m755 $RPM_BUILD_ROOT%{_localstatedir}/run/strongswan -%post libs0 -%{run_ldconfig} -test -d %{_localstatedir}/run/strongswan || \ -%{__mkdir_p} %{_localstatedir}/run/strongswan +%{__install} -d -m 0755 %{buildroot}%{_tmpfilesdir} +echo 'd %{_rundir}/%{name} 0770 root root' > %{buildroot}%{_tmpfilesdir}/%{name}.conf -%postun libs0 -%{run_ldconfig} +%post libs0 -p /sbin/ldconfig + +%postun libs0 -p /sbin/ldconfig + +%pre ipsec +%service_add_pre %{name}.service %post ipsec %if ! %{with systemd} %{fillup_and_insserv ipsec} %endif +%{?tmpfiles_create: %tmpfiles_create %{_tmpfilesdir}/%{name}.conf } +%service_add_post %{name}.service %preun ipsec %if ! %{with systemd} @@ -394,12 +399,15 @@ if test -s %{_sysconfdir}/ipsec.conf.rpmsave ; then cp -p --backup=numbered %{_sysconfdir}/ipsec.conf.rpmsave \ %{_sysconfdir}/ipsec.conf.rpmsave.old fi +%service_del_preun %{name}.service %postun ipsec %if ! %{with systemd} %{insserv_cleanup} %endif +%service_del_postun %{name}.service + %files %defattr(-,root,root) %dir %{strongswan_docdir} @@ -448,6 +456,7 @@ fi %dir %{strongswan_plugins} %{strongswan_plugins}/libstrongswan-stroke.so %{strongswan_plugins}/libstrongswan-updown.so +%{_tmpfilesdir}/%{name}.conf %files doc %defattr(-,root,root) @@ -662,7 +671,6 @@ fi %{strongswan_plugins}/libstrongswan-xauth-generic.so %{strongswan_plugins}/libstrongswan-xauth-pam.so %{strongswan_plugins}/libstrongswan-xcbc.so -%dir %ghost %{_localstatedir}/run/strongswan %dir %{strongswan_datadir} %dir %{strongswan_templates} %dir %{strongswan_templates}/config