forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This enhances the makidst script: - integrate both snapshot and makedist scripts together - add help and options - generated files are created in the php-src repository directly - other minor enhancemenets such as CS fixes - functionality moved from the Makefile to only shell script - Add missed patching of the Zend Parsers to the main build step - Add all *.tmp files to gitignore
- php-8.1.1RC1
- php-8.1.0
- php-8.1.0beta3
- php-8.1.0beta2
- php-8.1.0beta1
- php-8.1.0alpha3
- php-8.1.0alpha2
- php-8.1.0alpha1
- php-8.1.0RC6
- php-8.1.0RC5
- php-8.1.0RC4
- php-8.1.0RC3
- php-8.1.0RC2
- php-8.1.0RC1
- php-8.0.14RC1
- php-8.0.13
- php-8.0.13RC1
- php-8.0.12
- php-8.0.12RC1
- php-8.0.11
- php-8.0.11RC1
- php-8.0.10
- php-8.0.10RC1
- php-8.0.9
- php-8.0.9RC1
- php-8.0.8
- php-8.0.8RC1
- php-8.0.7
- php-8.0.7RC1
- php-8.0.6
- php-8.0.5
- php-8.0.5RC1
- php-8.0.4RC1
- php-8.0.3
- php-8.0.3RC1
- php-8.0.2
- php-8.0.2RC1
- php-8.0.1
- php-8.0.1RC1
- php-8.0.0
- php-8.0.0rc1
- php-8.0.0beta4
- php-8.0.0beta3
- php-8.0.0beta2
- php-8.0.0beta1
- php-8.0.0alpha3
- php-8.0.0alpha2
- php-8.0.0alpha1
- php-8.0.0RC5
- php-8.0.0RC4
- php-8.0.0RC3
- php-8.0.0RC2
- php-7.4.27RC1
- php-7.4.26
- php-7.4.26RC1
- php-7.4.25
- php-7.4.25RC1
- php-7.4.24
- php-7.4.24RC1
- php-7.4.23
- php-7.4.23RC1
- php-7.4.22
- php-7.4.22RC1
- php-7.4.21
- php-7.4.21RC1
- php-7.4.20
- php-7.4.20RC1
- php-7.4.19
- php-7.4.18
- php-7.4.18RC1
- php-7.4.17RC1
- php-7.4.16
- php-7.4.16RC1
- php-7.4.15
- php-7.4.15RC2
- php-7.4.15RC1
- php-7.4.14
- php-7.4.14RC1
- php-7.4.13
- php-7.4.13RC1
- php-7.4.12
- php-7.4.12RC1
- php-7.4.11
- php-7.4.11RC1
- php-7.4.10
- php-7.4.10RC1
- php-7.4.9
- php-7.4.9RC1
- php-7.4.8
- php-7.4.8RC1
- php-7.4.7
- php-7.4.7RC1
- php-7.4.6
- php-7.4.6RC1
- php-7.4.5
- php-7.4.5RC1
- php-7.4.4
- php-7.4.4RC1
- php-7.4.3
- php-7.4.3RC1
- php-7.4.2
- php-7.4.2RC1
- php-7.4.1
- php-7.4.1RC1
- php-7.4.0
- php-7.4.0beta4
- php-7.4.0beta2
- php-7.4.0beta1
- php-7.4.0alpha3
- php-7.4.0alpha2
- php-7.4.0alpha1
- php-7.4.0RC6
- php-7.4.0RC5
- php-7.4.0RC4
- php-7.4.0RC3
- php-7.4.0RC2
- php-7.4.0RC1
Showing
7 changed files
with
180 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,20 @@ $(srcdir)/zend_language_scanner.c: $(srcdir)/zend_language_scanner.re | |
|
||
$(srcdir)/zend_language_parser.h: $(srcdir)/zend_language_parser.c | ||
$(srcdir)/zend_language_parser.c: $(srcdir)/zend_language_parser.y | ||
# Tweak zendparse to be exported through ZEND_API. This has to be revisited once | ||
# bison supports foreign skeletons and that bison version is used. Read | ||
# https://git.savannah.gnu.org/cgit/bison.git/tree/data/README.md for more. | ||
@$(YACC) -p zend -v -d $(srcdir)/zend_language_parser.y -o $@ | ||
@$(SED) -e 's,^int zendparse\(.*\),ZEND_API int zendparse\1,g' < $@ \ | ||
> [email protected] && \ | ||
mv [email protected] $@ | ||
@$(SED) -e 's,^int zendparse\(.*\),ZEND_API int zendparse\1,g' < $(srcdir)/zend_language_parser.h \ | ||
> $(srcdir)/zend_language_parser.h.tmp && \ | ||
mv $(srcdir)/zend_language_parser.h.tmp $(srcdir)/zend_language_parser.h | ||
@$(SED) -e 's,^#ifndef YYTOKENTYPE,#include "zend.h"\ | ||
#ifndef YYTOKENTYPE,g' < $(srcdir)/zend_language_parser.h \ | ||
> $(srcdir)/zend_language_parser.h.tmp && \ | ||
mv $(srcdir)/zend_language_parser.h.tmp $(srcdir)/zend_language_parser.h | ||
|
||
$(srcdir)/zend_ini_parser.h: $(srcdir)/zend_ini_parser.c | ||
$(srcdir)/zend_ini_parser.c: $(srcdir)/zend_ini_parser.y | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,6 @@ | |
# Makefile to generate build tools | ||
# | ||
|
||
subdirs = Zend TSRM | ||
config_h_in = main/php_config.h.in | ||
PHP_AUTOCONF = autoconf | ||
PHP_AUTOHEADER = autoheader | ||
|
@@ -41,28 +40,3 @@ $(config_h_in): configure | |
@rm -f $@ | ||
@$(PHP_AUTOHEADER) $(PHP_AUTOCONF_FLAGS) | ||
@sed -e 's/^#undef PACKAGE_[^ ]*/\/\* & \*\//g' < $@ > [email protected] && mv [email protected] $@ | ||
|
||
snapshot: | ||
distname='$(DISTNAME)'; \ | ||
if test -z "$$distname"; then \ | ||
distname='php7-snapshot'; \ | ||
fi; \ | ||
myname=`basename \`pwd\`` ; \ | ||
cd .. && cp -rp $$myname $$distname; \ | ||
cd $$distname; \ | ||
rm -f $(subdirs) 2>/dev/null || true; \ | ||
for i in $(subdirs); do \ | ||
test -d $$i || (test -d ../$$i && cp -rp ../$$i $$i); \ | ||
done; \ | ||
find . -type l -exec rm {} \; ; \ | ||
$(MAKE) -f build/build.mk; \ | ||
cd ..; \ | ||
tar cf $$distname.tar $$distname; \ | ||
rm -rf $$distname $$distname.tar.*; \ | ||
bzip2 -9 $$distname.tar; \ | ||
md5sum $$distname.tar.bz2; \ | ||
sync; sleep 2; \ | ||
md5sum $$distname.tar.bz2; \ | ||
bzip2 -t $$distname.tar.bz2 | ||
|
||
.PHONY: snapshot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,143 +1,196 @@ | ||
#!/bin/sh | ||
# | ||
# Distribution generator for git | ||
# | ||
# Usage: makedist version | ||
# Example: makedist 5.4.1 | ||
# Example: makedist 5.3.5RC1 | ||
# | ||
# To work, this script needs a consistent tagging of all releases. | ||
# Each release of a package should have a tag of the form | ||
# | ||
# php-X.Y.Z[sub] | ||
# | ||
# The distribution ends up in a .tar.gz file that contains the distribution | ||
# in a directory called php-<version>. | ||
# A .tar.bz2 file is also created. | ||
# Creates PHP release packages. | ||
# | ||
# Written by Stig Bakken <ssb@guardian.no> 1997-05-28. | ||
# Adapted to git by Stanislav Malyshev <stas@php.net> | ||
# Adapted to Git by Stanislav Malyshev <stas@php.net>. | ||
|
||
# Go to project root directory. | ||
cd $(CDPATH= cd -- "$(dirname -- "$0")/../../" && pwd -P) | ||
|
||
if test "$#" != "1"; then | ||
echo "Usage: makedist <version>" >&2 | ||
exit 1 | ||
fi | ||
|
||
VER=$1 ; shift | ||
# Process options and arguments. | ||
while :; do | ||
case $1 in | ||
-h|--help) | ||
cat << HELP | ||
PHP distribution generator | ||
Creates PHP release packages (tar.gz, tar.bz2, tar.xz) from the php-src Git | ||
repository. The snapshot archive includes also generated configure script, | ||
configuration headers, parsers, lexers, and similar generated files to simplify | ||
the installation on the *nix systems. | ||
SYNOPSIS: | ||
makedist [options] <tree-ish> | ||
OPTIONS: | ||
-h, --help Display this help. | ||
--remote=<repo> Instead of using a local repository, retrieve a tar archive | ||
from a remote repository. | ||
<tree-ish> The Git tree or Git commit to produce an archive for. This | ||
script needs a consistent tagging of releases. Each release | ||
of a package should have a tag of the form: | ||
php-X.Y.Z[alpha|beta|RC] | ||
or branch: | ||
PHP-X.Y[.Z] | ||
Where: | ||
- X is major version number | ||
- Y is minor version number | ||
- Z is patch version number | ||
- last part of tag is optional and is one of RC, alpha, or | ||
beta and belonging number. | ||
EXAMPLES: | ||
Create snapshot of the master branch: | ||
scripts/dev/makedist | ||
Create snapshot of the PHP-7.4 branch: | ||
scripts/dev/makedist PHP-7.4 | ||
Create release packages for the stable tag php-7.4.0: | ||
scripts/dev/makedist php-7.4.0 | ||
Create release candidate packages for the tag php-7.4.0RC1: | ||
scripts/dev/makedist php-7.4.0RC1 | ||
Create release packages from a remote Git repository for the tag php-7.4.0: | ||
scripts/dev/makedist --remote=git@git.php.net:php-src.git php-7.4.0 | ||
HELP | ||
exit | ||
;; | ||
--remote) | ||
# Check for an option argument. | ||
if test -n "$2"; then | ||
remote=$2 | ||
shift | ||
else | ||
echo "makedist: '--remote' requires a non-empty option argument." >&2 | ||
exit 1 | ||
fi | ||
;; | ||
--remote=?*) | ||
# Set everything after the "=". | ||
remote=${1#*=} | ||
;; | ||
--remote=) | ||
# When passing empty "--remote=" option. | ||
echo "makedist: '--remote' requires a non-empty option argument." >&2 | ||
exit 1 | ||
;; | ||
-?*) | ||
echo "makedist WARNING: Unknown option (ignored): '$1'" >&2 | ||
;; | ||
*) | ||
# When no more options, check for an argument and break out of the loop. | ||
if test -n "$1"; then | ||
treeish="$1" | ||
prefix="$treeish" | ||
elif test -z "$treeish"; then | ||
treeish="master" | ||
prefix="php-master-"$(date +"%Y-%m-%d-%H-%M") | ||
fi | ||
break | ||
esac | ||
|
||
shift | ||
done | ||
|
||
if test "x$PHPROOT" = "x"; then | ||
PHPROOT=git@git.php.net:php-src.git; | ||
# Verify that the temporary directory for the package files doesn't exist. | ||
if test -d "$prefix"; then | ||
echo "makedist: The directory $prefix" >&2 | ||
echo " already exists. Rename or remove it and run makedist again." >&2 | ||
exit 1 | ||
fi | ||
|
||
LT_TARGETS='build/ltmain.sh build/config.guess build/config.sub' | ||
|
||
if echo '\c' | grep -s c >/dev/null 2>&1 | ||
then | ||
ECHO_N="echo -n" | ||
ECHO_C="" | ||
if test -n "$remote"; then | ||
remote_option="--remote=$remote" | ||
git=$remote | ||
else | ||
ECHO_N="echo" | ||
ECHO_C='\c' | ||
fi | ||
|
||
MY_OLDPWD=`pwd` | ||
|
||
# the destination .tar.gz file | ||
ARCHIVE=$MY_OLDPWD/php-$VER.tar | ||
|
||
# temporary directory used to check out files from SVN | ||
DIR=php-$VER | ||
DIRPATH=$MY_OLDPWD/$DIR | ||
echo "makedist: Verifying that tree-ish $treeish exists in Git repository." | ||
git rev-parse --verify $treeish | ||
exit_code=$? | ||
if test "$exit_code" != "0"; then | ||
echo "makedist: $treeish is not found in the Git repository." >&2 | ||
exit $exit_code | ||
else | ||
echo "makedist: OK" | ||
fi | ||
|
||
if test -d "$DIRPATH"; then | ||
echo "The directory $DIR" >&2 | ||
echo "already exists, rename or remove it and run makedist again." >&2 | ||
exit 1 | ||
git="current Git repository." | ||
fi | ||
|
||
# Export PHP | ||
$ECHO_N "makedist: exporting tag 'php-$VER' from '$PHPROOT'...$ECHO_C" | ||
git archive --format=tar --remote=$PHPROOT refs/tags/php-$VER --prefix=php-$VER/ | (cd $MY_OLDPWD; tar xvf -) || exit 4 | ||
echo "" | ||
|
||
cd $DIR || exit 5 | ||
# Export PHP. | ||
echo "makedist: Exporting $treeish from $git" | ||
git archive --format=tar $remote_option --prefix=$prefix/ $treeish | tar xvf - || exit 4 | ||
|
||
# hide away our own versions of libtool-generated files | ||
for i in $LT_TARGETS; do | ||
if test -f "$i"; then | ||
mv $i $i.bak | ||
cp $i.bak $i | ||
fi | ||
done | ||
cd $prefix || exit 5 | ||
|
||
# generate some files so people don't need bison, re2c and autoconf | ||
# to install | ||
set -x | ||
# Generate configure script so autoconf is not required to install. | ||
echo "" | ||
echo "makedist: Generating files." | ||
./buildconf --force | ||
|
||
# Generate lexer and parser files | ||
# Generate lexer and parser files so bison and re2c aren't required to install. | ||
./scripts/dev/genfiles | ||
exit_code=$? | ||
if test "$exit_code" != "0"; then | ||
exit $exit_code | ||
fi | ||
|
||
# now restore our versions of libtool-generated files | ||
for i in $LT_TARGETS; do | ||
test -f "$i" && mv $i.bak $i | ||
done | ||
|
||
# removing junk files | ||
rm -fr autom4te.cache/ | ||
# Remove not needed files. | ||
rm -rf autom4te.cache/ | ||
|
||
# touching everything to be packaged | ||
find $MY_OLDPWD/php-$VER -exec touch -c {} \; | ||
|
||
# tweak zendparse to be exported through ZEND_API | ||
# NOTE this has to be revisited once bison supports foreign skeletons | ||
# and that bison version is used. Read /usr/share/bison/README for more | ||
sed -i 's,^int zendparse\(.*\),ZEND_API int zendparse\1,g' $MY_OLDPWD/php-$VER/Zend/zend_language_parser.c | ||
sed -i 's,^int zendparse\(.*\),ZEND_API int zendparse\1,g' $MY_OLDPWD/php-$VER/Zend/zend_language_parser.h | ||
sed -i 's,^#ifndef YYTOKENTYPE,#include "zend.h"\n#ifndef YYTOKENTYPE,g' $MY_OLDPWD/php-$VER/Zend/zend_language_parser.h | ||
|
||
# download pear | ||
$ECHO_N "makedist: Attempting to download PEAR's phar archive" | ||
# Download PEAR. | ||
echo "" | ||
echo "makedist: Attempting to download PEAR's phar archive." | ||
if test ! -x wget; then | ||
wget https://pear.php.net/install-pear-nozlib.phar -nd -P pear/ | ||
if [ "x$?" != "x0" ] | ||
then | ||
$ECHO_N "Pear download failed"; | ||
exit 7 | ||
if [ "x$?" != "x0" ]; then | ||
echo "makedist: PEAR download failed." >&2 | ||
exit 1 | ||
fi | ||
else | ||
$ECHO_N "Missing wget binary needed for pear download"; | ||
exit 7 | ||
echo "makedist: Missing wget binary needed for PEAR download." >&2 | ||
exit 1 | ||
fi | ||
|
||
cd $MY_OLDPWD | ||
$ECHO_N "makedist: making gzipped tar archive...$ECHO_C" | ||
rm -f $ARCHIVE.gz | ||
tar cf $ARCHIVE php-$VER || exit 8 | ||
gzip -9 $ARCHIVE || exit 9 | ||
echo "" | ||
# Reset the modification and access times of all files to be packaged. | ||
echo "makedist: Resetting the modification and access times of package files." | ||
find . -exec touch -c {} \; | ||
|
||
$ECHO_N "makedist: making bz2zipped tar archive...$ECHO_C" | ||
rm -f $ARCHIVE.bz2 | ||
tar cf $ARCHIVE php-$VER || exit 10 | ||
bzip2 -9 $ARCHIVE || exit 11 | ||
echo "" | ||
cd .. | ||
|
||
$ECHO_N "makedist: making xz2zipped tar archive...$ECHO_C" | ||
rm -f $ARCHIVE.xz | ||
tar cf $ARCHIVE php-$VER || exit 10 | ||
xz -9 $ARCHIVE || exit 12 | ||
echo "" | ||
echo "makedist: Creating $prefix.tar archive." | ||
tar cf "$prefix".tar "$prefix" | ||
rm -rf "$prefix" "$prefix".tar.* | ||
|
||
$ECHO_N "makedist: cleaning up...$ECHO_C" | ||
rm -rf $DIRPATH || exit 13 | ||
echo "" | ||
echo "makedist: Creating $prefix.tar.gz archive." | ||
gzip -9 -k "$prefix".tar || exit 6 | ||
md5sum "$prefix".tar.gz | ||
gzip -t "$prefix".tar.gz | ||
|
||
sync | ||
sleep 2 | ||
|
||
echo "makedist: Creating $prefix.tar.bz2 archive." | ||
bzip2 -9 -k $prefix.tar || exit 7 | ||
md5sum $prefix.tar.bz2 | ||
bzip2 -t $prefix.tar.bz2 | ||
|
||
exit 0 | ||
sync | ||
sleep 2 | ||
|
||
echo "makedist: Creating $prefix.tar.xz archive." | ||
xz -9 -k "$prefix".tar || exit 9 | ||
md5sum "$prefix".tar.xz | ||
xz -t "$prefix".tar.xz | ||
|
||
echo "" | ||
echo "makedist: Cleaning up." | ||
rm -f "$prefix".tar || exit 13 | ||
echo "" | ||
echo "makedist: All done." |
This file was deleted.
Oops, something went wrong.