Browse Source

RPM: update build scripts

François Andriot 3 months ago
parent
commit
d036de9c62

+ 2
- 1
redhat/build/build_rpm_package.sh View File

@@ -6,7 +6,8 @@
6 6
 
7 7
 PKGNAME="${1%/}"
8 8
 PKGNAME="${PKGNAME##*/}"
9
-TDE_VERSION="${2:-14.0.0}"
9
+TDE_VERSION="${2:-${TDE_VERSION:-14.0.5}}"
10
+PATH="$(cd $(dirname $0); pwd):${PATH}"
10 11
 
11 12
 SPECFILE=$(get_specfile.sh ${PKGNAME} ${TDE_VERSION})
12 13
 VERSION=$(get_latest_tarball_version.sh ${PKGNAME} ${TDE_VERSION} || :)

+ 1
- 1
redhat/build/configure_repository.sh View File

@@ -1,6 +1,6 @@
1 1
 #!/bin/bash -x
2 2
 
3
-TDE_VERSION=${1:-14.0.0}
3
+TDE_VERSION="${1:-${TDE_VERSION:-14.0.5}}"
4 4
 ARCH=$(rpm -E %_target_cpu)
5 5
 RPMDIR=$(rpm -E %{_rpmdir}.tde-${TDE_VERSION})
6 6
 

+ 1
- 1
redhat/build/gather_rpm_sources.sh View File

@@ -5,7 +5,7 @@
5 5
 
6 6
 PKGNAME="${1%/}"
7 7
 PKGNAME="${PKGNAME##*/}"
8
-TDE_VERSION="${2:-14.0.5}"
8
+TDE_VERSION="${2:-${TDE_VERSION:-14.0.5}}"
9 9
 TARGETDIR="${3:-/tmp/${PKGNAME}-${TDE_VERSION}}"
10 10
 DIST="$4"
11 11
 

+ 1
- 1
redhat/build/get_latest_built_package_filename.sh View File

@@ -2,7 +2,7 @@
2 2
 
3 3
 PKGNAME="$1"
4 4
 [ -z "${PKGNAME}" ] && echo "You must specify a package name !" && exit 1
5
-TDE_VERSION="${2:-14.0.0}"
5
+TDE_VERSION="${2:-${TDE_VERSION:-14.0.5}}"
6 6
 
7 7
 RPMDIR="$(rpm -E %{_rpmdir}.tde-${TDE_VERSION})"
8 8
 RPMDIR_ARCH="${RPMDIR}/$(rpm -E %_target_cpu)"

+ 1
- 1
redhat/build/get_latest_built_package_version.sh View File

@@ -1,7 +1,7 @@
1 1
 #!/bin/bash
2 2
 
3 3
 PKGNAME="$1"
4
-TDE_VERSION="${2:-14.0.0}"
4
+TDE_VERSION="${2:-${TDE_VERSION:-14.0.5}}"
5 5
 
6 6
 [ -z "${PKGNAME}" ] && echo "You must specify a package name !" && exit 1
7 7
 

+ 1
- 1
redhat/build/get_latest_tarball_filename.sh View File

@@ -1,7 +1,7 @@
1 1
 #!/bin/bash
2 2
 
3 3
 PKGNAME="${1##*/}"
4
-TDE_VERSION="${2:-14.0.0}"
4
+TDE_VERSION="${2:-${TDE_VERSION:-14.0.5}}"
5 5
 
6 6
 [ -z "${PKGNAME}" ] && echo "You must specify a package name !" && exit 1
7 7
 [ -d "${TARBALLS_DIR}" ] || TARBALLS_DIR=~/tde/tarballs/${TDE_VERSION}/

+ 1
- 1
redhat/build/get_latest_tarball_version.sh View File

@@ -1,7 +1,7 @@
1 1
 #!/bin/bash
2 2
 
3 3
 PKGNAME="${1##*/}"
4
-TDE_VERSION="${2:-14.0.0}"
4
+TDE_VERSION="${2:-${TDE_VERSION:-14.0.5}}"
5 5
 
6 6
 [ -z "${PKGNAME}" ] && echo "You must specify a package name !" && exit 1
7 7
 

+ 1
- 1
redhat/build/get_source_files.sh View File

@@ -1,7 +1,7 @@
1 1
 #!/bin/bash
2 2
 
3 3
 PKGNAME="${1##*/}"
4
-TDE_VERSION="${2:-14.0.5}"
4
+TDE_VERSION="${2:-${TDE_VERSION:-14.0.5}}"
5 5
 DIST="$3"
6 6
 
7 7
 [ -z "${PKGNAME}" ] && echo "You must specify a package name !" && exit 1

+ 1
- 1
redhat/build/get_spec_version.sh View File

@@ -1,7 +1,7 @@
1 1
 #!/bin/bash
2 2
 
3 3
 PKGNAME="${1##*/}"
4
-TDE_VERSION="${2:-14.0.0}"
4
+TDE_VERSION="${2:-${TDE_VERSION:-14.0.5}}"
5 5
 
6 6
 [ -z "${PKGNAME}" ] && echo "You must specify a package name !" && exit 1
7 7
 

+ 3
- 3
redhat/build/get_specfile.sh View File

@@ -1,12 +1,12 @@
1 1
 #!/bin/bash
2 2
 
3 3
 PKGNAME="${1##*/}"
4
-TDE_VERSION="${2:-14.0.5}"
4
+TDE_VERSION="${2:-${TDE_VERSION:-14.0.5}}"
5 5
 
6 6
 [ -z "${PKGNAME}" ] && echo "You must specify a package name !" && exit 1
7 7
 
8
-[ -d "${TDE_PACKAGING_DIR}" ] || TDE_PACKAGING_DIR=~/tde/master/tde-packaging
9
-[ -d "${DIST_PACKAGING_DIR}" ] || DIST_PACKAGING_DIR=${TDE_PACKAGING_DIR}/redhat
8
+[ -d "${TDE_PACKAGING_DIR}" ] || TDE_PACKAGING_DIR="${HOME}/tde/${TDE_BRANCH:-master}/tde-packaging"
9
+[ -d "${DIST_PACKAGING_DIR}" ] || DIST_PACKAGING_DIR="${TDE_PACKAGING_DIR}/redhat"
10 10
 
11 11
 # Special case for QT3
12 12
 if [ "${PKGNAME}" = "qt3" ]; then

+ 1
- 1
redhat/build/is_latest_package_built.sh View File

@@ -1,7 +1,7 @@
1 1
 #!/bin/bash
2 2
 
3 3
 PKGNAME="${1##*/}"
4
-TDE_VERSION="${2:-14.0.0}"
4
+TDE_VERSION="${2:-${TDE_VERSION:-14.0.5}}"
5 5
 
6 6
 BUILT=$(get_latest_built_package_version.sh ${PKGNAME} ${TDE_VERSION})
7 7
 TARBALL=$(get_latest_tarball_version.sh ${PKGNAME} ${TDE_VERSION})

+ 1
- 1
redhat/build/is_latest_package_installed.sh View File

@@ -1,7 +1,7 @@
1 1
 #!/bin/bash
2 2
 
3 3
 PKGNAME="${1##*/}"
4
-TDE_VERSION="${2:-14.0.0}"
4
+TDE_VERSION="${2:-${TDE_VERSION:-14.0.5}}"
5 5
 
6 6
 INSTALLED=$(get_installed_package_version.sh ${PKGNAME} ${TDE_VERSION})
7 7
 TARBALL=$(get_latest_tarball_version.sh ${PKGNAME} ${TDE_VERSION})

+ 0
- 3
redhat/build/is_rpm_built.sh View File

@@ -1,3 +0,0 @@
1
-#!/bin/bash -x
2
-
3
-RPMDIR=$(rpm -E %_rpmdir)

+ 1
- 1
redhat/build/update_repository.sh View File

@@ -1,7 +1,7 @@
1 1
 #!/bin/bash
2 2
 
3 3
 WORKERS=$(getconf _NPROCESSORS_ONLN)
4
-TDE_VERSION="${1:-14.0.0}"
4
+TDE_VERSION="${2:-${TDE_VERSION:-14.0.5}}"
5 5
 
6 6
 LOCKFILE="/tmp/lock.${0##*/}"
7 7
 while [ -e "${LOCKFILE}" ]; do

+ 0
- 114
redhat/buildenv.sh View File

@@ -1,114 +0,0 @@
1
-#!/bin/bash
2
-
3
-# This file can be sourced in your .bashrc
4
-
5
-BRANCH="$(git rev-parse --abbrev-ref HEAD)"
6
-TDE_BASEDIR="${HOME}/tde"
7
-[ -z "${TDE_VERSION}" ] && TDE_VERSION="14.0.5"
8
-TDE_GITBASESRC=${TDE_BASEDIR}/${BRANCH}/tde
9
-[ -d "${TDE_PACKAGING_DIR}" ] || export TDE_PACKAGING_DIR="${TDE_BASEDIR}/${BRANCH}/tde-packaging"
10
-TDE_GITBASEPKG="${TDE_PACKAGING_DIR}/redhat"
11
-TDE_TARBALLS="${TDE_BASEDIR}/tde-tarballs/${TDE_VERSION}"
12
-
13
-
14
-export PATH="${PATH}:${TDE_GITBASEPKG}/build"
15
-
16
-# Distribution suffix (e.g: .el6 , .mga3 ...)
17
-export DIST="$( "${TDE_GITBASEPKG}/build/rpmdist.sh" --dist )"
18
-
19
-# Go to the RPMS folder
20
-alias cdrpm='cd ${HOME}/rpmbuild/RPMS/RPMS${DIST}'
21
-
22
-# Build a single tarball (execute from GIT directory)
23
-alias tdp4='TARGET=${TDE_VERSION} SUFFIX=0 TARBALL_DIR=${TDE_TARBALLS}/main COMPRESS=gzip ${TDE_GITBASESRC}/scripts/create_tarball'
24
-
25
-# Rebuild all tarballs
26
-if [ -x /usr/bin/pigz ]; then
27
-  export TDE_COMPRESS=pigz
28
-else
29
-  export TDE_COMPRESS=gzip
30
-fi
31
-alias tdep3='(rm -rf ~/tde/tde-tarballs/3.5.13.2; cd ~/tde/tde_v3.5.13-sru; export SUFFIX=0; export COMPRESS=${TDE_COMPRESS:-gzip}; export TDE_REBRAND=1; ./scripts/create_all_tarballs)'
32
-alias tdep4='(cd ${TDE_GITBASESRC}; export SUFFIX=0; export COMPRESS=${TDE_COMPRESS:-gzip}; export TDE_REBRAND=1; ./scripts/create_all_tarballs)'
33
-
34
-# Build a single package
35
-alias cdp='cd $HOME/tde/tde-packaging/redhat'
36
-
37
-grp3() {
38
-  build_rpm_package.sh "${1}" "3.5.13.2"
39
-}
40
-
41
-grp4() {
42
-  build_rpm_package.sh "${1}" "${TDE_VERSION}"
43
-}
44
-
45
-# Check if tarballs are more recent than installed packages
46
-checknew() {
47
-  find ~/tde/tde-tarballs/${TDE_VERSION} -name "trinity-*.tar.gz" | while read f; do
48
-    TAR="${f##*/}"
49
-    NAME="${TAR%-*}"
50
-    
51
-    if rpm -q "${NAME}" &>/dev/null; then
52
-      set $(rpm -q --qf "%{name} ${TDE_VERSION} %{release}" ${NAME} )
53
-      B="$1-$2~${3#*_}"
54
-      A=${TAR%.tar.gz}
55
-      B=${B%.opt}
56
-      B=${B%${DIST}}
57
-      if [[ "$A" > "$B" ]]; then
58
-        echo "Installed: $B"
59
-        echo "Available: $A"
60
-        echo
61
-      fi
62
-    fi
63
-  done
64
-}
65
-
66
-
67
-do_optimizegraphics() {
68
-  if ! (which optipng && which advdef && which pngout) ; then
69
-    echo "Missing utility ! Check that 'optipng', 'advdef' and 'pngout' utilities are available !"
70
-    return 1
71
-  fi
72
-  
73
-  while read m; do
74
-    if [ -d "${m}" ]; then
75
-      pushd "${m}"
76
-      if [ -r .optimizegraphics ]; then
77
-        echo "Graphics are already optimized !"
78
-      else
79
-        optimizegraphics
80
-        touch .optimizegraphics
81
-      fi
82
-      popd
83
-    fi
84
-  done < submodules
85
-}
86
-
87
-alias rr='rpm -qa --qf "%{name}|%{buildhost}|%{packager}\n" | grep -e "\(\.vtf\|andriot\)"|cut -d"|" -f1 | sort'
88
-
89
-# Update main repository
90
-alias tdu='(export GIT_ASKPASS=/bin/true; cd ~/tde/tde_master; ./scripts/switch_all_submodules_to_head_and_clean)'
91
-
92
-# Build local repository metadata (Mageia)
93
-alias cru='(cdrpm; genhdlist2 --allow-empty-media noarch; genhdlist2 $(uname -i); sudo urpmi.update rpmbuild.$(uname -i) rpmbuild.noarch)'
94
-alias cruc='(cdrpm; genhdlist2 --clean --allow-empty-media  noarch; genhdlist2 --clean $(uname -i); sudo urpmi.update rpmbuild.$(uname -i) rpmbuild.noarch)'
95
-
96
-# Build local repository (RHEL)
97
-alias cry='(cdrpm; createrepo $(uname -i); createrepo noarch; sudo yum clean all --disablerepo="*" --enablerepo="rpmbuild*")'
98
-alias sy='sudo yum localinstall -y --nogpgcheck'
99
-
100
-# Build local repository (openSUSE)
101
-alias crz='(cdrpm; createrepo $(uname -i); createrepo noarch; sudo zypper refresh)'
102
-
103
-# Build local repository (PCLOS)
104
-alias cra='(cdrpm; genpkglist $PWD noarch; genpkglist $PWD i586; genpkglist $PWD x86_64; genbasedir $PWD i586 x86_64 noarch; sudo apt-get update)'
105
-alias crac='(cdrpm; for i in i586 noarch x86_64; do cd $i; tdesortrpm.sh; cd -; done; rpmsign --addsign */RPMS.*/*.rpm; for i in i586 noarch x86_64; do for j in 3rdparty applications dependencies extras libraries main; do genpkglist $PWD/$i $j; done; done; for i in i586 noarch x86_64; do genbasedir $PWD/$i 3rdparty applications dependencies extras libraries main; done; sudo apt-get update)'
106
-alias cras='(cdrpm; cd $(uname -i); rm -rf base; mkdir base; for i in 3rdparty applications dependencies extras libraries main; do genpkglist $PWD $i; done; genbasedir $PWD 3rdparty applications dependencies extras libraries main; cd ../noarch; rm -rf base; mkdir base; for i in applications dependencies extras main; do genpkglist $PWD $i; done; genbasedir $PWD applications dependencies extras main )'
107
-
108
-# Reinstall packages (Mageia)
109
-getrpmfromsrpm() {
110
-  rpm -qa --qf "%{name} %{sourcerpm}\n"|grep "$1"|awk '{print $1}'
111
-}
112
-reinst() {
113
-  sudo urpmi --replacepkgs --allow-force $(getrpmfromsrpm $1)
114
-}

Loading…
Cancel
Save