Name: nix Version: 0.15 Release: 1%{?dist} Summary: Purely functional package manager Group: System Environment/Base License: LGPLv2 URL: http://nixos.org/ Source0: http://hydra.nixos.org/build/326788/download/4/nix-0.15.tar.bz2 Source1: nix-worker.init BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: libaterm-devel = 2.4.2 BuildRequires: bzip2-devel BuildRequires: openssl-devel BuildRequires: libxslt BuildRequires: libxml2 Requires(pre): shadow-utils Requires(post): chkconfig Requires(preun): chkconfig Requires(preun): initscripts Requires(postun): initscripts %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. %package devel Summary: Development files for %{name} Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel The %{name}-devel package contains libraries and header files for developing applications that use %{name}. %prep %setup -q -n %{name}-%{version} %{__cat} << \EOF > %{name}-req #!/bin/sh %{__perl_requires} $* |\ %{__sed} -e '/perl(readmanifest)/d' \ -e '/perl(ssh)/d' EOF %global __perl_requires %{_builddir}/%{name}-%{version}/%{name}-req %{__chmod} +x %{__perl_requires} # End Of Workaround %build %configure --prefix=%{_prefix} \ --disable-static --enable-shared \ --with-aterm=%{_prefix} \ --with-bzip2=%{_prefix} \ --disable-old-db-compat \ --docdir=%{_docdir}/%{name}-%{version} \ --enable-setuid \ --with-nix-user=%{name} \ --with-nix-group=%{name} \ --sysconfdir=%{_sysconfdir} %{__make} %{?_smp_mflags} %install %{__rm} -rf $RPM_BUILD_ROOT %{__make} install DESTDIR=$RPM_BUILD_ROOT find $RPM_BUILD_ROOT -name \*.la -exec %{__rm} -f {} ';' %{__ln_s} -nf ../profiles \ $RPM_BUILD_ROOT%{_localstatedir}/%{name}/gcroots/profiles %{__ln_s} -nf ../manifests \ $RPM_BUILD_ROOT%{_localstatedir}/%{name}/gcroots/manifests %{__mkdir_p} $RPM_BUILD_ROOT%{_localstatedir}/%{name}/gcroots/per-user %{__mkdir_p} $RPM_BUILD_ROOT%{_localstatedir}/%{name}/profiles/per-user %{__install} -m644 AUTHORS COPYING \ ${RPM_BUILD_ROOT}%{_docdir}/%{name}-%{version}/ # nix-worker init script %{__mkdir_p} ${RPM_BUILD_ROOT}%{_initrddir} %{__install} -m755 %{S:1} ${RPM_BUILD_ROOT}%{_initrddir}/nix-worker %{__cat} > ${RPM_BUILD_ROOT}%{_sysconfdir}/nix-setuid.conf << EOF nix nixbld EOF %{__sed} -i -e 's/#build-users-group =/build-users-group = nixbld/' \ ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/%{name}.conf cat >> ${RPM_BUILD_ROOT}%{_sysconfdir}/profile.d/%{name}.sh << EOF export NIX_REMOTE="daemon" EOF %clean %{__rm} -rf $RPM_BUILD_ROOT %check %{__make} check %pre getent group %{name} >/dev/null || groupadd -r %{name} getent passwd %{name} >/dev/null || \ useradd -r -g %{name} -d %{_localstatedir}/%{name} -s /sbin/nologin \ -c "nix user" %{name} getent group %{name}bld >/dev/null || groupadd -r %{name}bld for n in $(seq 1 10) do getent passwd %{name}bld${n} >/dev/null || \ useradd -r -g nobody -G %{name}bld -d /dev/null -s /sbin/nologin \ -c "nix build user ${n}" %{name}bld${n} done exit 0 %post /sbin/chkconfig --add %{name}-worker %preun if [ $1 = 0 ] ; then /sbin/service %{name}-worker stop >/dev/null 2>&1 /sbin/chkconfig --del %{name}-worker fi %postun if [ "$1" -ge "1" ] ; then /sbin/service %{name}-worker condrestart >/dev/null 2>&1 || : fi %files %defattr(-,root,root,-) %{_bindir}/* %{_libexecdir}/%{name} %attr(4755,root,root) %{_libexecdir}/nix-setuid-helper %{_libexecdir}/bsdiff %{_libexecdir}/bspatch %{_datadir}/%{name} %{_datadir}/emacs/site-lisp %dir %{_libdir}/%{name} %{_libdir}/%{name}/*.so.* %attr(-,nix,nix) %{_localstatedir}/log/%{name} %{_mandir}/man1/* %{_mandir}/man8/* %{_docdir}/%{name}-%{version} %attr(0644,root,root) %{_sysconfdir}/profile.d/%{name}.sh %config(noreplace) %{_sysconfdir}/%{name} %config(noreplace) %{_sysconfdir}/nix-setuid.conf %{_initrddir}/nix-worker %dir %attr(-,nix,root) %{_localstatedir}/%{name} %dir %attr(-,nix,root) %{_localstatedir}/%{name}/gcroots %dir %attr(-,nix,root) %{_localstatedir}/%{name}/profiles %attr(1777,nix,root) %{_localstatedir}/%{name}/gcroots/per-user %{_localstatedir}/%{name}/gcroots/manifests %{_localstatedir}/%{name}/gcroots/profiles %attr(-,nix,root) %{_localstatedir}/%{name}/db %attr(-,nix,root) %{_localstatedir}/%{name}/manifests %attr(-,nix,root) %{_localstatedir}/%{name}/temproots %attr(-,nix,root) %{_localstatedir}/%{name}/userpool %dir /%{name} %attr(1775,nix,nixbld) /%{name}/store %files devel %defattr(-,root,root,-) %doc AUTHORS COPYING NEWS README %{_includedir}/%{name} %{_libdir}/%{name}/*.so %changelog * Mon Mar 22 2010 Alexander Kahl - 0.15-1 - update to 0.15 * Mon Mar 30 2009 Alexander Kahl - 0.13-0.1.pre14751 - latest prerelease * Fri Mar 27 2009 Alexander Kahl - 0.12-3 - multi-user setup * Thu Mar 26 2009 Alexander Kahl - 0.12-2 - handle documentation properly * Mon Mar 23 2009 Alexander Kahl - 0.12-1 - initial release