Blob Blame History Raw
%global gitrev 5c60189

Name:           udis86
Version:        1.7
Release:        7.%{gitrev}%{?dist}
Summary:        A disassembler library for x86 and x86-64

Group:          System Environment/Libraries
License:        BSD
URL:            https://github.com/vmt/udis86
Source0:        %{name}-%{gitrev}.tar.bz2

# Disable unit tests that require yasm > 1.2.0
Patch0:         0001-tests-disable-testgen-32-64-to-accomodate-yasm-1.2.0.patch
Patch1:         0001-docs-use-xsltproc-nonet-to-avoid-network-access-when.patch

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  libtool
BuildRequires:  docbook-style-xsl
# for xsltproc
BuildRequires:  libxslt
BuildRequires:  python
BuildRequires:  yasm

%description
udis86 is a disassembler library (libudis86) for x86 and x86-64.
The primary intent is to aid binary code analysis.

%package        devel
Summary:        Development files for %{name}
Group:          Development/Libraries
Requires:       %{name} = %{version}-%{release}

%description    devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.


%prep
%setup -q -n %{name}-%{gitrev}
%patch0 -p1
%patch1 -p1
find '(' -name '*.c' -or -name '*.h' ')' -exec chmod 644 {} \;

%build
# don't let automake treat warnings as errors
sed -i '/AM_INIT_AUTOMAKE/s/-Werror //' configure.ac
./autogen.sh
%configure --disable-static --enable-shared
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
# udis86 overrides "docdir" from automake to datadir/docs
rm -rf %{buildroot}%{_datadir}/docs


%check
# test the libudis86 we just built. this is the only part that requires yasm
export LD_LIBRARY_PATH=$(pwd)/libudis86/.libs
make check


%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%{_bindir}/udcli
%{_libdir}/*.so.*

%files devel
%defattr(-,root,root,-)
%doc docs/x86/optable.* docs/manual/manual.* docs/index.html docs/style.css
%{_includedir}/*
%{_libdir}/*.so


%changelog
* Mon Nov 26 2012 Scott Tsai <scottt.tw@gmail.com> 1.7-7
- Upstream 5c60189

* Sun Jul 22 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Fri Dec 04 2009 Scott Tsai <scottt.tw@gmail.com> 1.7-3
- Actually remove commented out requires line
- Move check section after install section
- Place udcli in the main package instead of -devel
- Fix source file permissions

* Thu Dec 03 2009 Scottt Tsai <scottt.tw@gmail.com> 1.7-2
- Fix source url
- Remove commented out requires line
- Fix summary
- Move "make check" to check section
- Mark doc files instead of relying on make install

* Thu Dec 03 2009 Scott Tsai <scottt.tw@gmail.com> 1.7-1
- upstream 1.7