11#! /usr/bin/env bash
22#
3- # Copyright (c) 2017 Nat! - Codeon GmbH
3+ # Copyright (c) 2017 Nat! - Mulle kybernetiK
44# All rights reserved.
55#
66# Redistribution and use in source and binary forms, with or without
3737# ./bin/release.sh -v -n --publisher mulle-nat --publisher-tap mulle-kybernetik/software/
3838#
3939
40- EXE_DIR=" ` dirname -- $0 ` "
41-
42- # if there is a release-info.sh file read it
43- if [ -f " ${EXE_DIR} /release-info.sh" ]
44- then
45- DO_GIT_RELEASE=" YES"
46- . " ${EXE_DIR} /release-info.sh"
47- fi
48-
49- # if there is a formula-info.sh file read it
50- if [ -f " ${EXE_DIR} /formula-info.sh" ]
51- then
52- DO_GENERATE_FORMULA=" YES"
53- . " ${EXE_DIR} /formula-info.sh"
54- fi
55-
56- #
57- # If there is a - possibly .gitignored - tap-info.sh file read it.
58- # It could store PUBLISHER and PUBLISHER_TAP
59- #
60- if [ -f " ${EXE_DIR} /tap-info.sh" ]
61- then
62- . " ${EXE_DIR} /tap-info.sh"
63- fi
64-
65-
6640# ######
67- # If you are using mulle-build, you don't hafta change anything after this
41+ # If you are using mulle-build, you don't hafta change anything
6842# ######
6943
7044#
@@ -76,15 +50,8 @@ generate_brew_formula_build()
7650 local name=" $2 "
7751 local version=" $3 "
7852
79- cat << EOF
80- def install
81- xcodebuild "install", "-target", "${project} ", "DSTROOT=/", "INSTALL_PATH=#{bin}"
82- end
83-
84- test do
85- system "#{bin}/${project} ", "-version"
86- end
87- EOF
53+ generate_brew_formula_mulle_build " ${project} " " ${name} " " ${version} "
54+ generate_brew_formula_mulle_test " ${project} " " ${name} " " ${version} "
8855}
8956
9057
@@ -106,18 +73,15 @@ generate_brew_formula()
10673 _generate_brew_formula " $@ "
10774}
10875
76+
10977# ######
11078# Ideally changes to the following values are done with the command line
11179# which makes it easier for forks.
11280# ######
11381
11482MULLE_BOOTSTRAP_FAIL_PREFIX=" ` basename -- $0 ` "
115- MULLE_HOMEBREW_VERSION=" 4.1.0 "
83+ MULLE_HOMEBREW_VERSION=" 5.2.1 "
11684
117- #
118- # prefer local mulle-homebrew if available
119- # Do not embed it anymore!
120- #
12185if [ -z " ` command -v mulle-homebrew-env` " ]
12286then
12387 cat << EOF >&2
13195INSTALLED_MULLE_HOMEBREW_VERSION=" ` mulle-homebrew-env version` " || exit 1
13296LIBEXEC_DIR=" ` mulle-homebrew-env libexec-path` " || exit 1
13397
98+ . " ${LIBEXEC_DIR} /mulle-files.sh" || exit 1
13499. " ${LIBEXEC_DIR} /mulle-homebrew.sh" || exit 1
135100. " ${LIBEXEC_DIR} /mulle-git.sh" || exit 1
136101. " ${LIBEXEC_DIR} /mulle-version.sh" || exit 1
@@ -141,7 +106,7 @@ main()
141106{
142107 if [ " ${DO_GIT_RELEASE} " != " YES" -a " ${DO_GENERATE_FORMULA} " != " YES" ]
143108 then
144- fail " Nothing to do. release -info.sh and formula-info.sh are missing"
109+ fail " Nothing to do! bin/version -info.sh and bin/ formula-info.sh are missing"
145110 fi
146111
147112 if [ " ${DO_GIT_RELEASE} " = " YES" ]
@@ -163,16 +128,36 @@ main()
163128 fi
164129
165130 # generate the formula and push it
166- homebrew_main " ${PROJECT} " \
167- " ${NAME} " \
168- " ${VERSION} " \
169- " ${DEPENDENCIES} " \
170- " ${BUILD_DEPENDENCIES} " \
171- " ${HOMEPAGE_URL} " \
172- " ${DESC} " \
173- " ${ARCHIVE_URL} " \
174- " ${HOMEBREW_TAP} " \
175- " ${RBFILE} "
131+ if ! homebrew_main " ${PROJECT} " \
132+ " ${NAME} " \
133+ " ${VERSION} " \
134+ " ${DEPENDENCIES} " \
135+ " ${BUILD_DEPENDENCIES} " \
136+ " ${HOMEPAGE_URL} " \
137+ " ${DESC} " \
138+ " ${ARCHIVE_URL} " \
139+ " ${HOMEBREW_TAP} " \
140+ " ${RBFILE} "
141+ then
142+ return 1
143+ fi
144+ fi
145+
146+ #
147+ # check if someone installed a post_release function
148+ # if yes call it (maybe calls mulle-homebrew-debian)
149+ #
150+ if [ " ` type -t post_release` " = " function" ]
151+ then
152+ post_release " ${PROJECT} " \
153+ " ${NAME} " \
154+ " ${VERSION} " \
155+ " ${DEPENDENCIES} " \
156+ " ${BUILD_DEPENDENCIES} " \
157+ " ${HOMEPAGE_URL} " \
158+ " ${DESC} " \
159+ " ${ARCHIVE_URL} " \
160+ " ${DEBIAN_DEPENDENCIES} "
176161 fi
177162}
178163
0 commit comments