]>
Commit | Line | Data |
---|---|---|
c4326b53 ER |
1 | # TODO |
2 | # - http://yara.readthedocs.org/en/latest/gettingstarted.html#compiling-and-installing-yara | |
c4326b53 ER |
3 | # --enable-cuckoo --enable-magic |
4 | ||
250157b8 ER |
5 | # Conditional build: |
6 | %bcond_without static_libs # don't build static libraries | |
74363204 | 7 | %bcond_without python2 # CPython 2.x module |
395990fa | 8 | %bcond_without crypto # build without tests |
250157b8 | 9 | |
fefa098e | 10 | Summary: The pattern matching swiss knife for malware researchers (and everyone else) |
250157b8 | 11 | Name: yara |
fefa098e | 12 | Version: 3.4.0 |
aa189c74 | 13 | Release: 5 |
fefa098e | 14 | License: Apache v2.0 |
250157b8 | 15 | Group: Libraries |
fefa098e ER |
16 | Source0: https://github.com/plusvic/yara/archive/v%{version}/%{name}-%{version}.tar.gz |
17 | # Source0-md5: b3f9d4e00c1da4d37af05b1f4488255f | |
225ba25c | 18 | Patch0: cflags.patch |
fefa098e ER |
19 | URL: http://plusvic.github.io/yara/ |
20 | BuildRequires: autoconf | |
21 | BuildRequires: automake | |
22 | BuildRequires: libtool | |
395990fa | 23 | %{?with_crypto:BuildRequires: openssl-devel} |
250157b8 | 24 | BuildRequires: pcre-devel |
6316a46a | 25 | BuildRequires: pkgconfig |
b022ab29 ER |
26 | BuildRequires: rpmbuild(macros) >= 1.219 |
27 | %if %{with python2} | |
28 | BuildRequires: python-devel | |
29 | BuildRequires: rpm-pythonprov | |
30 | %endif | |
250157b8 ER |
31 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
32 | ||
33 | %description | |
fefa098e ER |
34 | YARA is a tool aimed at (but not limited to) helping malware |
35 | researchers to identify and classify malware samples. With YARA you | |
36 | can create descriptions of malware families (or whatever you want to | |
37 | describe) based on textual or binary patterns. Each description, a.k.a | |
38 | rule, consists of a set of strings and a boolean expression which | |
39 | determine its logic. | |
250157b8 ER |
40 | |
41 | %package devel | |
42 | Summary: Header files for yara library | |
43 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki yara | |
44 | Group: Development/Libraries | |
45 | Requires: %{name} = %{version}-%{release} | |
ff681652 | 46 | Requires: pcre-devel |
250157b8 ER |
47 | |
48 | %description devel | |
49 | Header files for yara library. | |
50 | ||
51 | %description devel -l pl.UTF-8 | |
52 | Pliki nagłówkowe biblioteki yara. | |
53 | ||
54 | %package static | |
55 | Summary: Static yara library | |
56 | Summary(pl.UTF-8): Statyczna biblioteka yara | |
57 | Group: Development/Libraries | |
58 | Requires: %{name}-devel = %{version}-%{release} | |
59 | ||
60 | %description static | |
61 | Static yara library. | |
62 | ||
63 | %description static -l pl.UTF-8 | |
64 | Statyczna biblioteka yara. | |
65 | ||
b022ab29 ER |
66 | %package -n python-%{name} |
67 | Summary: Python bindings to yara library | |
68 | Group: Development/Languages/Python | |
69 | Requires: python-modules | |
70 | ||
71 | %description -n python-%{name} | |
72 | This is a Python extension that gives you access to YARA's powerful | |
73 | features from your own Python scripts. | |
74 | ||
250157b8 ER |
75 | %prep |
76 | %setup -q | |
225ba25c | 77 | %patch0 -p1 |
250157b8 ER |
78 | |
79 | %build | |
fefa098e ER |
80 | %{__aclocal} -I m4 |
81 | %{__libtoolize} | |
82 | %{__autoconf} | |
83 | %{__autoheader} | |
84 | %{__automake} | |
250157b8 | 85 | %configure \ |
395990fa | 86 | %{__with_without crypto} \ |
250157b8 ER |
87 | %{!?with_static_libs:--disable-static} |
88 | %{__make} | |
89 | ||
74363204 | 90 | %if %{with python2} |
b022ab29 | 91 | cd yara-python |
74363204 | 92 | %py_build |
b022ab29 ER |
93 | %endif |
94 | ||
250157b8 ER |
95 | %install |
96 | rm -rf $RPM_BUILD_ROOT | |
250157b8 ER |
97 | %{__make} install \ |
98 | DESTDIR=$RPM_BUILD_ROOT | |
99 | ||
b022ab29 | 100 | # obsoleted by pkg-config |
74363204 | 101 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libyara.la |
b022ab29 ER |
102 | |
103 | %if %{with python2} | |
104 | cd yara-python | |
74363204 | 105 | %py_install |
b022ab29 ER |
106 | |
107 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} | |
108 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} | |
109 | %py_postclean | |
110 | %endif | |
250157b8 ER |
111 | |
112 | %clean | |
113 | rm -rf $RPM_BUILD_ROOT | |
114 | ||
115 | %post -p /sbin/ldconfig | |
116 | %postun -p /sbin/ldconfig | |
117 | ||
118 | %files | |
119 | %defattr(644,root,root,755) | |
fefa098e | 120 | %doc README.md AUTHORS CONTRIBUTORS |
250157b8 | 121 | %attr(755,root,root) %{_bindir}/yara |
fefa098e | 122 | %attr(755,root,root) %{_bindir}/yarac |
250157b8 | 123 | %attr(755,root,root) %{_libdir}/libyara.so.*.*.* |
fefa098e | 124 | %attr(755,root,root) %ghost %{_libdir}/libyara.so.3 |
250157b8 | 125 | %{_mandir}/man1/yara.1* |
fefa098e | 126 | %{_mandir}/man1/yarac.1* |
250157b8 ER |
127 | |
128 | %files devel | |
129 | %defattr(644,root,root,755) | |
130 | %{_includedir}/yara.h | |
fefa098e | 131 | %{_includedir}/yara |
250157b8 | 132 | %{_libdir}/libyara.so |
fefa098e | 133 | %{_pkgconfigdir}/yara.pc |
250157b8 ER |
134 | |
135 | %if %{with static_libs} | |
136 | %files static | |
137 | %defattr(644,root,root,755) | |
138 | %{_libdir}/libyara.a | |
139 | %endif | |
b022ab29 ER |
140 | |
141 | %if %{with python2} | |
142 | %files -n python-%{name} | |
143 | %defattr(644,root,root,755) | |
144 | %doc yara-python/README | |
145 | %attr(755,root,root) %{py_sitedir}/yara.so | |
146 | %{py_sitedir}/yara_python-*.egg-info | |
147 | %endif |