File bsdiff.spec of Package bsdiff
#
# spec file for package bsdiff
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: bsdiff
Version: 4.3
Release: 0
Summary: Tools for patches to binary files
License: BSD-2-Clause
Group: Productivity/File utilities
Url: http://daemonology.net/bsdiff/
Source: http://daemonology.net/bsdiff/%{name}-%{version}.tar.gz
BuildRequires: gcc
BuildRequires: make
BuildRequires: libbz2-devel
%description
bsdiff and bspatch are tools for building and applying patches to
binary files. By using suffix sorting (specifically, Larsson and
Sadakane's qsufsort) and taking advantage of how executable files
change, bsdiff routinely produces binary patches 50-80%% smaller
than those produced by Xdelta, and 15%% smaller than those produced
by .RTPatch.
%prep
%setup -q
# Fix make install.
sed -i 's/^\..*$//g;s|${PREFIX}|${DESTDIR}${PREFIX}|g;s|${PREFIX}/man|%{_mandir}|g' Makefile
head -n 25 %{name}.c > COPYING
%build
# Normal make fails for unknown reason so workaround had been made.
%{__cc} %{optflags} %{name}.c -lbz2 -o %{name}
%{__cc} %{optflags} bspatch.c -lbz2 -o bspatch
%install
mkdir -p %{buildroot}%{_bindir} %{buildroot}%{_mandir}/man1/
%make_install PREFIX=%{_prefix} INSTALL=%{_bindir}/install
%files
%defattr(-,root,root)
%doc COPYING
%{_bindir}/%{name}
%{_bindir}/bspatch
%{_mandir}/man1/*
%changelog