#
# Conditional build:
-# _with_static build dar_static
+%bcond_without static # build without dar_static
#
Summary: dar makes backup of a directory tree and files
Summary(pl): dar - narzêdzie do tworzenia kopii zapasowych drzew katalogów i plików
Name: dar
-Version: 1.3.0
-Release: 2
-License: GPL
+Version: 2.0.4
+Release: 0.1
+License: GPL v2
Group: Applications
Source0: http://dl.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
-# Source0-md5: 7b2bb7aab490628153f1c9026536d903
-Patch0: %{name}-nostatic_compilation.patch
+# Source0-md5: 18b3ee1ea0fd44a680d5e828851fd3b2
+Patch0: %{name}-opt.patch
URL: http://dar.linux.free.fr/
BuildRequires: attr-devel
+BuildRequires: autoconf >= 2.54
+BuildRequires: automake
BuildRequires: bzip2-devel
+%ifarch alpha
+# ICE in 3.3.x up to 3.3.2 - require patched version
+BuildRequires: gcc-c++ >= 5:3.3.2-0.3
+%endif
BuildRequires: libstdc++-devel
+BuildRequires: libtool >= 2:1.4d
BuildRequires: zlib-devel
-%if %{?_with_static:1}0
+%if %{with static}
BuildRequires: attr-static
BuildRequires: bzip2-static
BuildRequires: glibc-static
%description static -l pl
Statyczna wersja archiwizatora dar.
+%package devel
+Summary: Header files to develop dar software
+Summary(pl): Pliki nag³ówkowe biblioteki dar
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description devel
+Header files to develop software which operates on dar.
+
+%description devel -l pl
+Pliki nag³ówkowe potrzebne do rozwoju oprogramowania korzystaj±cego z
+dara.
+
+%package libs-static
+Summary: Static version of dar library
+Summary(pl): Statyczna wersja biblioteki dar
+Group: Development/Libraries
+Requires: %{name}-devel = %{version}-%{release}
+
+%description libs-static
+Static version of dar library.
+
+%description libs-static -l pl
+Statyczna wersja biblioteki dar.
+
%prep
%setup -q
-%patch0 -p1
+%patch -p1
%build
-%{__make} \
-%if %{?_with_static:1}0
- BUILD_STATIC=\"yes\" \
-%else
- BUILD_STATIC=\"no\" \
-%endif
- OPTIMIZATION="%{rpmcflags}" \
- EA_SUPPORT=yes \
- FILEOFFSET="-D_FILE_OFFSET_BITS=64"
+%{__libtoolize}
+%{__aclocal}
+%{__autoconf}
+%{__autoheader}
+%{__automake}
+%configure \
+ --enable-ea-support \
+%{?without_static:--disable-dar-static} \
+ --disable-upx
+%{__make}
%install
rm -rf $RPM_BUILD_ROOT
-%{?_with_static:install -d $RPM_BUILD_ROOT/bin}
+%{?with_static:install -d $RPM_BUILD_ROOT/bin}
%{__make} install \
-%if %{?_with_static:1}0
- BUILD_STATIC=\"yes\" \
-%else
- BUILD_STATIC=\"no\" \
-%endif
- INSTALL=install \
- INSTALL_ROOT_DIR=$RPM_BUILD_ROOT \
- BIN_DIR=%{_bindir} \
- MAN_DIR=%{_mandir}
+ DESTDIR=$RPM_BUILD_ROOT
-%{?_with_static:mv -f $RPM_BUILD_ROOT{%{_bindir},/bin}/dar_static}
+%{?with_static:mv -f $RPM_BUILD_ROOT{%{_bindir},/bin}/dar_static}
%clean
rm -rf $RPM_BUILD_ROOT
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
%files
%defattr(644,root,root,755)
-%doc BUGS CHANGES NOTES README TODO TUTORIAL
+%doc BUGS README TODO doc
%attr(755,root,root) %{_bindir}/*
+%attr(755,root,root) %{_libdir}/libdar.so.*.*.*
+%{_datadir}/%{name}
%{_mandir}/man1/*
-%if %{?_with_static:1}0
+%files devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libdar.so
+%{_libdir}/libdar.la
+%{_includedir}/dar
+
+%if %{with static}
%files static
%defattr(644,root,root,755)
%attr(755,root,root) /bin/*
%endif
+
+%files libs-static
+%defattr(644,root,root,755)
+%{_libdir}/libdar.a