summaryrefslogtreecommitdiffstats
path: root/kapptemplate/existing.module
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitbd9e6617827818fd043452c08c606f07b78014a0 (patch)
tree425bb4c3168f9c02f10150f235d2cb998dcc6108 /kapptemplate/existing.module
downloadtdesdk-bd9e6617827818fd043452c08c606f07b78014a0.tar.gz
tdesdk-bd9e6617827818fd043452c08c606f07b78014a0.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kapptemplate/existing.module')
-rw-r--r--kapptemplate/existing.module118
1 files changed, 118 insertions, 0 deletions
diff --git a/kapptemplate/existing.module b/kapptemplate/existing.module
new file mode 100644
index 00000000..01a4e710
--- /dev/null
+++ b/kapptemplate/existing.module
@@ -0,0 +1,118 @@
+function GetCurrentSource
+{
+ # First, get the location of the existing source code
+ unset SOURCE_LOCATION;
+ while [ ! "$SOURCE_LOCATION" ];
+ do
+ $ECHO "What directory contains the existing files? [no default]";
+ $ECHO ": \c";
+ read SOURCE_LOCATION;
+
+ if [ ! -d $SOURCE_LOCATION ];
+ then
+ $ECHO "Directory does not exist. Try again.";
+ $ECHO;
+ unset SOURCE_LOCATION;
+ fi
+ done
+ $ECHO;
+
+ # Now, find C++ source and header files
+ CUR_PWD=$PWD;
+ cd $SOURCE_LOCATION;
+ EXISTING_SOURCE=`/bin/ls -x *.C *.cpp *.cc`;
+ EXISTING_HEADER=`/bin/ls -x *.h`;
+ cd $CUR_PWD;
+
+ # Sanity check
+ if [ "$EXISTING_SOURCE" -o "$EXISTING_HEADER" ];
+ then
+ $ECHO "Found these files: $EXISTING_SOURCE $EXISTING_HEADER";
+ else
+ $ECHO "Could not find any source files in that directory";
+ exit 1;
+ fi
+}
+
+###########################################################################
+#
+# STEP 1: GET USER INFORMATION
+#
+###########################################################################
+# Get the application name
+APPTYPE="existing application";
+unset APPDEFAULT;
+GetProperName
+
+# Get the application version
+GetVersion
+
+# Get where the sources currently are
+GetCurrentSource
+
+# Get the root where this framework will be installed
+GetLocationRoot
+
+# Get the author's name
+GetAuthorName
+
+# Get the author's email
+GetAuthorEmail
+
+# Verify that everything is grand
+$ECHO;
+$ECHO "Here is what I have:";
+$ECHO "The application: $APP_NAME v$APP_VERSION";
+$ECHO "Installed in: $LOCATION_ROOT";
+$ECHO "Source from: $SOURCE_LOCATION";
+$ECHO "Author: $AUTHOR <$EMAIL>";
+$ECHO;
+$ECHO "Is this correct (Y/n)? ";
+$ECHO ": \c";
+read Y_N;
+if [ $Y_N -a $Y_N = 'n' ];
+then
+ $ECHO "AUGH! Well, try again.";
+ exit 0;
+fi
+$ECHO;
+
+$ECHO "OK, Here we go!!";
+
+###########################################################################
+#
+# STEP 2: CREATE APPLICATION FRAMEWORK
+#
+###########################################################################
+CreateAppFramework
+
+###########################################################################
+#
+# STEP 3: HANDLE EXISTING FILES
+#
+###########################################################################
+for FILE in $EXISTING_SOURCE;
+do
+ cp -f $SOURCE_LOCATION/$FILE $LOCATION_ROOT/$APP_NAME_LC/$FILE
+done
+for FILE in $EXISTING_HEADER;
+do
+ cp -f $SOURCE_LOCATION/$FILE $LOCATION_ROOT/$APP_NAME_LC/$FILE
+done
+
+for EXE_FILE in $EXISTING_FILES;
+do
+ . $SHARE_DIR/existing/$EXE_FILE || exit 1;
+done
+
+###########################################################################
+#
+# STEP 4: FINAL STEPS
+#
+###########################################################################
+
+if [ ! $NOINIT ]; then
+ cd $LOCATION_ROOT && $MAKE -f Makefile.cvs
+fi
+
+$ECHO "DONE!";