about summary refs log blame commit diff
path: root/nix.spec.in
blob: 9b16c79f1af03a0be5979d23c05fa4dfe74d59e2 (plain) (tree)
1
2
3
4
5
6
7
8
9

                        
 


                                                           
 
                                           
                  
            
                                            
                                  

                                                   
                       
              
 

                                                               
            
                                        



         









                                                              
    
          


                                    
                                              
                                              


                      








                                                               
      
                      
              
              
                  
                  

                
                


                            
%define enable_setuid ""
%define nix_user "nix"
%define nix_group "nix"

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

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.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
%define _prefix /nix
Prefix: %{_prefix}
Requires: /usr/bin/perl
Requires: curl

# Hack to make that shitty RPM scanning hack shut up.
Provides: perl(readmanifest)
                                                               
%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
rm $RPM_BUILD_ROOT/%{_prefix}/etc/nix/nix.conf
strip $RPM_BUILD_ROOT/%{_prefix}/bin/* || true

%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}/var
%{_prefix}/share
%{_prefix}/man
%{_prefix}/store
%config
%{_prefix}/etc
#%doc
#%{_prefix}/share/nix/manual