summary refs log tree commit diff
path: root/nix.spec.in
blob: 12f3f6deceda1c6f9de03ae1f3a43a86fbc8000f (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
%global enable_setuid ""
%global nix_user "nix"
%global nix_group "nix"

# If set, the Nix user and group will be created by the RPM
# pre-install script.
%global nix_user_uid ""
%global nix_group_gid ""

Summary: The Nix software deployment system
Name: nix
Version: @version@
Release: 1
License: GPL
%if 0%{?rhel}
Group: Applications/System
%endif
URL: http://nixos.org/
Source0: %{name}-@version@.tar.bz2
%if 0%{?el5}
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
%endif
Requires: /usr/bin/perl
Requires: curl
Requires: perl-DBD-SQLite
Requires: perl-devel
Requires: bzip2
Requires: bzip2-libs
Requires: sqlite
BuildRequires: bzip2-devel
BuildRequires: sqlite-devel

# Hack to make that shitty RPM scanning hack shut up.
Provides: perl(Nix::SSH)
                                                               
%description

Nix is a purely functional package manager. It allows multiple
versions of a package to be installed side-by-side, ensures that
dependency specifications are complete, supports atomic upgrades and
rollbacks, allows non-root users to install software, and has many
other features. It is the basis of the NixOS Linux distribution, but
it can be used equally well under other Unix systems.

%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 $extraFlags
make %{?_smp_flags}

%install
%if 0%{?el5}
rm -rf $RPM_BUILD_ROOT
%endif
make DESTDIR=$RPM_BUILD_ROOT install
rm $RPM_BUILD_ROOT/etc/nix/nix.conf

%check
make check

%clean
rm -rf $RPM_BUILD_ROOT

%pre
if test -n "%{nix_group_gid}"; then
    /usr/sbin/groupadd -g %{nix_group_gid} %{nix_group} || true
fi
if test -n "%{nix_user_uid}"; then
    /usr/sbin/useradd -c "Nix" -u %{nix_user_uid} \
        -s /sbin/nologin -r -d /var/empty %{nix_user} \
        -g %{nix_group} || true
fi

%files
#%defattr(-,root,root)
%{_prefix}/bin
%{_prefix}/lib
%{_prefix}/libexec
%{_prefix}/include
%{_prefix}/share
/etc/profile.d/nix.sh
/nix/var
/nix/store
%config
/etc/nix