[csw-devel] SF.net SVN: gar:[13404] csw/mgar/pkg/TEMPLATES/createpkg

theferret at users.sourceforge.net theferret at users.sourceforge.net
Sat Feb 19 19:16:29 CET 2011


Revision: 13404
          http://gar.svn.sourceforge.net/gar/?rev=13404&view=rev
Author:   theferret
Date:     2011-02-19 18:16:29 +0000 (Sat, 19 Feb 2011)

Log Message:
-----------
TEMPLATES tweak. better comments are always good. plus fixed a bug

Modified Paths:
--------------
    csw/mgar/pkg/TEMPLATES/createpkg/copy_template
    csw/mgar/pkg/TEMPLATES/createpkg/generate_pkginfo

Added Paths:
-----------
    csw/mgar/pkg/TEMPLATES/createpkg/Makefile.simple
    csw/mgar/pkg/TEMPLATES/createpkg/generate_branch

Removed Paths:
-------------
    csw/mgar/pkg/TEMPLATES/createpkg/Makefile

Deleted: csw/mgar/pkg/TEMPLATES/createpkg/Makefile
===================================================================
--- csw/mgar/pkg/TEMPLATES/createpkg/Makefile	2011-02-19 18:14:18 UTC (rev 13403)
+++ csw/mgar/pkg/TEMPLATES/createpkg/Makefile	2011-02-19 18:16:29 UTC (rev 13404)
@@ -1,60 +0,0 @@
-#This Makefile originally generated from a template under 
-# pkg/TEMPLATES/createpkg
-# You will most likely have to use GNU make to use it.
-
-
-#Uncomment one of these definitions. The -b invokation,
-# is suitable for use with small packages, where you want to have a few files
-# in your top level src directory. It is also suitable for
-# "relocateable" packages. see the createpkg docs for more details.
-#CREATEPKG=createpkg -b `pwd`
-CREATEPKG=createpkg -r `pwd`/build/*/cswstage
-
-
-BUILDDIR=build/*
-
-
-
-STDFILES=pkginfo copyright prototype
-FILES=
-
-all:	build package
-
-
-build:	build/.config.done
-	(cd $(BUILDDIR) ; \
-	$(MAKE) ; \
-	stagepkg  )
-
-
-# dummy target for configure
-build/.config.done:
-	@echo Configuring with:
-	@echo CC=$(CC) $(CFLAGS)
-	@echo CXX=$(CXX) $(CXXFLAGS)
-	(cd $(BUILDDIR) ; \
-	test -f ../../patchfile.preconf && \
-		gpatch -p0 <../../patchfile.preconf ; \
-	./configure --prefix=/opt/csw ; \
-	if test -f ../../patchfile.postconf ; then \
-                 gpatch -p0 <../../patchfile.postconf ; fi)
-	touch build/.config.done
-
-
-# I tried depending this on   $(BUILDDIR)/config.log  but that didnt stick
-configure:	build/.config.done
-
-package:	$(STDFILE) $(FILES) build
-	$(CREATEPKG)
-
-
-
-pkgclean:
-	rm -f *.pkg.gz package
-
-clean:	pkgclean
-	cd $(BUILDDIR) && make clean
-
-reallyclean:	clean
-	rm -f $BUILDDIR/config.log $BUILDDIR/config.cache $BUILDDIR/config.status
-	rm -f build/.config.done	

Copied: csw/mgar/pkg/TEMPLATES/createpkg/Makefile.simple (from rev 11443, csw/mgar/pkg/TEMPLATES/createpkg/Makefile)
===================================================================
--- csw/mgar/pkg/TEMPLATES/createpkg/Makefile.simple	                        (rev 0)
+++ csw/mgar/pkg/TEMPLATES/createpkg/Makefile.simple	2011-02-19 18:16:29 UTC (rev 13404)
@@ -0,0 +1,70 @@
+#This Makefile originally generated from a template under 
+# pkg/TEMPLATES/createpkg
+# You will most likely have to use GNU make to use it.
+# The "Makefile.simple" variant, is for software that is
+# absolutely trivial. For things that dont need compiling, or even
+# downloading, but just live in the svn tree itself.
+# To Use:
+# 1. Mention what files you want to include, in the FILES var below.
+# 2. Create a prototype file by hand, and a copyright file
+# 3. Edit pkginfo file appropriately 
+# 4. Create depend file, or remove it from STDFILES below
+# 5. type gmake
+
+# You should then have a package in the current directory
+
+#Uncomment one of these definitions. The -b invokation,
+# is suitable for use with small packages, where you want to have a few files
+# in your top level src directory. It is also suitable for
+# "relocateable" packages. see the createpkg docs for more details.
+#CREATEPKG=createpkg -b `pwd`
+CREATEPKG=createpkg -r `pwd`/build/*/cswstage
+
+
+
+
+FILES=your-files-here
+
+###  Dont normally check stuff below here.
+STDFILES=pkginfo copyright prototype
+BUILDDIR=build/*
+
+all:	build package
+
+
+build:	build/.config.done
+	(cd $(BUILDDIR) ; \
+	$(MAKE) ; \
+	stagepkg  )
+
+
+# This is what does the actual "work" for "build configure"
+build/.config.done:
+	@echo Configuring with:
+	@echo CC=$(CC) $(CFLAGS)
+	@echo CXX=$(CXX) $(CXXFLAGS)
+	(cd $(BUILDDIR) ; \
+	test -f ../../patchfile.preconf && \
+		gpatch -p0 <../../patchfile.preconf ; \
+	./configure --prefix=/opt/csw ; \
+	if test -f ../../patchfile.postconf ; then \
+                 gpatch -p0 <../../patchfile.postconf ; fi)
+	touch build/.config.done
+
+
+# Friendly name, to trigger the "real" target, above
+configure:	build/.config.done
+
+package:	$(STDFILE) $(FILES) build
+	$(CREATEPKG)
+
+
+pkgclean:
+	rm -f *.pkg.gz package
+
+clean:	pkgclean
+	cd $(BUILDDIR) && make clean
+
+reallyclean:	clean
+	rm -f $BUILDDIR/config.log $BUILDDIR/config.cache $BUILDDIR/config.status
+	rm -f build/.config.done	

Modified: csw/mgar/pkg/TEMPLATES/createpkg/copy_template
===================================================================
--- csw/mgar/pkg/TEMPLATES/createpkg/copy_template	2011-02-19 18:14:18 UTC (rev 13403)
+++ csw/mgar/pkg/TEMPLATES/createpkg/copy_template	2011-02-19 18:16:29 UTC (rev 13404)
@@ -28,13 +28,6 @@
 
 
 
-MY_SVN_DIR=`svn info| awk '$1=="URL:"{print $2}'`
-if [[ "$MY_SVN_DIR" == "" ]] ; then
-	print ERROR: expected to be within subversion tree somewhere
-	print cannot continue
-	exit 1
-fi
-
 $SVN mkdir --parents $DESTDIR
 
 svn propset svn:ignore -F /dev/fd/0 $DESTDIR <<EOF
@@ -51,7 +44,6 @@
 cp $template_dir/README* $DESTDIR
 cp $template_dir/prototype* $DESTDIR
 $template_dir/generate_pkginfo $1 >$DESTDIR/pkginfo
-print "OPENCSW_REPOSITORY=$MY_SVN_DIR/$DESTDIR" >>$DESTDIR/pkginfo
 
 print ""
 print Created directory $1 locally, and in subversion

Added: csw/mgar/pkg/TEMPLATES/createpkg/generate_branch
===================================================================
--- csw/mgar/pkg/TEMPLATES/createpkg/generate_branch	                        (rev 0)
+++ csw/mgar/pkg/TEMPLATES/createpkg/generate_branch	2011-02-19 18:16:29 UTC (rev 13404)
@@ -0,0 +1,86 @@
+#!/bin/ksh -p
+
+# In contract to copy_template, this script is meant to be
+# called in a pre-existing subtree. 
+#  (eg: inside a mgar/pkg/softname directory)
+# It is designed for creating a branch, rather than setting up "trunk"
+# Note that unlike copy_template, it does NOT do any kind of svn
+# by default
+# (unless you use the -s flag)
+
+function usage {
+	print Usage: $0 [-s] new-directory
+	print This script creates a new directory, svn branch style.
+	print It presumes you are already in a directory with the name
+	print of the software you wish to packge.
+	print It will not do any svn ops by default unless you use -s
+
+	exit 1
+}
+
+if [[ $? = "-s" ]] ; then
+	SVN=svn; shift
+fi
+
+case $1 in
+	""|-*)
+		usage
+	;;
+esac
+
+
+#note that if you want to use 'real' subversion, this must be
+# exactly "svn", because of checks lower down
+SVN=${SVN:-echo FAKEsvn}
+
+if [ "$SVN" = "svn" ] ; then
+MKDIR="$SVN mkdir --parents"
+else
+echo Note: SVN is not 'svn'. So skipping it.
+MKDIR=mkdir
+fi
+
+
+template_dir=`dirname $0`
+DESTDIR=$1
+if [[ -d $DESTDIR ]] ; then
+	print ERROR $DESTDIR exists
+	exit 1
+fi
+
+currdir=`basename $PWD`
+
+$MKDIR $DESTDIR
+
+$SVN propset svn:ignore -F /dev/fd/0 $DESTDIR <<EOF
+cookies
+download
+work
+cswstage
+build
+EOF
+
+
+cp $template_dir/Makefile* $DESTDIR
+cp $template_dir/README* $DESTDIR
+cp $template_dir/prototype* $DESTDIR
+$template_dir/generate_pkginfo $currdir >$DESTDIR/pkginfo
+
+# This is done by generate_pkginfo now
+# Not very inteligently, but it is done anyway.
+#print "OPENCSW_REPOSITORY=$MY_SVN_DIR/$DESTDIR" >>$DESTDIR/pkginfo
+
+print ""
+print Created directory $1 locally, and in subversion
+print Things you still need to do:
+print ""
+print "  * Edit the pkginfo file fully"
+print "  * Create an appropriate copyright file"
+print "  * Choose ONE of the Makefiles, and remove the other"
+print "  * Edit the Makefile to have any required extra flags, etc"
+print "  * Fill in the rest of the prototype file"
+
+print ""
+print " (and dont forget to check everything in when you are done!)"
+
+


Property changes on: csw/mgar/pkg/TEMPLATES/createpkg/generate_branch
___________________________________________________________________
Added: svn:executable
   + *

Modified: csw/mgar/pkg/TEMPLATES/createpkg/generate_pkginfo
===================================================================
--- csw/mgar/pkg/TEMPLATES/createpkg/generate_pkginfo	2011-02-19 18:14:18 UTC (rev 13403)
+++ csw/mgar/pkg/TEMPLATES/createpkg/generate_pkginfo	2011-02-19 18:16:29 UTC (rev 13404)
@@ -6,7 +6,7 @@
 
 print PKG=CSW$1
 print NAME=$1 - description goes here
-print VERSION=1.0,REV=YYYY.M.DD
+print VERSION=1.0,REV=YYYY.MM.DD
 print CATEGORY=application
 print VENDOR=http://www.SOURCE-URL/ packaged for CSW by $FULLNAME
 print HOTLINE=http://www.opencsw.org/bugtrack/


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list