]> thyrsus.com Git - bluemoon.git/commitdiff
Improved RPM machinery.
authorEric S. Raymond <esr@thyrsus.com>
Mon, 29 Dec 2003 05:40:29 +0000 (05:40 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Mon, 29 Dec 2003 05:40:29 +0000 (05:40 +0000)
Makefile
bluemoon.spec

index 5bd5e3d86185be2384f07af8eea4b5671cd09a43..379831427c7fd2590bf28c0ec693a6aa4265f6dd 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,8 @@
 # Makefile for bluemoon, the Blue Moon solitaire game
 
-VERS=2.7
+VERS=$(shell sed <bluemoon.spec -n -e '/Version: \(.*\)/s//\1/p')
 
-SOURCES = READ.ME COPYING Makefile bluemoon.c bluemoon.xml *.spec
+SOURCES = README COPYING Makefile bluemoon.c bluemoon.xml *.spec
 CFLAGS=-O
 
 bluemoon: bluemoon.c
@@ -28,9 +28,3 @@ uninstall:
        rm -f /usr/bin/bluemoon /usr/share/man/man6/bluemoon.6
 
 dist: bluemoon-$(VERS).tar.gz
-
-RPMROOT=/usr/src/redhat
-rpm: dist
-       rpmbuild --define 'myversion $(VERS)' -ta bluemoon-$(VERS).tar.gz
-       cp $(RPMROOT)/RPMS/*/bluemoon-$(VERS)*.rpm .
-       cp $(RPMROOT)/SRPMS/bluemoon-$(VERS)*.src.rpm .
index 47c5d74bcc8f2c1dfb17c1a064d3e806227efca7..5e47c25b30ee42ebaca8325b3252e9411d89d19d 100644 (file)
@@ -1,12 +1,12 @@
 Name: bluemoon
 Summary: Blue Moon solitaire (text mode)
-Version: %{myversion}
+Version: 2.8
 Release: 1
 URL: http://www.catb.org/~esr/bluemoon/
 Source0: %{name}-%{version}.tar.gz
 License: GPL
 Group: Games
-%undefine __check_files
+BuildRoot: %{_tmppath}/%{name}-root
 
 %description
    This 52-card solitaire starts with  the entire deck shuffled and dealt
@@ -22,20 +22,31 @@ followed by a space, followed by enough cards to make a row of 14.
 deals. A good score is 1-3 deals, 4-7 is average, 8 or more is poor.
 
 %prep
-%setup
+%setup -q
 
 %build
 make
+make bluemoon.6
 
 %install
-make install
+[ ! -z "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf "$RPM_BUILD_ROOT"
+mkdir -p "$RPM_BUILD_ROOT"/usr/bin
+mkdir -p "$RPM_BUILD_ROOT"/usr/share/man/man6/
+cp bluemoon "$RPM_BUILD_ROOT"/usr/bin
+cp bluemoon.6 "$RPM_BUILD_ROOT"/usr/share/man/man6/
 
+%clean
+[ ! -z "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf "$RPM_BUILD_ROOT"
 %files
-/usr/share/man/man6/bluemoon.6
-/usr/bin/bluemoon
-%doc READ.ME COPYING
+%defattr(-,root,root,-)
+%{_mandir}/man6/bluemoon.6*
+%{_bindir}/bluemoon
+%doc README COPYING
 
 %changelog
-* Wed Dec 24 2003 Eric S. Raymond <esr@snark.thyrsus.com> 
+* Mon Dec 29 2003 Eric S. Raymond <esr@snark.thyrsus.com> 2.8-1
+- Source RPMs no longer require --define myversion.
+
+* Wed Dec 24 2003 Eric S. Raymond <esr@snark.thyrsus.com> 2.7-1
 - Fixed build machinery to use rpmbuild.