]> thyrsus.com Git - ascii.git/commitdiff
Build rpms with buildrpms.
authorEric S. Raymond <esr@thyrsus.com>
Mon, 29 Dec 2003 04:33:35 +0000 (04:33 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Mon, 29 Dec 2003 04:33:35 +0000 (04:33 +0000)
Makefile
ascii.spec

index f214b2818199cb83ecc26092358e1b91deb51070..95eb9632a9b2ed89abecfdba96ae3fdbdce80977 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 # ascii -- interactive ASCII reference
 
-VERS=3.4
+VERS=$(shell sed <ascii.spec -n -e '/Version: \(.*\)/s//\1/p')
 
 CFLAGS = -O
 
@@ -19,7 +19,7 @@ ascii.1: ascii.xml
 clean:
        rm -f ascii ascii.o splashscreen.h ascii.1 *.rpm *.tar.gz
 
-install: ascii.1
+install: ascii ascii.1
        cp ascii /usr/bin/ascii
        cp ascii.1 /usr/share/man/man1
 
@@ -36,9 +36,3 @@ ascii-$(VERS).tar.gz: $(SOURCES) ascii.1
        @(cd ..; rm ascii-$(VERS))
 
 dist: ascii-$(VERS).tar.gz
-
-RPMROOT=/usr/src/redhat
-rpm: dist
-       rpmbuild --define 'myversion $(VERS)' -ta ascii-$(VERS).tar.gz
-       cp $(RPMROOT)/RPMS/*/ascii-$(VERS)*.rpm .
-       cp $(RPMROOT)/SRPMS/ascii-$(VERS)*.src.rpm .
index ea66b6b6048cb6605d4cb2ac3153e90577990d65..8488867be836a9ed67fb53123ade198fe14df8ff 100644 (file)
@@ -1,12 +1,13 @@
 Name: ascii
-Version: %{myversion}
-Release: 1
+Version: 3.4
+Release: 2
 URL: http://www.catb.org/~esr/ascii/
 Source0: %{name}-%{version}.tar.gz
 License: GPL
 Group: Utilities/Text
 Summary: interactive ASCII name and synonym chart
 Packager: Eric S. Raymond <esr@thyrsus.com>
+BuildRoot: %{_tmppath}/%{name}-root
 
 %description
 The ascii utility provides easy conversion between various byte representations
@@ -17,18 +18,24 @@ Given any one on the command line, it will try to display all others.  Called
 with no arguments it displays a handy small ASCII chart.
 
 %prep
-%setup
+%setup -q
 
 %build
-make ascii ascii.1
+make
+make ascii.1
 
 %install
-rm -f /usr/bin/ascii
-cp ascii %{_bindir}
-cp ascii.1 %{_mandir}/man1/ascii.1
+[ ! -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/man1/
+cp ascii "$RPM_BUILD_ROOT"/usr/bin
+cp ascii.1 "$RPM_BUILD_ROOT"/usr/share/man/man1/
 
+%clean
+[ ! -z "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf "$RPM_BUILD_ROOT"
 %files
-%{_mandir}/man1/ascii.1
+%defattr(-,root,root,-)
+%{_mandir}/man1/ascii.1*
 %{_bindir}/ascii
 %doc README COPYING
 %undefine __check_files