Home | History | Annotate | Download | only in git
      1 #
      2 #
      3 # CDDL HEADER START
      4 #
      5 # The contents of this file are subject to the terms of the
      6 # Common Development and Distribution License (the "License").
      7 # You may not use this file except in compliance with the License.
      8 #
      9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
     10 # or http://www.opensolaris.org/os/licensing.
     11 # See the License for the specific language governing permissions
     12 # and limitations under the License.
     13 #
     14 # When distributing Covered Code, include this CDDL HEADER in each
     15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
     16 # If applicable, add the following below this CDDL HEADER, with the
     17 # fields enclosed by brackets "[]" replaced with your own identifying
     18 # information: Portions Copyright [yyyy] [name of copyright owner]
     19 #
     20 # CDDL HEADER END
     21 #
     22 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
     23 # Use is subject to license terms.
     24 #
     25 # ident	"@(#)Makefile.sfw	1.4	09/08/23 SMI"
     26 
     27 DESTDIR=$(ROOT)
     28 PREFIX=$(CFGPREFIX)
     29 VER=git-1.5.6.5
     30 
     31 include ../Makefile.cmd
     32 C99MODE=$(C99_DISABLE) 
     33 
     34 SFW_PATH="$(ROOT)/bin:/usr/ccs/bin:/usr/bin:/usr/sfw/bin:$(PATH)"
     35 
     36 MANPAGES=git-manpages-1.5.6.5
     37 DOC=$(VER)/Documentation
     38 MANDIR=$(PREFIX)/share/man
     39 MAN1DIR=$(MANDIR)/man1
     40 MAN4DIR=$(MANDIR)/man4
     41 MAN5DIR=$(MANDIR)/man5
     42 INSTALL=install
     43 PERL_LIB:sh = /usr/perl5/bin/perl -MConfig -e 'print "$Config{installvendorarch}"'
     44 
     45 
     46 all: $(VER)/Makefile
     47 	(cd $(VER)/perl; \
     48 	    if [ ! -f Makefile.orig ]; then \
     49 		cp Makefile Makefile.orig ; \
     50 	    fi ; \
     51 	    rm -f Makefile ; \
     52 	    sed -e 's|$$(prefix)/lib|$(PERL_LIB)|' \
     53 	    -e 's|.(instdir_SQ|$$(DESTDIR)&|g' \
     54 	    -e 's|echo $$(DESTDIR)|echo |' \
     55 	    Makefile.orig > Makefile )
     56 	(cd $(VER); env - \
     57 	    PATH=$(SFW_PATH) \
     58 	    CC="$(CC)" \
     59 	    ./configure \
     60 		--without-openssl \
     61 		--prefix=$(PREFIX))
     62 	(cd $(VER); env - \
     63 	    MAKE=$(GMAKE) \
     64 	    PATH=$(SFW_PATH) \
     65 	    DESTDIR=$(ROOT) \
     66 	    PERL_PATH=$(PERL) \
     67 	    NO_PERL_MAKEMAKER=1 \
     68 	    V=1 \
     69 	    CC="$(CC)" \
     70 	    $(GMAKE) prefix=$(PREFIX) all)
     71 	@find . -name core -exec rm -f {} \;
     72 
     73 install: install-protofix
     74 
     75 install-target: all .WAIT doc
     76 	(cd $(VER) ; env - CHOWN=$(CHOWN) CHGRP=$(CHGRP) \
     77 		MAKE=$(GMAKE) DESTDIR=$(ROOT) $(GMAKE) prefix=$(PREFIX) install )
     78 
     79 # apply the file attributes from the packaging
     80 install-protofix: install-target
     81 	for pkg in $(COMPONENT_PACKAGES:sh) ; do \
     82 		$(SRC)/tools/protofix --pkg $$pkg --perm ; \
     83 	done
     84 
     85 
     86 $(VER)/Makefile: $(VER).tar.gz
     87 	gzip -dc $(VER).tar.gz | tar xopf -
     88 	touch $(VER)/Makefile
     89 
     90 sunman: $(MANPAGES).tar.gz
     91 	$(MKDIR) -p sunman
     92 	mkdir -p tmp; gzip -dc $(MANPAGES).tar.gz | (cd tmp; tar xopf -)
     93 	mv tmp/man1/* sunman; rmdir tmp/man1
     94 	mv tmp/man5/* sunman; rmdir tmp/man5
     95 	mv tmp/man7/* sunman; rmdir tmp/man7; rmdir tmp
     96 
     97 doc: sunman-stability sunman
     98 	cd sunman; for manfile in *.1; \
     99 	do \
    100 		$(SED) -f ../sunman-stability $$manfile > ../$(DOC)/$$manfile; \
    101 	done
    102 	cd sunman; for manfile in *.5; \
    103 	do \
    104 		name=`echo $$manfile | \
    105 		awk '{split($$1,arr,".");printf("%s",arr[1]);}'`; \
    106 		newman=$$name".4"; \
    107 		$(SED) 's/"5"/"4"/' $$manfile | \
    108 		$(SED) -f ../sunman-stability  > ../$(DOC)/$$newman; \
    109 	done
    110 	cd sunman; for manfile in *.7; \
    111 	do \
    112 		name=`echo $$manfile | \
    113 		awk '{split($$1,arr,".");printf("%s",arr[1]);}'`; \
    114 		newman=$$name".5"; \
    115 		$(SED) 's/"7"/"5"/' $$manfile | $(SED) 's/(7)/(5)/' | \
    116 		$(SED) -f ../sunman-stability  > ../$(DOC)/$$newman; \
    117 	done
    118 	for i in ./$(DOC)/*.1 ; \
    119 	do \
    120 		rm -f $(DESTDIR)$(MAN1DIR)/`basename $$i` ; \
    121 		$(INSTALL) -f $(DESTDIR)$(MAN1DIR) -m 0444 $$i ; \
    122 	done
    123 	for i in ./$(DOC)/*.4 ; \
    124 	do \
    125 		rm -f $(DESTDIR)$(MAN4DIR)/`basename $$i` ; \
    126 		$(INSTALL) -f $(DESTDIR)$(MAN4DIR) -m 0444 $$i ; \
    127 	done
    128 	for i in ./$(DOC)/*.5 ; \
    129 	do \
    130 		rm -f $(DESTDIR)$(MAN5DIR)/`basename $$i` ; \
    131 		$(INSTALL) -f $(DESTDIR)$(MAN5DIR) -m 0444 $$i ; \
    132 	done
    133 
    134 clean:
    135 	-$(RM) -r $(VER) sunman
    136 
    137 include ../Makefile.targ
    138 
    139