File turnpike.spec of Package turnpike

# spec file for package turnpike
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

# norootforbuild

Name:           turnpike
BuildRequires:  gnome-common gtk2 gtk2-devel intltool libgcrypt-devel libxml2-devel novell-ipsec-tools-devel openssl-devel perl-XML-Parser update-desktop-files
%define prefix /usr
%define sysconfdir /etc
%define libexecdir %{prefix}/lib/turnpike
%define datadir /usr/share/turnpike
%define plugindir %prefix/lib/turnpike/plugins
%define gnome /gnome
Summary:        IKE Plugin framework for IPSec tools
Version:        0.1.2
Release:        13
License:        BSD-3-Clause
Group:          Productivity/Networking/Security
Source:         %{name}-%{version}.tar.bz2
Source1:        vpnlogin.desktop
Source2:        vpnlogin.gif
Source3:        README.SuSE
Requires:       novell-ipsec-tools >= 0.7
PreReq:         coreutils
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Patch0:         turnpike-0.1.2-missing-closedir.patch
Patch1:         turnpike-gmodule-and-unused-warning.patch

This package contains binaries for making use of ipsec-tools with a
plugin framework. This enables to write custom vendor plugins to
process IPSec packets for solutions like VPN.

%setup -q
%patch1 -p1
cp -v %{S:3} .
# no point in having this in a package
sed -i -e 's,-Werror,,' configure

autoreconf -f -i
# fix build in disabling as-needed
./configure \
    --prefix=%{prefix} \
    --exec-prefix=%{prefix}  \
    --mandir=%{_mandir} \
    --infodir=%{_infodir} \
    --sysconfdir=%{sysconfdir} \
    --datadir=%{datadir} \
    --sharedstatedir=/var/run \
    --localstatedir=/var/run \
    --mandir=%{prefix}/share/man \
    --infodir=%{prefix}/share/info \
    --libdir=%{prefix}/%_lib \
    --libexecdir=%{libexecdir} \
%{__make} %{?jobs:-j%jobs}

make install DESTDIR=%{buildroot}
mkdir -p %{buildroot}/%{sysconfdir}/turnpike
mkdir -p %{buildroot}/etc/racoon/cert
mkdir -p %{buildroot}/%{sysconfdir}/turnpike/usercerts
mkdir -p %{buildroot}/%{sysconfdir}/turnpike/profiles
mkdir -p %{buildroot}/%{sysconfdir}/turnpike/vendorprofiles
# desktop icon
install -d %{buildroot}/%{datadir}/pixmaps
install -m 644 %{S:2} %{buildroot}/%{datadir}/pixmaps/vpnlogin.gif
install -d %{buildroot}/usr/share/applications
install -m 644 %{S:1} %{buildroot}/usr/share/applications/vpnlogin.desktop
%suse_update_desktop_file vpnlogin

if [ -L /usr/bin/vpnlogin ]; then
    rm -rf /usr/bin/vpnlogin
if [ -L /usr/bin/nvpn ] ; then
    rm -rf /usr/bin/nvpn
#remove it even if it doesnt exists 
%{libexecdir}/vpnUpdateMenu -u
%{libexecdir}/vpnUpdateMenu -i

#Do the following only if it is last uninstall
if [ "$1" = "0" ] ; then
    %{libexecdir}/vpnUpdateMenu -u
    rm -rf %{libexecdir}/vpnUpdateMenu
    rm -rf /usr/bin/vpnlogin
    rm -rf /usr/bin/nvpn
    rm -rf %{sysconfdir}/turnpike

rm -rf %{buildroot}

%dir %{sysconfdir}/turnpike
%dir %{sysconfdir}/turnpike/profiles
%dir %{sysconfdir}/turnpike/vendorprofiles
%dir %{sysconfdir}/turnpike/usercerts
%dir /etc/racoon
%dir /etc/racoon/cert
%dir %{datadir}
%dir %{datadir}/pixmaps
%dir %{libexecdir}
%dir %{prefix}/include/turnpike

openSUSE Build Service is sponsored by