File dmg2img.spec of Package dmg2img

%define realname dmg2img
%define realver  1.6.7
%define srcext   tar.gz

# turn off the generation of debuginfo rpm  (RH9) ??
%global debug_package %{nil}

# Common info
Name:          %{realname}
Version:       %{realver}
Release:       wiz%{?extraver:0.}1%{?dist}
License:       GPL-2.0
Group:         System/Filesystems
URL:           http://vu1tur.eu.org/tools/
Summary:       Convert Apple compressed dmg archives to standard image disk files

# Build-time parameters
BuildRequires: openssl-devel
BuildRequires: zlib-devel
%if 0%{?suse_version}
BuildRequires: libbz2-devel
%else
BuildRequires: bzip2-devel
%endif
BuildRoot:     %{_tmppath}/%{name}-root
Source:        http://vu1tur.eu.org/tools/%{realname}-%{realver}%{?extraver}.%{srcext}

%description
DMG2IMG is a tool which allows converting Apple compressed dmg archives
to standard (hfsplus) image disk files.

This tool handles zlib and bzip2 compressed dmg images.

# Preparation step (unpackung and patching if necessary)
%prep
%setup -q -n %{realname}-%{realver}%{?extraver}
sed -ri '8 s/(\$\(CC\))/\1 $(LDFLAGS)/' Makefile

%build
%{__make} %{?_smp_mflags} \
 CFLAGS="%{optflags} %{?gcc_lto}" \
 CXXFLAGS="%{optflags} %{?gcc_lto}" \
 LDFLAGS="-Wl,--as-needed -Wl,--strip-all %{?gcc_lto}"

%install
%{__install} -d -m0755 %{buildroot}%{_bindir}
%{__install} -d -m0755 %{buildroot}%{_mandir}/man1
%{__install} -m0755 dmg2img vfdecrypt %{buildroot}%{_bindir}
%{__install} -m0644 vfdecrypt.1 %{buildroot}%{_mandir}/man1

%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}

%files
%defattr(-,root,root)
%doc COPYING README
%{_bindir}/*
%doc %{_mandir}/man1/*

%changelog
openSUSE Build Service is sponsored by