• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Name:           capstone
2Version:        3.0.4
3Release:        2
4Summary:        A lightweight multi-platform, multi-architecture disassembly framework
5
6License:        BSD
7URL:            http://www.capstone-engine.org/
8Source0:        http://www.capstone-engine.org/download/%{version}/%{name}-%{version}.tar.gz
9
10%if 0%{?fedora} > 12
11%global with_python3 1
12%else
13%{!?__python2: %global __python2 /usr/bin/python2}
14%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
15%endif
16
17%global srcname distribute
18
19BuildRequires:  python2-devel
20BuildRequires:  jna
21BuildRequires:  java-devel
22%if 0%{?with_python3}
23BuildRequires:  python3-devel
24%endif # if with_python3
25%global _hardened_build 1
26
27
28%description
29Capstone is a disassembly framework with the target of becoming the ultimate
30disasm engine for binary analysis and reversing in the security community.
31
32%package        devel
33Summary:        Development files for %{name}
34Requires:       %{name}%{?_isa} = %{version}-%{release}
35
36%description    devel
37The %{name}-devel package contains libraries and header files for
38developing applications that use %{name}.
39
40%package        python
41Summary:        Python bindings for %{name}
42Requires:       %{name}%{?_isa} = %{version}-%{release}
43
44%description    python
45The %{name}-python package contains python bindings for %{name}.
46
47%if 0%{?with_python3}
48%package	python3
49Summary:	Python3 bindings for %{name}
50Requires:	%{name}%{?_isa} = %{version}-%{release}
51
52%description	python3
53The %{name}-python3 package contains python3 bindings for %{name}.
54%endif # with_python3
55
56%package        java
57Summary:        Java bindings for %{name}
58Requires:       %{name} = %{version}-%{release}
59BuildArch:      noarch
60
61%description    java
62The %{name}-java package contains java bindings for %{name}.
63
64%prep
65%setup -q
66
67%build
68DESTDIR="%{buildroot}" 	V=1 CFLAGS="%{optflags}" \
69LIBDIRARCH="%{_lib}" INCDIR="%{_includedir}" make %{?_smp_mflags}
70
71# Fix pkgconfig file
72sed -i 's;%{buildroot};;' capstone.pc
73grep -v archive capstone.pc > capstone.pc.tmp
74mv capstone.pc.tmp capstone.pc
75
76# build python bindings
77pushd bindings/python
78CFLAGS="%{optflags}" %{__python2} setup.py build
79%if 0%{?with_python3}
80CFLAGS="%{optflags}" %{__python3} setup.py build
81%endif # with_python3
82popd
83
84# build java bindings
85pushd bindings/java
86make CFLAGS="%{optflags}" # %{?_smp_mflags} parallel seems broken
87popd
88
89%install
90DESTDIR=%{buildroot} LIBDIRARCH=%{_lib} \
91INCDIR="%{_includedir}" make install
92find %{buildroot} -name '*.la' -exec rm -f {} ';'
93find %{buildroot} -name '*.a' -exec rm -f {} ';'
94
95# install python bindings
96pushd bindings/python
97%{__python2} setup.py install --skip-build --root %{buildroot}
98%if 0%{?with_python3}
99%{__python3} setup.py install --skip-build --root %{buildroot}
100%endif # with_python3
101popd
102
103# install java bindings
104install -D -p -m 0644 bindings/java/%{name}.jar  %{buildroot}/%{_javadir}/%{name}.jar
105
106%check
107ln -s libcapstone.so libcapstone.so.3
108make check LD_LIBRARY_PATH="`pwd`"
109
110%post -p /sbin/ldconfig
111
112%postun -p /sbin/ldconfig
113
114
115%files
116# %license does not work for RHEL<7
117%if 0%{?rhel} || 0%{?fedora} < 21
118%doc LICENSE.TXT LICENSE_LLVM.TXT
119%else
120%license LICENSE.TXT LICENSE_LLVM.TXT
121%endif # %license workarond for RHEL<7
122%doc README ChangeLog
123%{_libdir}/*.so.*
124
125%files devel
126%{_includedir}/*
127%{_libdir}/*.so
128%{_libdir}/pkgconfig/*
129
130%files python
131%{python2_sitelib}/*egg-info
132%{python2_sitelib}/%{name}
133
134%if 0%{?with_python3}
135%files python3
136%{python3_sitelib}/*egg-info
137%{python3_sitelib}/%{name}
138%endif # _with_python3
139
140%files java
141%{_javadir}/
142
143%changelog
144* Thu Jul 16 2015 Stefan Cornelius <scorneli@redhat.com> - 3.0.4-2
145- Fix EPEL6 build problems
146
147* Wed Jul 15 2015 Stefan Cornelius <scorneli@redhat.com> - 3.0.4-1
148- new version 3.0.4. Includes security fixes.
149
150* Tue May 12 2015 Stefan Cornelius <scorneli@redhat.com> - 3.0.3-2
151- Addressed issues found during package review.
152
153* Fri May 08 2015 Stefan Cornelius <scorneli@redhat.com> - 3.0.3-1
154-  Update to version 3.0.3
155
156* Fri May 08 2015 Stefan Cornelius <scorneli@redhat.com> - 3.0.2-3
157- Added python3 and hardened build support. Update java building.
158- Various cleanups.
159
160* Wed May 06 2015 Stefan Cornelius <scorneli@redhat.com> - 3.0.2-2
161- Update to 3.0.2. Fix 64bit issues. add %check.
162
163* Sat Sep 27 2014 Adel Gadllah <adel.gadllah@gmail.com> - 2.1.2-2
164- Addressed issues found during package review.
165
166* Mon May 19 2014 Adel Gadllah <adel.gadllah@gmail.com> - 2.1.2-1
167- Initial package
168