# Makefile for Linux FailSafe books. # Targets: # default -> all: makes the doc subtree # install: makes the rpms and "installs" them in the CD location # clean, realclean, clobber: wipes out the doc subtree # These vars are specific to the ism... PROD_NAME=failsafe-1.0 PROD_DIR=./usr/doc/sgi/$(PROD_NAME) HTML_SUBDIRS= LnxFailSafe_AG-001 LnxFailSafe_PG-001 PDF_SUBDIRS= LnxFailSafe_AG-001 LnxFailSafe_PG-001 # If you don't want the PostScript files included, just # remove the two directories from the next line. PS_SUBDIRS= LnxFailSafe_AG-001 LnxFailSafe_PG-001 SGML_SUBDIRS= LnxFailSafe_AG-001 LnxFailSafe_PG-001 RPM_ROOT = sgi-failsafedocs RPM_VERSION = 1.0 RPM_RELEASE = 1 DOC_INSTALL_DIR = ../image RPM_INSTALL_DIR = ../image/RPMS #********************************************** # # Shouldn't need to change anything below here. # #********************************************** # These vars are generic to the build... RPM_NAMES = $(RPM_ROOT)*-$(RPM_VERSION)-$(RPM_RELEASE).noarch.rpm SRPM_NAMES = $(RPM_ROOT)*-$(RPM_VERSION)-$(RPM_RELEASE).src.rpm #RPM_NAMES_PRINT = $(RPM_ROOT)-print*-$(RPM_VERSION)-$(RPM_RELEASE).noarch.rpm RPM_TARGET_DIR = RPMS SOURCES_DIR = /usr/src/redhat/SOURCES BUILD_DIR = /usr/src/redhat/BUILD/books default: all # Build a doc subtree that can be packaged as an RPM, or dumped # as-is on the CD. Update the spec. Build the rpms and dump them # here in books/. all: @if [ -d "./usr/doc" ] ; then rm -rf "./usr/doc" ; fi ; \ for d in $(HTML_SUBDIRS); do \ if [ -e $$d/html.tar ] ; then \ mkdir -p $(PROD_DIR)/$$d ; \ cp $$d/html.tar $(PROD_DIR)/$$d ; \ (cd $(PROD_DIR)/$$d ; \ tar xvf html.tar ; \ rm -f html.tar) ; \ fi ; \ cp $$d/$$d.html.ddf $(PROD_DIR)/$$d/html ; \ done for d in $(SGML_SUBDIRS); do \ if [ -e $$d/book.sgml ] ; then \ mkdir -p $(PROD_DIR)/$$d/sgml ; \ cp $$d/*.sgml $(PROD_DIR)/$$d/sgml ; \ cp -R $$d/figures $(PROD_DIR)/$$d/sgml ; \ fi ; \ cp $$d/$$d.sgml.ddf $(PROD_DIR)/$$d/sgml ; \ cp $$d/*.readme $(PROD_DIR)/$$d/sgml/README ; \ done for d in $(PDF_SUBDIRS); do \ if [ -e $$d/prod/[0-9\-]*.pdf ] ; then \ mkdir -p $(PROD_DIR)/$$d/pdf ; \ cp $$d/prod/[0-9\-]*.pdf $(PROD_DIR)/$$d/pdf ; \ (cd $(PROD_DIR)/$$d/pdf ; \ mv [0-9\-]*.pdf $$d.pdf) ; \ fi ; \ cp $$d/$$d.pdf.ddf $(PROD_DIR)/$$d/pdf ; \ done for d in $(PS_SUBDIRS); do \ if [ -e $$d/prod/psfiles.gz.tar ] ; then \ cp $$d/prod/psfiles.gz.tar $(PROD_DIR)/$$d ; \ (cd $(PROD_DIR)/$$d ; \ tar xvf psfiles.gz.tar ; mv psfiles ps ; \ rm -f psfiles.gz.tar) ; \ fi ; \ cp $$d/$$d.ps.ddf $(PROD_DIR)/$$d/ps ; \ done ./generate_targets (cd .. ; tar cBf $(SOURCES_DIR)/$(RPM_ROOT).tar.gz books) rpm -ba $(RPM_ROOT).spec if [ ! -d $(RPM_TARGET_DIR) ] ; then mkdir $(RPM_TARGET_DIR) ; fi mv /usr/src/redhat/RPMS/noarch/$(RPM_NAMES) $(RPM_TARGET_DIR) # Move/copy stuff to the image dir install: all if [ ! -d $(RPM_INSTALL_DIR) ] ; then mkdir -p $(RPM_INSTALL_DIR) ; fi mv $(RPM_TARGET_DIR)/$(RPM_NAMES) $(RPM_INSTALL_DIR) if [ ! -d $(DOC_INSTALL_DIR) ] ; then mkdir -p $(DOC_INSTALL_DIR) ; fi cp -rf ./usr/doc $(DOC_INSTALL_DIR) clean: rm -rf RPMS rm -rf $(SOURCES_DIR)/$(RPM_ROOT).tar.gz rm -rf $(BUILD_DIR) rm -f /usr/src/redhat/SRPMS/$(SRPM_NAMES) realclean: clobber clobber: clean rm -f *.auto rm -rf ./usr rm -f $(RPM_INSTALL_DIR)/$(RPM_NAMES) rm -rf $(DOC_INSTALL_DIR)/doc