Unreachable code (WGID-312946)
[platform/core/api/vpn-setting.git] / packaging / capi-network-vpn-setting.spec
1 %define ipsec_test yes
2
3 Name:       capi-network-vpn-setting
4 Summary:    Default VPN Library
5 Version:    0.1.2
6 Release:    1
7 Group:      System/Network
8 License:    Apache-2.0
9 Source0:    %{name}-%{version}.tar.gz
10 Source1001:     capi-network-vpn-setting.manifest
11 BuildRequires:  cmake
12 BuildRequires:  pkgconfig(dlog)
13 BuildRequires:  pkgconfig(glib-2.0)
14 BuildRequires:  pkgconfig(vconf)
15 BuildRequires:  pkgconfig(capi-base-common)
16 BuildRequires:  pkgconfig(libtzplatform-config)
17 %if "%{ipsec_test}" == "yes"
18 BuildRequires:  openssl
19
20 %global rw_app_dir %{?TZ_SYS_RW_APP:%TZ_SYS_RW_APP}%{!?TZ_SYS_RW_APP:/opt/usr/apps}
21 %global cert_examples %rw_app_dir/vpn-cert-examples
22 %define etc_dir     %{?TZ_SYS_ETC:%TZ_SYS_ETC}%{!?TZ_SYS_ETC:/opt/etc}
23 %define ro_etc_dir  %{?TZ_SYS_RO_ETC:%TZ_SYS_RO_ETC}%{!?TZ_SYS_RO_ETC:%_sysconfdir}
24 %global ca_certs_dir %{?TZ_SYS_CA_CERTS:%TZ_SYS_CA_CERTS}%{!?TZ_SYS_CA_CERTS:%etc_dir/ssl/certs}
25
26 %global host_cert_examples %etc_dir/vpn-cert-examples
27 %endif
28
29 %description
30 Library code for CAPI's to interact with the Default VPN functionality on TIZEN platform.
31
32 %package devel
33 Summary:  Default VPN Development Package
34 Group:    System/Network
35 Requires: %{name} = %{version}-%{release}
36
37 %description devel
38 Development Library for Default VPN functionality on TIZEN platform.
39
40 %package test
41 Summary:    Default VPN Test Package
42 Requires:   %{name} = %{version}
43
44 %description test
45 Test cases for Default VPN Functionality on TIZEN platform.
46
47 %if "%{ipsec_test}" == "yes"
48 %package host-cert
49 Summary:    Certification for host
50 AutoReqProv: no
51
52 %description host-cert
53 Certification and private key for strongswan responder
54 %endif
55
56 %prep
57 %setup -q
58 cp %{SOURCE1001} .
59
60 %build
61 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
62 %cmake . \
63 %if "%{ipsec_test}" == "yes"
64         -DIPSEC_TEST=1 \
65         -DCERT_EXAMPLES=%cert_examples \
66         -DHOST_CERT_EXAMPLES=%host_cert_examples \
67         -DCA_CERTS_DIR=%ca_certs_dir \
68 %endif
69         -DFULLVER=%{version} \
70         -DMAJORVER=${MAJORVER}
71
72 make %{?_smp_mflags}
73
74 %install
75 %make_install
76
77 %if "%{ipsec_test}" == "yes"
78 mkdir -p %buildroot%cert_examples
79 mkdir -p %buildroot%host_cert_examples
80 %endif
81
82 %post -p /sbin/ldconfig
83
84 %postun -p /sbin/ldconfig
85
86
87 %files
88 %manifest %{name}.manifest
89 %attr(644,-,-) %{_libdir}/libcapi-network-vpn-setting.so.*
90 %license LICENSE.APLv2
91
92 %files devel
93 %manifest %{name}.manifest
94 #%{_includedir}/network/*.h
95 %{_libdir}/pkgconfig/*.pc
96 %{_libdir}/libcapi-network-vpn-setting.so
97
98 %files test
99 %manifest %{name}.manifest
100 %{_libdir}/vpn_setting_test
101 %{_bindir}/vpn_setting_test
102 %if "%{ipsec_test}" == "yes"
103 %{cert_examples}/*
104
105 %files host-cert
106 %{host_cert_examples}/*
107 %endif
108