-
Notifications
You must be signed in to change notification settings - Fork 1
/
release
executable file
·57 lines (52 loc) · 2.22 KB
/
release
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
if [ $# != 1 ]
then
echo "Usage: $0 <version>" >&2
exit 1
fi
VERSION="$1"
AUTHOR="Julien Bigot <[email protected]>"
DEB_DATE="$(date -R)"
RPM_DATE="$(LC_ALL=C date "+%a %b %d %Y")"
DEB_PKG_VERSION="$(echo "${VERSION}"|sed 's/-/~/g')"
RPM_PKG_VERSION="$(echo "${VERSION}"|sed 's/-/~/g')"
BCF_SRC_VERSION="{upstream_version}"
RPM_SRC_VERSION="%{version}"
if [ "x${VERSION}" != "x${DEB_PKG_VERSION}" ]
then
BCF_SRC_VERSION="${VERSION}"
RPM_SRC_VERSION="${VERSION}"
fi
if [[ ! ${VERSION} =~ ^[0-9].* ]]
then
DEB_PKG_VERSION="$(date '+%s')${VERSION}"
BCF_SRC_VERSION="${VERSION}"
fi
if [ "x${VERSION}" == "xmaster" ]
then
AUTHOR="Pending release on master <[email protected]>"
sed "s/%changelog/%changelog\n\* ${RPM_DATE} - ${AUTHOR}\n- Upstream release master/" -i pdi*/*.spec
sed 1p -i pdi/debian/changelog pdiplugin*/debian/changelog
sed "1s/(.*$/(${DEB_PKG_VERSION}-1) unstable devel; urgency=medium\n\n * Upstream release ${VERSION}\n\n -- ${AUTHOR} ${DEB_DATE}\n/" -i pdi/debian/changelog pdiplugin*/debian/changelog
fi
sed \
"s%https://gitlab\.maisondelasimulation\.fr/pdidev/pdi/-/archive/[^/]*/pdi-[^/]*\.tar\.[a-zA-Z0-9]*%https://gitlab.maisondelasimulation.fr/pdidev/pdi/-/archive/${BCF_SRC_VERSION}/pdi-${BCF_SRC_VERSION}.tar.bz2%" \
-i build.conf
sed \
-e "s/Pending release on master <[email protected]> [A-Za-z]*, [0-9]* [A-Za-z]* [0-9]* [0-9]*:[0-9]*:[0-9]* +[0-9]*/${AUTHOR} ${DEB_DATE}/" \
-e "s/([0-9]*master-1)/(${DEB_PKG_VERSION}-1)/" \
-e "s/\* Upstream release master/* Upstream release ${VERSION}/" \
-i pdi/debian/changelog pdiplugin*/debian/changelog
sed \
-e "s#https://gitlab\.maisondelasimulation\.fr/pdidev/[^/]*/-/archive/[^/]*/[^/]*\.tar\.[a-zA-Z0-9]*#https://gitlab.maisondelasimulation.fr/pdidev/pdi/-/archive/${RPM_SRC_VERSION}/pdi-${RPM_SRC_VERSION}.tar.bz2#" \
-e "s/[A-Za-z]* [A-Za-z]* [0-9]* [0-9]* - Pending release on master <[email protected]>/${RPM_DATE} - ${AUTHOR}/" \
-e "s/Version: .*/Version: ${RPM_PKG_VERSION}/" \
-e "s/- Upstream release master/- Upstream release ${VERSION}/" \
-e "s/=\s*master\b/= %{version}/" \
-i pdi*/*.spec
if [ "x${VERSION}" != "x${RPM_PKG_VERSION}" ]
then
sed \
-e "s/%autosetup.*/%autosetup -n pdi-${VERSION}/" \
-i pdi*/*.spec
fi