about summary refs log tree commit diff
path: root/nix.spec.in
blob: fc34067c179cebd6cc6a4c868f3d7b1fc1197e4a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# This RPM accepts the following defininitions (which can be passed
# using `--define' to rpmbuild, e.g., --define 'enable_setuid yes'):
#   enable_setuid: if non-empty, pass `--enable-setuid' to configure
#   nix_user: if set, pass as `--with-nix-user' to configure 
#   nix_group: if set, pass as `--with-nix-group' to configure

%{!?enable_setuid: %define enable_setuid ""}
%{!?nix_user: %define nix_user ""}
%{!?nix_group: %define nix_group ""}

Summary: The Nix software deployment system
Name: nix
Version: @version@
Release: 1
License: GPL
Group: Software Deployment
URL: http://www.cs.uu.nl/groups/ST/Trace/Nix
Source0: %{name}-@version@.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
%define _prefix /nix
Prefix: %{_prefix}
Requires: /usr/bin/perl

%description

Nix is a system for software deployment.

%prep
%setup -q

%build
extraFlags=
if test -n "%{enable_setuid}"; then
    extraFlags="$extraFlags --enable-setuid"
    if test -n "%{nix_user}"; then
        extraFlags="$extraFlags --with-nix-user=%{nix_user}"
    fi
    if test -n "%{nix_group}"; then
        extraFlags="$extraFlags --with-nix-group=%{nix_group}"
    fi
fi
./configure --prefix=%{_prefix} $extraFlags
make
make check

%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
strip $RPM_BUILD_ROOT/%{_prefix}/bin/* || true

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%{_prefix}/bin
%{_prefix}/libexec
%{_prefix}/var
%{_prefix}/share
%{_prefix}/man
%{_prefix}/store
%config
%{_prefix}/etc
#%doc
#%{_prefix}/share/nix/manual