Refactor make system and directory hierarchy
[platform/upstream/csr-framework.git] / packaging / csr-framework.spec
1 %global csr_fw_server_build 0
2 %global csr_fw_common_Build 0
3 %global csr_fw_test_build 0
4
5 Summary: A general purpose content screening and reputation solution
6 Name: csr-framework
7 Version: 2.0.0
8 Release: 0
9 Source: %{name}-%{version}.tar.gz
10 License: BSD-2.0
11 Group: Security/Service
12 URL: http://tizen.org
13 BuildRequires: cmake
14 BuildRequires: pkgconfig(dlog)
15
16 %description
17 General purpose content screening and reputation solution. Can scan
18 file contents and checking url to prevent malicious items.
19
20 %package -n lib%{name}-client
21 Summary: Client library package for %{name}
22 License: BSD-2.0
23 Group:   Security/Libraries
24 Requires: %{name} = %{version}-%{release}
25
26 %description -n lib%{name}-client
27 csr-framework client library package.
28
29 %package devel
30 Summary:    Development files for %{name}
31 Group:      Security/Development
32 Requires:   %{name} = %{version}
33
34 %description devel
35 csr-framework developemnt files including headers and pkgconfig file.
36
37 %if 0%{?csr_fw_test_build}
38 %package test
39 Summary:    test program for %{name}
40 Group:      Security/Testing
41 Requires:   %{name} = %{version}
42
43 %description test
44 Comaptilibty test program
45 %endif
46
47 %prep
48 %setup -q
49
50 # assign client name as secfw to support backward compatibility
51 %global client_name secfw
52 %global bin_dir %{_bindir}
53
54 %build
55 %cmake . \
56     -DCMAKE_BUILD_TYPE=%{?build_type:%build_type}%{!?build_type:RELEASE} \
57     -DCMAKE_VERBOSE_MAKEFILE=ON \
58     -DCMAKE_INSTALL_PREFIX=%{_prefix} \
59 %if 0%{?csr_fw_server_build}
60     -DCSR_FW_COMMON_BUILD=1 \
61 %endif
62 %if 0%{?csr_fw_server_build}
63     -DCSR_FW_SERVER_BUILD=1 \
64 %endif
65 %if 0%{?csr_fw_test_build}
66     -DCSR_FW_TEST_BUILD=1 \
67 %endif
68     -DSERVICE_NAME=%{name} \
69     -DVERSION=%{version} \
70     -DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \
71     -DBIN_DIR:PATH=%{bin_dir} \
72     -DCLIENT_NAME=%{client_name}
73
74 make %{?jobs:-j%jobs}
75
76 %install
77 %make_install
78
79 %post -p /sbin/ldconfig
80 %postun -p /sbin/ldconfig
81
82 %files
83 %defattr(-,root,root,-)
84 %license LICENSE
85 %if 0%{?csr_fw_server_build}
86 # TODO: list up server files here
87 %endif
88 %if 0%{?csr_fw_common_build}
89 # TODO: list up common library files here
90 %endif
91
92 %files -n lib%{name}-client
93 %defattr(-,root,root,-)
94 %license LICENSE
95 %{_libdir}/lib%{client_name}.so.*
96
97 %files devel
98 %doc README
99 %doc doc/
100 %{_includedir}/TCSErrorCodes.h
101 %{_includedir}/TCSImpl.h
102 %{_includedir}/TWPImpl.h
103 %{_libdir}/pkgconfig/%{name}.pc
104 %{_libdir}/lib%{client_name}.so
105
106 %if 0%{?csr_fw_test_build}
107 %files test
108 %defattr(-,root,root,-)
109 %{bin_dir}/csr-test
110 %endif