Author: jhuntwork
Date: 2005-05-14 08:15:47 -0600 (Sat, 14 May 2005)
New Revision: 153

Added:
   trunk/packages/template/
   trunk/packages/template/Makefile
Log:
Added template Makefile for packages

Added: trunk/packages/template/Makefile
===================================================================
--- trunk/packages/template/Makefile    2005-05-14 14:03:20 UTC (rev 152)
+++ trunk/packages/template/Makefile    2005-05-14 14:15:47 UTC (rev 153)
@@ -0,0 +1,54 @@
+# [package-name] Makefile
+
+# Package versions
+NM= [package-name]
+VRS= 1.2.3
+DIR= $(NM)-$(VRS)
+FILE= $(DIR).tar.bz2
+PATCH1= $(DIR)-some_patch-1.patch
+URL= $(FTP)/$(NM)/$(FILE)
+URL1= $(FTP)/$(NM)/$(PATCH1)
+
+# RULES
+
+.PHONY: stage1 clean stage2 chroot
+
+# Stage1 is for packages built to the /tools dir in the base LFS
+stage1:
+       @echo ""
+       @echo "=====> Building $(NM)"
+       @echo ""
+       @if [ ! -f $(SRC)/$(FILE) ] ; then $(WGET) $(URL) && \
+        mv $(FILE) $(SRC) ; fi
+       @if [ ! -f $(WD)/bin/ls ] ; then tar xjvf $(SRC)/$(FILE) && cd $(DIR) 
&& \
+        ./configure --prefix=$(WD) && make -j3 && make install ; fi
+       @make clean
+
+# This target allows us to chroot if we haven't already
+# Useful if the make has bombed and we want to build just
+# this package for the chroot environment. In that case, we
+# just call "make package-name" from the top directory, and
+# this target is used to enter chroot and recall the ch-package-name
+# target from the top Makefile.
+chroot:
+       @chroot "$(MP)" $(chenv1) 'cd $(ROOT) && make ch-$(NM) $(chbash1)'
+
+# This target is for building the package once we're already inside
+# the chroot environment.
+stage2:
+       @echo ""
+       @echo "=====> Building $(NM) in chroot"
+       @echo ""
+       @if [ ! -f $(SRC)/$(FILE) ] ; then $(WGET) $(URL) && \
+        mv $(FILE) $(SRC) ; fi
+       @if [ ! -f $(SRC)/$(PATCH1) ] ; then $(WGET) $(URL1) && \
+        mv $(PATCH1) $(SRC) ; fi
+       @if [ ! -f /bin/ls ] ; then tar xjvf $(SRC)/$(FILE) && cd $(DIR) && \
+        patch -Np1 -i $(SRC)/$(PATCH1) && \
+        ./configure --prefix=/usr && \
+        make -j3 && make install ; fi
+       @make clean
+        
+# Does what it says
+clean:
+       @-rm -rf $(DIR)

-- 
http://linuxfromscratch.org/mailman/listinfo/livecd
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to