2017-02-21 13:26:23 +00:00
|
|
|
%undefine _hardened_build
|
|
|
|
|
2012-05-27 10:04:16 +00:00
|
|
|
%global nixbld_user "nix-builder-"
|
2016-07-01 03:18:21 +00:00
|
|
|
%global nixbld_group "nixbld"
|
2004-09-06 08:17:55 +00:00
|
|
|
|
2003-12-30 20:09:00 +00:00
|
|
|
Summary: The Nix software deployment system
|
|
|
|
Name: nix
|
2014-02-04 10:08:41 +00:00
|
|
|
Version: @PACKAGE_VERSION@
|
2012-05-27 10:04:16 +00:00
|
|
|
Release: 2%{?dist}
|
|
|
|
License: LGPLv2+
|
2016-07-01 03:51:57 +00:00
|
|
|
%if 0%{?rhel} && 0%{?rhel} < 7
|
2012-05-17 04:04:56 +00:00
|
|
|
Group: Applications/System
|
|
|
|
%endif
|
2008-08-29 13:59:03 +00:00
|
|
|
URL: http://nixos.org/
|
2016-08-30 11:38:18 +00:00
|
|
|
Source0: %{name}-%{version}.tar.bz2
|
2012-05-17 04:04:56 +00:00
|
|
|
%if 0%{?el5}
|
2012-05-27 10:04:16 +00:00
|
|
|
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
|
2012-05-17 04:04:56 +00:00
|
|
|
%endif
|
2005-07-12 16:08:10 +00:00
|
|
|
Requires: curl
|
2012-03-19 13:30:59 +00:00
|
|
|
Requires: bzip2
|
2013-05-14 13:10:14 +00:00
|
|
|
Requires: gzip
|
2012-12-05 11:17:12 +00:00
|
|
|
Requires: xz
|
2012-03-19 13:30:59 +00:00
|
|
|
BuildRequires: bzip2-devel
|
|
|
|
BuildRequires: sqlite-devel
|
2015-08-25 05:25:24 +00:00
|
|
|
BuildRequires: libcurl-devel
|
2003-12-30 20:09:00 +00:00
|
|
|
|
2004-09-08 12:07:19 +00:00
|
|
|
# Hack to make that shitty RPM scanning hack shut up.
|
2012-03-19 13:30:59 +00:00
|
|
|
Provides: perl(Nix::SSH)
|
2014-02-04 10:08:41 +00:00
|
|
|
|
2003-12-30 20:09:00 +00:00
|
|
|
%description
|
2007-03-21 12:39:55 +00: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.
|
2003-12-30 20:09:00 +00:00
|
|
|
|
2012-05-27 10:04:16 +00:00
|
|
|
%package devel
|
|
|
|
Summary: Development files for %{name}
|
2016-07-01 03:51:57 +00:00
|
|
|
%if 0%{?rhel} && 0%{?rhel} < 7
|
2012-05-27 10:04:16 +00:00
|
|
|
Group: Development/Libraries
|
|
|
|
%endif
|
|
|
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
|
|
|
|
|
|
|
%description devel
|
|
|
|
The %{name}-devel package contains libraries and header files for
|
|
|
|
developing applications that use %{name}.
|
|
|
|
|
|
|
|
|
|
|
|
%package doc
|
|
|
|
Summary: Documentation files for %{name}
|
2016-07-01 03:51:57 +00:00
|
|
|
%if 0%{?rhel} && 0%{?rhel} < 7
|
2012-05-27 10:04:16 +00:00
|
|
|
Group: Documentation
|
|
|
|
%endif
|
|
|
|
BuildArch: noarch
|
|
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
|
|
|
|
%description doc
|
|
|
|
The %{name}-doc package contains documentation files for %{name}.
|
|
|
|
|
|
|
|
|
|
|
|
%package -n emacs-%{name}
|
|
|
|
Summary: Nix mode for Emacs
|
2016-07-01 03:51:57 +00:00
|
|
|
%if 0%{?rhel} && 0%{?rhel} < 7
|
2012-05-27 10:04:16 +00:00
|
|
|
Group: Applications/Editors
|
|
|
|
%endif
|
|
|
|
BuildArch: noarch
|
|
|
|
BuildRequires: emacs
|
|
|
|
Requires: emacs(bin) >= %{_emacs_version}
|
|
|
|
|
|
|
|
%description -n emacs-%{name}
|
|
|
|
This package provides a major mode for editing Nix expressions.
|
|
|
|
|
|
|
|
%package -n emacs-%{name}-el
|
|
|
|
Summary: Elisp source files for emacs-%{name}
|
2016-07-01 03:51:57 +00:00
|
|
|
%if 0%{?rhel} && 0%{?rhel} < 7
|
2012-05-27 10:04:16 +00:00
|
|
|
Group: Applications/Editors
|
|
|
|
%endif
|
|
|
|
BuildArch: noarch
|
|
|
|
Requires: emacs-%{name} = %{version}-%{release}
|
|
|
|
|
|
|
|
%description -n emacs-%{name}-el
|
|
|
|
This package contains the elisp source file for the Nix major mode for
|
|
|
|
GNU Emacs. You do not need to install this package to run Nix. Install
|
|
|
|
the emacs-%{name} package to edit Nix expressions with GNU Emacs.
|
|
|
|
|
|
|
|
|
2003-12-30 20:09:00 +00:00
|
|
|
%prep
|
|
|
|
%setup -q
|
2012-05-27 10:04:16 +00:00
|
|
|
# Install Perl modules to vendor_perl
|
|
|
|
# configure.ac need to be changed to make this global; however, this will
|
|
|
|
# also affect NixOS. Use discretion.
|
|
|
|
%{__sed} -i 's|perl5/site_perl/$perlversion/$perlarchname|perl5/vendor_perl|' \
|
|
|
|
configure
|
|
|
|
|
2003-12-30 20:09:00 +00:00
|
|
|
|
|
|
|
%build
|
2004-09-06 08:17:55 +00:00
|
|
|
extraFlags=
|
2012-05-27 10:04:16 +00:00
|
|
|
# - override docdir so large documentation files are owned by the
|
|
|
|
# -doc subpackage
|
|
|
|
# - set localstatedir by hand to the preferred nix value
|
|
|
|
%configure --localstatedir=/nix/var \
|
|
|
|
--docdir=%{_defaultdocdir}/%{name}-doc-%{version} \
|
|
|
|
$extraFlags
|
2017-02-21 13:52:36 +00:00
|
|
|
make -j$NIX_BUILD_CORES -l$NIX_BUILD_CORES
|
2012-05-27 10:04:16 +00:00
|
|
|
%{_emacs_bytecompile} misc/emacs/nix-mode.el
|
|
|
|
|
2003-12-30 20:09:00 +00:00
|
|
|
|
|
|
|
%install
|
2012-05-17 04:04:56 +00:00
|
|
|
%if 0%{?el5}
|
2003-12-30 20:09:00 +00:00
|
|
|
rm -rf $RPM_BUILD_ROOT
|
2012-05-17 04:04:56 +00:00
|
|
|
%endif
|
2003-12-30 20:09:00 +00:00
|
|
|
make DESTDIR=$RPM_BUILD_ROOT install
|
2012-05-27 10:04:16 +00:00
|
|
|
|
|
|
|
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
|
|
|
|
|
2016-07-01 03:56:09 +00:00
|
|
|
# make the store
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/nix/store
|
|
|
|
chmod 1775 $RPM_BUILD_ROOT/nix/store
|
|
|
|
|
2012-05-27 10:04:16 +00:00
|
|
|
# make per-user directories
|
|
|
|
for d in profiles gcroots;
|
|
|
|
do
|
2014-02-07 16:34:39 +00:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/nix/var/nix/$d/per-user
|
2012-05-27 10:04:16 +00:00
|
|
|
chmod 1777 $RPM_BUILD_ROOT/nix/var/nix/$d/per-user
|
|
|
|
done
|
|
|
|
|
|
|
|
# fix permission of nix profile
|
|
|
|
# (until this is fixed in the relevant Makefile)
|
|
|
|
chmod -x $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/nix.sh
|
|
|
|
|
|
|
|
# Copy the byte-compiled mode file by hand
|
|
|
|
cp -p misc/emacs/nix-mode.elc $RPM_BUILD_ROOT%{_emacs_sitelispdir}/
|
|
|
|
|
|
|
|
# we ship this file in the base package
|
2014-02-07 16:34:39 +00:00
|
|
|
rm -f $RPM_BUILD_ROOT%{_defaultdocdir}/%{name}-doc-%{version}/README
|
2012-05-27 10:04:16 +00:00
|
|
|
|
2014-05-02 17:04:10 +00:00
|
|
|
# Get rid of Upstart job.
|
|
|
|
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/init
|
|
|
|
|
2012-05-17 04:04:56 +00:00
|
|
|
|
2003-12-30 20:09:00 +00:00
|
|
|
%clean
|
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
2012-05-27 10:04:16 +00:00
|
|
|
|
2004-09-06 10:05:21 +00:00
|
|
|
%pre
|
2012-05-27 10:04:16 +00:00
|
|
|
getent group %{nixbld_group} >/dev/null || groupadd -r %{nixbld_group}
|
|
|
|
for i in $(seq 10);
|
|
|
|
do
|
|
|
|
getent passwd %{nixbld_user}$i >/dev/null || \
|
|
|
|
useradd -r -g %{nixbld_group} -G %{nixbld_group} -d /var/empty \
|
|
|
|
-s %{_sbindir}/nologin \
|
|
|
|
-c "Nix build user $i" %{nixbld_user}$i
|
|
|
|
done
|
|
|
|
|
|
|
|
%post
|
|
|
|
chgrp %{nixbld_group} /nix/store
|
2016-07-01 04:07:58 +00:00
|
|
|
%if ! 0%{?rhel} || 0%{?rhel} >= 7
|
2012-05-27 10:34:49 +00:00
|
|
|
# Enable and start Nix worker
|
2014-04-08 11:51:34 +00:00
|
|
|
systemctl enable nix-daemon.socket nix-daemon.service
|
|
|
|
systemctl start nix-daemon.socket
|
2012-05-27 10:34:49 +00:00
|
|
|
%endif
|
2004-09-06 10:05:21 +00:00
|
|
|
|
2003-12-30 20:09:00 +00:00
|
|
|
%files
|
2016-03-15 11:15:15 +00:00
|
|
|
%{_bindir}/nix*
|
2014-02-07 16:34:39 +00:00
|
|
|
%{_libdir}/*.so
|
2012-05-27 10:04:16 +00:00
|
|
|
%{perl_vendorarch}/*
|
|
|
|
%exclude %dir %{perl_vendorarch}/auto/
|
|
|
|
%{_prefix}/libexec/*
|
2016-07-01 04:07:58 +00:00
|
|
|
%if ! 0%{?rhel} || 0%{?rhel} >= 7
|
2014-04-08 11:51:34 +00:00
|
|
|
%{_prefix}/lib/systemd/system/nix-daemon.socket
|
2012-10-03 21:57:20 +00:00
|
|
|
%{_prefix}/lib/systemd/system/nix-daemon.service
|
2012-05-27 10:34:49 +00:00
|
|
|
%endif
|
2012-05-27 10:04:16 +00:00
|
|
|
%{_datadir}/emacs/site-lisp/nix-mode.el
|
|
|
|
%{_datadir}/nix
|
2012-07-09 17:16:09 +00:00
|
|
|
%{_mandir}/man1/*.1*
|
|
|
|
%{_mandir}/man5/*.5*
|
|
|
|
%{_mandir}/man8/*.8*
|
2012-05-27 10:04:16 +00:00
|
|
|
%config(noreplace) %{_sysconfdir}/profile.d/nix.sh
|
|
|
|
/nix
|
|
|
|
|
|
|
|
%files devel
|
|
|
|
%{_includedir}/nix
|
2014-09-18 13:42:01 +00:00
|
|
|
%{_prefix}/lib/pkgconfig/*.pc
|
2012-05-27 10:04:16 +00:00
|
|
|
|
|
|
|
%files doc
|
|
|
|
%docdir %{_defaultdocdir}/%{name}-doc-%{version}
|
|
|
|
%{_defaultdocdir}/%{name}-doc-%{version}
|
|
|
|
|
|
|
|
%files -n emacs-%{name}
|
|
|
|
%{_emacs_sitelispdir}/*.elc
|
|
|
|
#{_emacs_sitestartdir}/*.el
|
|
|
|
|
|
|
|
%files -n emacs-%{name}-el
|
|
|
|
%{_emacs_sitelispdir}/*.el
|