example-tutorial Makefile,1.11,1.12
Paul W. Frields (pfrields)
fedora-docs-commits at redhat.com
Mon Oct 3 02:35:40 UTC 2005
- Previous message (by thread): docs-common/packaging fedora-doc.desktop.in.common, NONE, 1.1 fedora-doc.omf.in.common, NONE, 1.1 fedora-doc.spec.in.common, NONE, 1.1 titlegrab.py, NONE, 1.1
- Next message (by thread): docs-common/packaging fedora-doc.desktop.in.common,1.1,1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: pfrields
Update of /cvs/docs/example-tutorial
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv23259
Modified Files:
Makefile
Log Message:
Some ugly Makefile changes to test rpm buliding
Index: Makefile
===================================================================
RCS file: /cvs/docs/example-tutorial/Makefile,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- Makefile 17 Sep 2005 14:41:42 -0000 1.11
+++ Makefile 3 Oct 2005 02:35:37 -0000 1.12
@@ -26,3 +26,68 @@
# line:
#${DOCBASE}-en/index.html::
# echo FINISHED AT LAST
+
+
+######################################################
+# Some packaging specific vars
+VERSION=$(shell grep BOOKID $(DOCBASE)-en.xml | sed 's/<!ENTITY BOOKID "[^0-9\.]\+//' | sed 's/ .\+//')
+DATE=${shell grep BOOKID $(DOCBASE)-en.xml | sed 's/.\+(//' | sed 's/).\+//' }
+NOW=$(shell date +"%a %b %e %Y")
+SPECIN=../docs-common/packaging/fedora-doc.spec.in.common
+OMFIN=../docs-common/packaging/fedora-doc.omf.in.common
+DESKTOPIN=../docs-common/packaging/fedora-doc.desktop.in.common
+DOCSPEC=$(PWD)/SPECS/$(DOCBASE).spec
+DOCOMF=$(PWD)/SOURCES/fedora-doc-$(DOCBASE)-C.omf
+DOCDESKTOP=$(PWD)/SOURCES/fedora-doc-$(DOCBASE).desktop
+DOCSRCTAR=$(PWD)/SOURCES/$(DOCBASE)-$(VERSION).src.tar.gz
+TITLE=$(shell ../docs-common/packaging/titlegrab.py $(DOCBASE)-en.xml)
+######################################################
+# Some RPM flags...
+######################################################
+RPMFLAGS=--define "docbase $(DOCBASE)" --define "version $(VERSION)" --define "_topdir $(PWD)"
+######################################################
+
+
+clean::
+ rm -rf $(DOCBASE)*.rpm
+
+
+rpm: clean
+#
+# Make RPM-compliant tarball of source XML and other stuff
+ mkdir $(DOCBASE)-$(VERSION)
+ find . -maxdepth 1 -type f ! \( -name '*~' -o -name 'Makefile*' \) \
+ | cpio -pamdv $(DOCBASE)-$(VERSION)
+ find . -maxdepth 1 -type d ! \( -name '$(DOCBASE)-$(VERSION)' \
+ -o -name 'CVS' -o -name '*~' -o -name '$(DOCBASE)*' \) \
+ | cpio -pamdv $(DOCBASE)-$(VERSION)
+#
+# Make RPM build tree; don't rely on local user's setup
+ mkdir -p {BUILD,RPMS/noarch,SOURCES,SPECS,SRPMS}
+ tar -zcvf $(DOCSRCTAR) $(DOCBASE)-$(VERSION)
+ rm -rf $(DOCBASE)-$(VERSION)/
+#
+# Make rpmlint happy with a changelog entry
+# FIXME: Maybe more magic would make this stickier; pity
+# I'm no magician...
+ sed 's/\(%changelog\)/\1\n* $(NOW) Fedora Docs Project <fedora-docs-list at redhat.com> - $(VERSION)-1\n- Update to version $(VERSION)\n/' \
+ $(SPECIN) > $(DOCSPEC)
+#
+# Fill in files
+# FIXME: Needs to be multiplexed for LANGUAGES (see above)
+ cp $(OMFIN) $(DOCOMF)
+ cp $(DESKTOPIN) $(DOCDESKTOP)
+ for file in $(DOCOMF) $(DOCDESKTOP); do \
+ sed -i 's/@VERSION@/$(VERSION)/g' $(DOCOMF) ; \
+ sed -i 's/@DATE@/$(DATE)/g' $(DOCOMF) ; \
+ sed -i 's/@TITLE@/$(TITLE)/g' $(DOCOMF) ; \
+ sed -i 's/@DOCBASE@/$(DOCBASE)/g' $(DOCOMF) ; \
+ done
+#
+# Do the build...
+#
+ rpmbuild -bb -vv $(RPMFLAGS) $(DOCSPEC)
+ mv RPMS/noarch/*.rpm .
+ rpmbuild --clean --rmsource $(RPMFLAGS) $(DOCSPEC)
+ rm -rf {BUILD,RPMS,SOURCES,SPECS,SRPMS}
+ rm -rf $(DOCBASE)-$(VERSION)
- Previous message (by thread): docs-common/packaging fedora-doc.desktop.in.common, NONE, 1.1 fedora-doc.omf.in.common, NONE, 1.1 fedora-doc.spec.in.common, NONE, 1.1 titlegrab.py, NONE, 1.1
- Next message (by thread): docs-common/packaging fedora-doc.desktop.in.common,1.1,1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Fedora-docs-commits
mailing list