-# TODO
-# - use same dir as chkconfig based "alternatives"-implementation for state dir?
-# - move it (/var/lib/dpkg/alternatives) to alternatives package?
+#
+# Conditional build:
+%bcond_with alternatives # build alternatives package
+
%include /usr/lib/rpm/macros.perl
Summary: Package maintenance system for Debian Linux
Summary(pl.UTF-8): Program do obsługi pakietów Debiana
Name: dpkg
Version: 1.18.4
-Release: 2
+Release: 3
License: GPL v2+
Group: Applications/File
Source0: ftp://ftp.debian.org/debian/pool/main/d/dpkg/%{name}_%{version}.tar.xz
ac_cv_header_md5_h=no \
PO4A="true" \
--disable-dselect \
+ %{!?with_alternatives:--disable-update-alternatives} \
--disable-silent-rules \
--disable-start-stop-daemon \
--with-admindir=/var/lib/%{name}
%install
rm -rf $RPM_BUILD_ROOT
-
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
+%if %{with alternatives}
%{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/alternatives/README
+%endif
# obsoleted by pkg-config
%{__rm} $RPM_BUILD_ROOT%{_libdir}/libdpkg.la
%{perl_vendorlib}/Dpkg
%dir /var/lib/dpkg
-%dir /var/lib/dpkg/alternatives
%dir /var/lib/dpkg/info
%dir /var/lib/dpkg/parts
%dir /var/lib/dpkg/updates
%{_includedir}/dpkg
%{_pkgconfigdir}/libdpkg.pc
+%if %{with alternatives}
%files alternatives
%defattr(644,root,root,755)
%dir %{_sysconfdir}/alternatives
%lang(ja) %{_mandir}/ja/man1/update-alternatives.1*
%lang(pl) %{_mandir}/pl/man1/update-alternatives.1*
%lang(sv) %{_mandir}/sv/man1/update-alternatives.1*
+%dir /var/lib/dpkg/alternatives
+%endif