Skip to content

Instantly share code, notes, and snippets.

@winks
Forked from anonymous/gist:4055669
Created November 11, 2012 17:49
Show Gist options
  • Save winks/4055675 to your computer and use it in GitHub Desktop.
Save winks/4055675 to your computer and use it in GitHub Desktop.
git2package
#!/bin/sh
#
# This is the shell script for building:
# 1. a TAR.GZ package;
# 2. a ZIP package
# of phpMyFAQ using what committed into Git.
#
# For creating a package simply run:
#
# ./git2package.sh
#
# The script will download the source code from branch and
# it will create the 2 packages plus their MD5 hashes.
#
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at http://mozilla.org/MPL/2.0/.
#
# @package phpMyFAQ
# @author Matteo Scaramuccia <[email protected]>
# @author Thorsten Rinne <[email protected]>
# @author Rene Treffer <[email protected]>
# @author David Soria Parra <[email protected]>
# @copyright 2008-2012 phpMyFAQ Team
# @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0
# @link http://www.phpmyfaq.de
# @version 2008-09-10
# phpMyFAQ Version
. scripts/version.sh
if [ "x${MD5BIN}" = "x" ]; then
if which md5 > /dev/null; then
MD5BIN="$(which md5)"
else
MD5BIN="$(which md5sum)"
fi
fi
# Package Folder
if [ "x${PMF_PACKAGE_FOLDER}" = "x" ]; then
PMF_PACKAGE_FOLDER="phpmyfaq-${PMF_VERSION}"
fi
cwd=`pwd`
git checkout-index -f -a --prefix=$cwd/build/${PMF_PACKAGE_FOLDER}/
composer install
mkdir -p $cwd/build/${PMF_PACKAGE_FOLDER}/phpmyfaq/inc/libs/phpseclib/Crypt
cp -r $cwd/vendor/phpseclib/phpseclib/Crypt $cwd/build/${PMF_PACKAGE_FOLDER}/phpmyfaq/inc/libs/phpseclib/Crypt
cp -r $cwd/vendor/twitteroauth/twitteroauth $cwd/build/${PMF_PACKAGE_FOLDER}/phpmyfaq/inc/libs/twitteroauth
tar cfvz ${PMF_PACKAGE_FOLDER}.tar.gz $cwd/build/${PMF_PACKAGE_FOLDER}/phpmyfaq
zip -r ${PMF_PACKAGE_FOLDER}.zip $cwd/build/${PMF_PACKAGE_FOLDER}/phpmyfaq
$MD5BIN "${PMF_PACKAGE_FOLDER}.tar.gz" > "${PMF_PACKAGE_FOLDER}.tar.gz.md5"
$MD5BIN "${PMF_PACKAGE_FOLDER}.zip" > "${PMF_PACKAGE_FOLDER}.zip.md5"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment