- only enable deprecated spec sections when building on systems with older RPM versions - move tests to dedicated %check section - use standard build macros

This commit is contained in:
Michel Alexandre Salim 2012-05-17 12:04:56 +08:00 committed by Eelco Dolstra
parent e545a7f9a8
commit d0308073c3
1 changed files with 12 additions and 6 deletions

View File

@ -12,11 +12,14 @@ Name: nix
Version: @version@ Version: @version@
Release: 1 Release: 1
License: GPL License: GPL
Group: Software Deployment %if 0%{?rhel}
Group: Applications/System
%endif
URL: http://nixos.org/ URL: http://nixos.org/
Source0: %{name}-@version@.tar.bz2 Source0: %{name}-@version@.tar.bz2
%if 0%{?el5}
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
Prefix: /usr %endif
Requires: /usr/bin/perl Requires: /usr/bin/perl
Requires: curl Requires: curl
Requires: perl-DBD-SQLite Requires: perl-DBD-SQLite
@ -53,15 +56,18 @@ if test -n "%{enable_setuid}"; then
extraFlags="$extraFlags --with-nix-group=%{nix_group}" extraFlags="$extraFlags --with-nix-group=%{nix_group}"
fi fi
fi fi
./configure --prefix=%{_prefix} --sysconfdir=/etc $extraFlags %configure $extraFlags
make make %{?_smp_flags}
make check
%install %install
%if 0%{?el5}
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
%endif
make DESTDIR=$RPM_BUILD_ROOT install make DESTDIR=$RPM_BUILD_ROOT install
rm $RPM_BUILD_ROOT/etc/nix/nix.conf rm $RPM_BUILD_ROOT/etc/nix/nix.conf
strip $RPM_BUILD_ROOT/%{_prefix}/bin/* || true
%check
make check
%clean %clean
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT