From 94175e978a87a79f3362879898dc1cf7d08d7791 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 30 Dec 2003 20:09:00 +0000 Subject: [PATCH] * RPM spec file. * Respect DESTDIR variable. --- Makefile.am | 5 ++++- corepkgs/buildenv/Makefile.am | 8 +++---- corepkgs/fetchurl/Makefile.am | 8 +++---- corepkgs/nar/Makefile.am | 12 +++++----- doc/manual/Makefile.am | 6 ++--- nix.spec | 41 +++++++++++++++++++++++++++++++++++ scripts/Makefile.am | 12 +++++----- src/nix-store/Makefile.am | 16 +++++++------- 8 files changed, 76 insertions(+), 32 deletions(-) create mode 100644 nix.spec diff --git a/Makefile.am b/Makefile.am index f069e454a..f9fc8695f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,3 +1,6 @@ SUBDIRS = externals src scripts corepkgs doc -EXTRA_DIST = substitute.mk +EXTRA_DIST = substitute.mk nix.spec + +rpm: dist + rpm -ta $(distdir).tar.gz diff --git a/corepkgs/buildenv/Makefile.am b/corepkgs/buildenv/Makefile.am index 74c39199f..f6a14600f 100644 --- a/corepkgs/buildenv/Makefile.am +++ b/corepkgs/buildenv/Makefile.am @@ -1,8 +1,8 @@ install-exec-local: - $(INSTALL) -d $(datadir)/nix/corepkgs - $(INSTALL) -d $(datadir)/nix/corepkgs/buildenv - $(INSTALL_DATA) default.nix $(datadir)/nix/corepkgs/buildenv - $(INSTALL_PROGRAM) builder.pl $(datadir)/nix/corepkgs/buildenv + $(INSTALL) -d $(DESTDIR)$(datadir)/nix/corepkgs + $(INSTALL) -d $(DESTDIR)$(datadir)/nix/corepkgs/buildenv + $(INSTALL_DATA) default.nix $(DESTDIR)$(datadir)/nix/corepkgs/buildenv + $(INSTALL_PROGRAM) builder.pl $(DESTDIR)$(datadir)/nix/corepkgs/buildenv include ../../substitute.mk diff --git a/corepkgs/fetchurl/Makefile.am b/corepkgs/fetchurl/Makefile.am index 270bf0142..3cb63e0ce 100644 --- a/corepkgs/fetchurl/Makefile.am +++ b/corepkgs/fetchurl/Makefile.am @@ -1,10 +1,10 @@ all-local: builder.sh install-exec-local: - $(INSTALL) -d $(datadir)/nix/corepkgs - $(INSTALL) -d $(datadir)/nix/corepkgs/fetchurl - $(INSTALL_DATA) default.nix $(datadir)/nix/corepkgs/fetchurl - $(INSTALL_PROGRAM) builder.sh $(datadir)/nix/corepkgs/fetchurl + $(INSTALL) -d $(DESTDIR)$(datadir)/nix/corepkgs + $(INSTALL) -d $(DESTDIR)$(datadir)/nix/corepkgs/fetchurl + $(INSTALL_DATA) default.nix $(DESTDIR)$(datadir)/nix/corepkgs/fetchurl + $(INSTALL_PROGRAM) builder.sh $(DESTDIR)$(datadir)/nix/corepkgs/fetchurl include ../../substitute.mk diff --git a/corepkgs/nar/Makefile.am b/corepkgs/nar/Makefile.am index 3e0aab869..8fb879ae1 100644 --- a/corepkgs/nar/Makefile.am +++ b/corepkgs/nar/Makefile.am @@ -1,12 +1,12 @@ all-local: nar.sh unnar.sh install-exec-local: - $(INSTALL) -d $(datadir)/nix/corepkgs - $(INSTALL) -d $(datadir)/nix/corepkgs/nar - $(INSTALL_DATA) nar.nix $(datadir)/nix/corepkgs/nar - $(INSTALL_PROGRAM) nar.sh $(datadir)/nix/corepkgs/nar - $(INSTALL_DATA) unnar.nix $(datadir)/nix/corepkgs/nar - $(INSTALL_PROGRAM) unnar.sh $(datadir)/nix/corepkgs/nar + $(INSTALL) -d $(DESTDIR)$(datadir)/nix/corepkgs + $(INSTALL) -d $(DESTDIR)$(datadir)/nix/corepkgs/nar + $(INSTALL_DATA) nar.nix $(DESTDIR)$(datadir)/nix/corepkgs/nar + $(INSTALL_PROGRAM) nar.sh $(DESTDIR)$(datadir)/nix/corepkgs/nar + $(INSTALL_DATA) unnar.nix $(DESTDIR)$(datadir)/nix/corepkgs/nar + $(INSTALL_PROGRAM) unnar.sh $(DESTDIR)$(datadir)/nix/corepkgs/nar include ../../substitute.mk diff --git a/doc/manual/Makefile.am b/doc/manual/Makefile.am index 46c79ae3b..749eb07c6 100644 --- a/doc/manual/Makefile.am +++ b/doc/manual/Makefile.am @@ -26,9 +26,9 @@ book.html: $(SOURCES) book.is-valid all-local: book.html install-data-local: book.html - $(INSTALL) -d $(datadir)/nix/manual - $(INSTALL_DATA) book.html $(datadir)/nix/manual - $(INSTALL_DATA) style.css $(datadir)/nix/manual + $(INSTALL) -d $(DESTDIR)$(datadir)/nix/manual + $(INSTALL_DATA) book.html $(DESTDIR)$(datadir)/nix/manual + $(INSTALL_DATA) style.css $(DESTDIR)$(datadir)/nix/manual EXTRA_DIST = $(SOURCES) book.html book.is-valid $(MANS) diff --git a/nix.spec b/nix.spec new file mode 100644 index 000000000..9d459034b --- /dev/null +++ b/nix.spec @@ -0,0 +1,41 @@ +Summary: The Nix software deployment system +Name: nix +Version: 0.5 +Release: 1 +License: GPL +Group: WeetNiet +URL: http://www.cs.uu.nl/groups/ST/twiki/bin/view/Trace/NixDeploymentSystem +Source0: %{name}-%{version}.tar.gz +BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot +%define _prefix /nix +Prefix: %{_prefix} + +%description + +Nix is a software deployment system. + +%prep +%setup -q + +%build +./configure --prefix=%{_prefix} +make + +%install +rm -rf $RPM_BUILD_ROOT +make DESTDIR=$RPM_BUILD_ROOT install + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root) +%{_prefix}/bin +%{_prefix}/libexec +%{_prefix}/var +%{_prefix}/share +%{_prefix}/man +%config +%{_prefix}/etc +#%doc +#%{_prefix}/share/nix/manual diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 1662e99c1..65d9a4fd8 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -7,13 +7,13 @@ noinst_SCRIPTS = nix-profile.sh nix-pull nix-push: readmanifest.pm install-exec-local: readmanifest.pm - $(INSTALL) -d $(sysconfdir)/profile.d - $(INSTALL_PROGRAM) nix-profile.sh $(sysconfdir)/profile.d/nix.sh - $(INSTALL) -d $(libexecdir)/nix - $(INSTALL_DATA) readmanifest.pm $(libexecdir)/nix - $(INSTALL) -d $(sysconfdir)/nix + $(INSTALL) -d $(DESTDIR)$(sysconfdir)/profile.d + $(INSTALL_PROGRAM) nix-profile.sh $(DESTDIR)$(sysconfdir)/profile.d/nix.sh + $(INSTALL) -d $(DESTDIR)$(libexecdir)/nix + $(INSTALL_DATA) readmanifest.pm $(DESTDIR)$(libexecdir)/nix + $(INSTALL) -d $(DESTDIR)$(sysconfdir)/nix # !!! don't overwrite local modifications - $(INSTALL_DATA) prebuilts.conf $(sysconfdir)/nix/prebuilts.conf + $(INSTALL_DATA) prebuilts.conf $(DESTDIR)$(sysconfdir)/nix/prebuilts.conf include ../substitute.mk diff --git a/src/nix-store/Makefile.am b/src/nix-store/Makefile.am index 80e598742..74cf814a7 100644 --- a/src/nix-store/Makefile.am +++ b/src/nix-store/Makefile.am @@ -13,11 +13,11 @@ AM_CXXFLAGS = \ -I.. -I../../externals/inst/include -I../libutil -I../libstore -I../libmain install-data-local: - $(INSTALL) -d $(localstatedir)/nix - $(INSTALL) -d $(localstatedir)/nix/db - $(INSTALL) -d $(localstatedir)/nix/links - rm -f $(prefix)/current - ln -sf $(localstatedir)/nix/links/current $(prefix)/current - $(INSTALL) -d $(localstatedir)/log/nix - $(INSTALL) -d $(prefix)/store - $(bindir)/nix-store --init + $(INSTALL) -d $(DESTDIR)$(localstatedir)/nix + $(INSTALL) -d $(DESTDIR)$(localstatedir)/nix/db + $(INSTALL) -d $(DESTDIR)$(localstatedir)/nix/links + rm -f $(DESTDIR)$(prefix)/current + ln -sf $(localstatedir)/nix/links/current $(DESTDIR)$(prefix)/current + $(INSTALL) -d $(DESTDIR)$(localstatedir)/log/nix + $(INSTALL) -d $(DESTDIR)$(prefix)/store +# $(bindir)/nix-store --init