1 #!/bin/sh 2 3 version=$(basename $(env - pwd)) || exit 1 4 case "$version" in 5 postfix-[0-9]*.[0-9]*.[0-9]*) 6 test -f conf/makedefs.out || { 7 echo "Error: no conf/makedefs.out" 1>&2; exit 1; } 8 grep 'CCARGS.*-DSNAPSHOT' conf/makedefs.out && { 9 echo "Error: stable release builds with -DSNAPSHOT" 1>&2; exit 1; } 10 grep 'CCARGS.*-DNONPROD' conf/makedefs.out && { 11 echo "Error: stable release builds with -DNONPROD" 1>&2; exit 1; } 12 mail_version=$(sh postfix-env.sh bin/postconf -h mail_version) || exit 1 13 test "postfix-$mail_version" = "$version" || { 14 echo "Error: version '$mail_version' in src/global/mail_version.h does not match version in pathname '$(env - pwd)'" 1>&2; exit 1; } 15 ;; 16 postfix-[0-9]*.[0-9]*-*nonprod*) 17 grep 'CCARGS.*-DNONPROD' conf/makedefs.out || { 18 echo "Error: non-prod release builds without -DNONPROD" 1>&2; exit 1; } 19 mail_version=$(sh postfix-env.sh bin/postconf -h mail_version) || exit 1 20 test "postfix-$mail_version" = "$version" || { 21 echo "Error: version '$mail_version' in src/global/mail_version.h does not match version in pathname '$(env - pwd)'" 1>&2; exit 1; } 22 ;; 23 postfix-[0-9]*.[0-9]*-*) 24 grep 'CCARGS.*-DNONPROD' conf/makedefs.out && { 25 echo "Error: snapshot release builds with -DNONPROD" 1>&2; exit 1; } 26 mail_version=$(sh postfix-env.sh bin/postconf -h mail_version) || exit 1 27 test "postfix-$mail_version" = "$version" || { 28 echo "Error: version '$mail_version' in src/global/mail_version.h does not match version in pathname '$(env - pwd)'" 1>&2; exit 1; } 29 ;; 30 esac 31