From 465030dbeb9e19da3f32b48649bc6828cc2c4277 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonin=20D=C3=A9cimo?= Date: Thu, 4 Sep 2014 09:31:02 +0200 Subject: [PATCH] Little fixes. Description and Homepage now global. --- README.md | 8 +++++--- config.ini | 12 ++++++------ love-release.1 | 14 +++++++------- love-release.sh | 14 ++++++++++++-- scripts/android.sh | 15 +++++---------- scripts/debian.sh | 23 ++++++----------------- scripts/macosx.sh | 3 ++- 7 files changed, 43 insertions(+), 46 deletions(-) diff --git a/README.md b/README.md index f917ffc..4247df0 100644 --- a/README.md +++ b/README.md @@ -67,16 +67,18 @@ it will automatically detect which version your project uses. `-x` Exclude file or directory. +`--description` Set the description of your project. + +`--homepage` Set the homepage of your project. + #### WINDOWS `--win-icon` Path to an ico file to use. #### MAC OS X -`--osx-icon` Path to an icns file to use. +`--osx-icon` Path to an icns file to use. `--osx-maintainer-name` Set the maintainer’s name. Provide it for OS X CFBundleIdentifier. #### DEBIAN -`--description` Set the description of your project. -`--homepage` Set the homepage of your project. `--maintainer-email` Set the maintainer’s email. `--deb-maintainer-name` Set the maintainer’s name. `--deb-package-name` Set the name of the package and the command that will be used to launch your game. diff --git a/config.ini b/config.ini index 37b78c8..8500c07 100644 --- a/config.ini +++ b/config.ini @@ -13,6 +13,12 @@ love_version="0.9.1" ; Project's name project_name="" +; Homepage +homepage="" + +; Description +description="" + [windows] ; Path to an .ico file to use icon="" @@ -35,12 +41,6 @@ maintainer_name="" ; Maintainer_email maintainer_email="" -; Homepage -homepage="" - -; Description -description="" - ; Package name ; No spaces and no special characters except underscore. Better be lowercase. package_name="" diff --git a/love-release.1 b/love-release.1 index db678f7..d839859 100644 --- a/love-release.1 +++ b/love-release.1 @@ -78,6 +78,12 @@ Starting with Love 0.9.0, Love no longer supports old x86 Macintosh. .TP .B \-x \fIfile\fR|\fIdirectory\fR Exclude file or directory. +.TP +.B \-\-description \fIdescription\fR +Set the description of your project. +.TP +.B \-\-homepage \fIurl\fR +Set the homepage of your project. .SH WINDOWS .TP .B \-\-win\-icon \fIicon\fR @@ -91,12 +97,6 @@ Path to an icns file to use. Set the maintainer's name. Provide it for OS X CFBundleIdentifier. .SH DEBIAN .TP -.B \-\-description \fIdescription\fR -Set the description of your project. -.TP -.B \-\-homepage \fIpage\fR -Set the homepage of your project. -.TP .B \-\-maintainer-email \fIemail\fR Set the maintainer's email. .TP @@ -119,7 +119,7 @@ The name of the class that extends GameActivity. By default it is the name of the project with 'Activity' appended, eventual spaces and dashes replaced by underscores. .TP -.B \-\-apk\|maintainer\-name \fIname\fR +.B \-\-apk\-maintainer\-name \fIname\fR Set the maintainer’s name. It must be only alphanumerical characters, with eventual underscores. .TP diff --git a/love-release.sh b/love-release.sh index b40a5c5..03f71c1 100755 --- a/love-release.sh +++ b/love-release.sh @@ -20,7 +20,7 @@ SCRIPT_ARGS="l;" SCRIPT_ARGS="w. win-icon: $SCRIPT_ARGS" ## Debian -SCRIPT_ARGS="d; deb-package-version: deb-maintainer-name: maintainer-email: homepage: description: deb-package-name: $SCRIPT_ARGS" +SCRIPT_ARGS="d; deb-package-version: deb-maintainer-name: maintainer-email: deb-package-name: $SCRIPT_ARGS" ## Android SCRIPT_ARGS="a; activity: apk-package-version: apk-maintainer-name: apk-package-name: update-android; $SCRIPT_ARGS" @@ -83,7 +83,7 @@ LOVE_GT_090=$(float_test "$LOVE_VERSION_MAJOR >= 0.9") # Global variables ARGS=( "$@" ) -SCRIPT_ARGS="$SCRIPT_ARGS h; n: r: v: x: config: clean help" +SCRIPT_ARGS="$SCRIPT_ARGS h; n: r: v: x: config: homepage: description: clean help" SCRIPT_ARGS=$(printf '%s\n' $SCRIPT_ARGS | sort -u) CONFIG=false CONFIG_FILE=config.ini @@ -139,6 +139,12 @@ do if [ -n "${INI__global__project_name}" ]; then PROJECT_NAME=${INI__global__project_name} fi + if [ -n "${INI__global__homepage}" ]; then + PROJECT_HOMEPAGE=${INI__global__homepage} + fi + if [ -n "${INI__global__description}" ]; then + PROJECT_DESCRIPTION=${INI__global__description} + fi for option in "${EXCLUDE_CONFIG[@]}" do MAIN_EXCLUDE_FILES="${!option} $MAIN_EXCLUDE_FILES" @@ -169,6 +175,10 @@ do LOVE_GT_090=$(float_test "$LOVE_VERSION_MAJOR >= 0.9") elif [ "$OPTOPT" = "x" ]; then EXCLUDE_FILES="$OPTARG $EXCLUDE_FILES" + elif [ "$OPTOPT" = "homepage" ]; then + PROJECT_HOMEPAGE=$OPTARG + elif [ "$OPTOPT" = "description" ]; then + PROJECT_DESCRIPTION=$OPTARG elif [ "$OPTOPT" = "clean" ]; then missing_operands=false rm -rf "$MAIN_CACHE_DIR" diff --git a/scripts/android.sh b/scripts/android.sh index 66b215e..d00518b 100644 --- a/scripts/android.sh +++ b/scripts/android.sh @@ -2,6 +2,9 @@ init_module "Android" +PACKAGE_NAME=$(echo $PROJECT_NAME | sed -e 's/[^-a-zA-Z0-9_]/-/g' | tr '[:upper:]' '[:lower:]') +ACTIVITY=$(echo $PROJECT_NAME | sed -e 's/[^a-zA-Z0-9_]/_/g') + # Configuration if [ "$CONFIG" = true ]; then if [ -n "${INI__android__activity}" ]; then @@ -20,8 +23,6 @@ fi # Options -activity_defined_argument=false -package_name_defined_argument=false while getoptex "$SCRIPT_ARGS" "$@" do if [ "$OPTOPT" = "activity" ]; then @@ -38,12 +39,6 @@ do UPDATE_ANDROID_REPO=true fi done -if [ "$package_name_defined_argument" = false ]; then - PACKAGE_NAME=$(echo $PROJECT_NAME | sed -e 's/[^-a-zA-Z0-9_]/-/g') -fi -if [ "$activity_defined_argument" = false ]; then - ACTIVITY=$(echo $PROJECT_NAME | sed -e 's/[^a-zA-Z0-9_]/_/g') -fi # Android @@ -52,12 +47,12 @@ ERROR_MSG="Could not build Android package." if [ -z "$PACKAGE_VERSION" ]; then MISSING_INFO=1 ERROR_MSG="$ERROR_MSG - Missing project's version. Use --package-version." + Missing project's version. Use --apk-package-version." fi if [ -z "$MAINTAINER_NAME" ]; then MISSING_INFO=1 ERROR_MSG="$ERROR_MSG - Missing maintainer's name. Use --maintainer-name." + Missing maintainer's name. Use --apk-maintainer-name." fi if [ "$MISSING_INFO" -eq 1 ]; then exit_module "$MISSING_INFO" "$ERROR_MSG" diff --git a/scripts/debian.sh b/scripts/debian.sh index d31d298..d3bf21b 100644 --- a/scripts/debian.sh +++ b/scripts/debian.sh @@ -1,17 +1,14 @@ # Debian package init_module "Debian" + +PACKAGE_NAME=$(echo $PROJECT_NAME | sed -e 's/[^-a-zA-Z0-9_]/-/g' | tr '[:upper:]' '[:lower:]') + # Configuration if [ "$CONFIG" = true ]; then if [ -n "${INI__debian__package_version}" ]; then PACKAGE_VERSION=${INI__debian__package_version} fi - if [ -n "${INI__debian__homepage}" ]; then - PROJECT_HOMEPAGE=${INI__debian__homepage} - fi - if [ -n "${INI__debian__description}" ]; then - PROJECT_DESCRIPTION=${INI__debian__description} - fi if [ -n "${INI__debian__maintainer_name}" ]; then MAINTAINER_NAME=${INI__debian__maintainer_name} fi @@ -25,15 +22,10 @@ fi # Options -package_name_defined_argument=false while getoptex "$SCRIPT_ARGS" "$@" do if [ "$OPTOPT" = "deb-package-version" ]; then PACKAGE_VERSION=$OPTARG - elif [ "$OPTOPT" = "homepage" ]; then - PROJECT_HOMEPAGE=$OPTARG - elif [ "$OPTOPT" = "description" ]; then - PROJECT_DESCRIPTION=$OPTARG elif [ "$OPTOPT" = "deb-maintainer-name" ]; then MAINTAINER_NAME=$OPTARG elif [ "$OPTOPT" = "maintainer-email" ]; then @@ -43,9 +35,6 @@ do package_name_defined_argument=true fi done -if [ "$package_name_defined_argument" = false ]; then - PACKAGE_NAME=$(echo $PROJECT_NAME | sed -e 's/[^-a-zA-Z0-9_]/-/g') -fi # Debian @@ -53,7 +42,7 @@ MISSING_INFO=0 ERROR_MSG="Could not build Debian package." if [ -z "$PACKAGE_VERSION" ]; then MISSING_INFO=1 - ERROR_MSG="$ERROR_MSG\nMissing project's version. Use --package-version." + ERROR_MSG="$ERROR_MSG\nMissing project's version. Use --deb-package-version." fi if [ -z "$PROJECT_HOMEPAGE" ]; then MISSING_INFO=1 @@ -65,7 +54,7 @@ if [ -z "$PROJECT_DESCRIPTION" ]; then fi if [ -z "$MAINTAINER_NAME" ]; then MISSING_INFO=1 - ERROR_MSG="$ERROR_MSG\nMissing maintainer's name. Use --maintainer-name." + ERROR_MSG="$ERROR_MSG\nMissing maintainer's name. Use --deb-maintainer-name." fi if [ -z "$MAINTAINER_EMAIL" ]; then MISSING_INFO=1 @@ -133,6 +122,6 @@ cd "$RELEASE_DIR" rm -rf $TEMP -unset PROJECT_DESCRIPTION PROJECT_HOMEPAGE MAINTAINER_NAME MAINTAINER_EMAIL PACKAGE_NAME PACKAGE_VERSION +unset MAINTAINER_NAME MAINTAINER_EMAIL PACKAGE_NAME PACKAGE_VERSION exit_module diff --git a/scripts/macosx.sh b/scripts/macosx.sh index 2baadcb..cc1a652 100644 --- a/scripts/macosx.sh +++ b/scripts/macosx.sh @@ -2,6 +2,8 @@ init_module "Mac OS X" +PACKAGE_NAME=$(echo $PROJECT_NAME | sed -e 's/[^-a-zA-Z0-9_]/-/g' | tr '[:upper:]' '[:lower:]') + # Configuration if [ "$CONFIG" = true ]; then if [ -n "${INI__macosx__maintainer_name}" ]; then @@ -22,7 +24,6 @@ do MAINTAINER_NAME=$OPTARG fi done -PACKAGE_NAME=$(echo $PROJECT_NAME | sed -e 's/[^-a-zA-Z0-9_]/-/g') create_love_file 9