# Makefile for the cstrings tool by Eric S. Raymond
# Note: When the version changes, you also have to change
-# * the name of the containing directory
-# * the RPM spec file
-V=2.0
+# the RPM spec file and the lsm.
+VERS=2.1
CFLAGS=-O
LDFLAGS=-s
clean:
rm -f lex.yy.c cstrings cstrings.c *~ cstrings.shar cstrings.tar.gz
-
-SOURCES= cstrings.1 Makefile cstrings.l cstrings.lsm cstrings.spec
-
-cstrings.tar: $(SOURCES)
- (cd ..; tar -cvf cstrings-$(V)/cstrings.tar `echo $(SOURCES) | sed "/\(^\| \)/s// cstrings-$(V)\//g"`)
-cstrings.tar.gz: cstrings.tar
- gzip -f cstrings.tar
-
-cstrings.shar: $(SOURCES)
- shar $(SOURCES) >cstrings.shar
-
-rpm: cstrings.tar.gz
- cp cstrings.tar.gz /usr/src/SOURCES/cstrings-$(V).tar.gz
- cp cstrings.spec /usr/src/SPECS/cstrings-$(V)-1.spec
- rpm -ba cstrings-$(V)-1.spec
+ rm -f *.rpm cstrings-*.tar.gz
+
+SOURCES = READ.ME cstrings.1 Makefile cstrings.l cstrings.lsm cstrings.spec
+
+cstrings-$(VERS).tar.gz: $(SOURCES)
+ @ls $(SOURCES) | sed s:^:cstrings-$(VERS)/: >MANIFEST
+ @(cd ..; ln -s cstrings cstrings-$(VERS))
+ (cd ..; tar -czvf cstrings/cstrings-$(VERS).tar.gz `cat cstrings/MANIFEST`)
+ @(cd ..; rm cstrings-$(VERS))
+
+cstrings-$(VERS).shar:
+ shar $(SOURCES) >cstrings-$(VERS).shar
+
+dist: cstrings-$(VERS).tar.gz
+
+RPMROOT=/usr/src/redhat
+RPM = rpm
+RPMFLAGS = -ba
+rpm: dist
+ cp cstrings-$(VERS).tar.gz $(RPMROOT)/SOURCES;
+ cp cstrings.spec $(RPMROOT)/SPECS
+ cd $(RPMROOT)/SPECS; $(RPM) $(RPMFLAGS) cstrings.spec
+ cp $(RPMROOT)/RPMS/`arch|sed 's/i[4-9]86/i386/'`/cstrings-$(VERS)*.rpm .
+ cp $(RPMROOT)/SRPMS/cstrings-$(VERS)*.src.rpm .
-Description: quick-and-dirty C code internationalization tool
Name: cstrings
-Version: 2.0
+Version: 2.1
Release: 1
-Source: locke.ccil.org:/pub/esr/cstrings-2.0.tar.gz
+Source: locke.ccil.org:/pub/esr/cstrings-2.1.tar.gz
Copyright: BSD-like
Group: Development/Tools
+Summary: quick-and-dirty C code internationalization tool
+
+$description:
+Quick-and-dirty C code internationalization tool.
%prep
%setup