nix-gh/nix.spec.in

91 lines
2.2 KiB
RPMSpec
Raw Normal View History

2012-05-17 05:56:29 +02:00
%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.
2012-05-17 05:56:29 +02:00
%global nix_user_uid ""
%global nix_group_gid ""
Summary: The Nix software deployment system
Name: nix
2004-01-02 17:04:53 +01:00
Version: @version@
Release: 1
License: GPL
Group: Software Deployment
2008-08-29 15:59:03 +02:00
URL: http://nixos.org/
2005-05-07 17:45:38 +02:00
Source0: %{name}-@version@.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
Prefix: /usr
Requires: /usr/bin/perl
Requires: curl
Requires: perl-DBD-SQLite
Requires: perl-devel
2012-03-19 14:30:59 +01:00
Requires: bzip2
Requires: bzip2-libs
Requires: sqlite
BuildRequires: bzip2-devel
BuildRequires: sqlite-devel
# Hack to make that shitty RPM scanning hack shut up.
2012-03-19 14:30:59 +01:00
Provides: perl(Nix::SSH)
%description
2007-03-21 13:39:55 +01:00
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
2008-11-20 17:10:55 +01:00
./configure --prefix=%{_prefix} --sysconfdir=/etc $extraFlags
make
make check
%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
2008-11-20 17:42:52 +01:00
rm $RPM_BUILD_ROOT/etc/nix/nix.conf
2004-01-19 10:01:28 +01:00
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
2005-07-25 12:10:24 +02:00
%{_prefix}/lib
%{_prefix}/libexec
2006-09-05 13:34:50 +02:00
%{_prefix}/include
%{_prefix}/share
2008-11-20 17:28:04 +01:00
/etc/profile.d/nix.sh
/nix/var
/nix/store
%config
2008-11-20 17:28:04 +01:00
/etc/nix