Warning, file /office/kmymoney/packaging/release-windows-packages was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 #!/bin/sh 0002 # 0003 # unpack windows rpm's from opensuse download server, upload files to kde.org and file a related release ticket 0004 # 0005 # Author: Ralf Habacker <ralf.habacker@freenet.de> 0006 # 0007 # requirements: 0008 # 0009 # osc - opensuse build service command line client 0010 # 0011 # syntax: release-windows-packages [<options>] <mode> 0012 # 0013 # run ./release-windows-packages to see all modes and options 0014 # 0015 NAME=kmymoney5 0016 # package name on download.kde.org 0017 RELEASE_NAME=kmymoney 0018 0019 PACKAGENAME32=mingw32-$NAME 0020 ROOT32=windows\:mingw\:win32 0021 ARCHOUT32=i686-w64-mingw32 0022 use32=1 0023 0024 PACKAGENAME64=mingw64-$NAME 0025 ROOT64=windows\:mingw\:win64 0026 ARCHOUT64=x86_64-w64-mingw32 0027 use64=1 0028 0029 REPO=openSUSE_Leap_15.3 0030 SRCREPO=$REPO 0031 usesrc=0 0032 0033 PHABURL=https://phabricator.kde.org 0034 oscoptions="-A https://api.opensuse.org" 0035 apitoken=cli-uxo23l4q5qrzoyscbz5kp4zcngqp 0036 options='projectPHIDs[]=PHID-PROJ-3qa4tomwgrmcmp4ym2ow' 0037 0038 # abort on errors 0039 set -e 0040 0041 echo2() { printf "%s\n" "$*" >&2; } 0042 0043 which 7z >/dev/null 2>&1 0044 if test $? -ne 0; then 0045 echo "7z not found, run 'zypper install p7zip'" 0046 exit 1 0047 fi 0048 0049 self=$(realpath $0) 0050 0051 if ! test -d "work"; then 0052 mkdir work 0053 fi 0054 0055 echo2 "running mode $1" 0056 dryrun=0 0057 update=0 0058 update_symlink=0 0059 curl=curl 0060 branch=stable 0061 0062 # check options 0063 for var in "$@"; do 0064 case $var in 0065 --update-32) ## update i686 variant 0066 use64=0 0067 usesrc=0 0068 update=1 0069 shift 0070 ;; 0071 0072 --update-64) ## update x86_64 variant 0073 use32=0 0074 usesrc=0 0075 update=1 0076 shift 0077 ;; 0078 0079 --symlink) ## update 'latest' symbolic link 0080 update_symlink=1 0081 shift 0082 ;; 0083 0084 --unstable) ## release unstable version 0085 branch=unstable 0086 ROOT32=home\:rhabacker\:branches\:windows\:mingw\:win32\:$NAME 0087 ROOT64=home\:rhabacker\:branches\:windows\:mingw\:win64\:$NAME 0088 shift 0089 ;; 0090 0091 --dryrun) ## simulate upload only 0092 dryrun=1 0093 curl="echo curl" 0094 shift 0095 ;; 0096 esac 0097 done 0098 0099 SRCROOT32=${ROOT32} 0100 SRCROOT64=${ROOT64} 0101 0102 function clean() { 0103 rm -rf work/* 0104 } 0105 0106 function download() { 0107 cd work 0108 rm -rf binaries 0109 if test $use32 -eq 1; then 0110 osc $oscoptions getbinaries $ROOT32 $PACKAGENAME32:$PACKAGENAME32-installer $REPO x86_64 0111 VERSION=$(find binaries/ -name "*$PACKAGENAME32-setup*" | sed "s,^.*$PACKAGENAME32-setup-,,g;s,-.*$,,g") 0112 echo $VERSION > VERSION 0113 fi 0114 if test $use64 -eq 1; then 0115 osc $oscoptions getbinaries $ROOT64 $PACKAGENAME64:$PACKAGENAME64-installer $REPO x86_64 0116 VERSION=$(find binaries/ -name "*$PACKAGENAME64-setup*" | sed "s,^.*$PACKAGENAME64-setup-,,g;s,-.*$,,g") 0117 echo $VERSION > VERSION 0118 fi 0119 cd .. 0120 if test $usesrc -eq 1; then 0121 downloadsrc 0122 fi 0123 touch work/$1.finished 0124 } 0125 0126 function getversion() { 0127 if ! test -f work/VERSION; then 0128 echo "no version found" 0129 exit 1; 0130 fi 0131 VERSION=$(cat work/VERSION) 0132 } 0133 0134 function downloadsrc() { 0135 cd work 0136 # fetch source package 0137 src32pkg=$(osc $oscoptions ls -b -r $SRCREPO -a x86_64 $SRCROOT32 $PACKAGENAME32 | grep src) 0138 osc $oscoptions getbinaries --sources $SRCROOT32 $PACKAGENAME32 $SRCREPO x86_64 $src32pkg 0139 # we only need once source package 0140 #src64pkg=$(osc $oscoptions ls -b -r $SRCREPO -a x86_64 $SRCROOT64 mingw64-umbrello | grep src) 0141 #osc $oscoptions getbinaries --sources $SRCROOT64 mingw64-umbrello $SRCREPO x86_64 $src64pkg 0142 # fetch debug packages 0143 debug32pkg=$(osc $oscoptions ls -b -r $SRCREPO -a x86_64 $SRCROOT32 $PACKAGENAME32 | grep debug) 0144 osc $oscoptions getbinaries $SRCROOT32 $PACKAGENAME32 $SRCREPO x86_64 $debug32pkg 0145 if test -n "$ROOT64"; then 0146 debug64pkg=$(osc $oscoptions ls -b -r $SRCREPO -a x86_64 $SRCROOT64 $PACKAGENAME64 | grep debug) 0147 osc $oscoptions getbinaries $SRCROOT64 $PACKAGENAME64 $SRCREPO x86_64 $debug64pkg 0148 fi 0149 cd .. 0150 touch $1.finished 0151 } 0152 0153 function unpack() { 0154 getversion 0155 cd work 0156 files=$(cd binaries; find -name '*setup*' -o -name '*portable*' -o -name '*src*' -o -name '*debugpackage*' | grep "$VERSION" | sed 's,^.,binaries,g') 0157 if test -d tmp; then 0158 rm -rf tmp 0159 fi 0160 mkdir -p tmp 0161 for i in $(echo $files); do 0162 (cd tmp; rpm2cpio ../$i | cpio -idmv) 0163 done 0164 cd .. 0165 touch $1.finished 0166 } 0167 0168 function movepackage() { 0169 cd work 0170 rm -rf out 0171 mkdir -p out 0172 for i in $(find tmp/ -type f -name '*.exe' -o -name '*.7z' -o -name '*.xz'); do 0173 on=$(basename $i | sed 's,lp..,,g'); 0174 cp $i out/$on 0175 done 0176 cd .. 0177 touch $1.finished 0178 } 0179 0180 function repacksource() { 0181 # repackage source package 0182 srcfile=$(find work/tmp -name "$NAME*.xz") 0183 outfile=$(basename $srcfile | sed 's,\.tar\.xz,\.7z,g') 0184 (mkdir -p work/srctmp; cd work/srctmp; tar -xJf ../../$srcfile; 7za a ../out/$outfile *; cd ..; rm -rf srctmp) 0185 touch work/$1.finished 0186 } 0187 0188 function createsha() { 0189 (cd work/out; find -type f -name '*.7z' -o -name '*.exe' -o -name '*.xz' | sed 's,\./,,g' | sort | xargs sha256sum > $NAME.sha256sum) 0190 touch work/$1.finished 0191 } 0192 0193 function upload() { 0194 for i in $(find work/out -name '*.7z' -o -name '*.exe' -o -name '*.xz'); do 0195 $curl -T $i ftp://upload.kde.org/incoming/ 0196 if test $? -ne 0; then 0197 echo "upload failed" 0198 exit 1 0199 fi 0200 done 0201 touch work/$1.finished 0202 } 0203 0204 function createdescription() { 0205 getversion 0206 description="Please move the $RELEASE_NAME related files which have been uploaded to upload.kde.org/incoming to download mirror '$branch/$RELEASE_NAME/$VERSION' location" 0207 if test $update -eq 1; then 0208 description="$description and remove the old files from this directory." 0209 elif test $update_symlink -eq 1; then 0210 description="$description and update the symbolic link '$branch/$RELEASE_NAME/latest' to '$branch/$RELEASE_NAME/$VERSION'." 0211 else 0212 description="$description." 0213 fi 0214 sums=$(cat work/out/$NAME.sha256sum | gawk 'BEGIN { print "dir shasum file"} $2 ~ /mingw32/ { print "win32 " $0 } $2 ~ /mingw64/ { print "win64 " $0 } $2 ~ /\-src/ { print "src " $0 }') 0215 echo -e "$description\n\n$sums" > work/description 0216 cat work/description 0217 touch work/$1.finished 0218 } 0219 0220 function ticket() { 0221 getversion 0222 description=$(cat work/description) 0223 $curl $PHABURL/api/maniphest.createtask \ 0224 -d api.token=$apitoken \ 0225 -d "title=tarball move request for $branch/$RELEASE_NAME/$VERSION" \ 0226 -d "description=$description" \ 0227 -d "$options" 0228 touch work/$1.finished 0229 } 0230 0231 function sf() { 0232 clean 0233 download 0234 unpack 0235 movepackage 0236 if test $usesrc -eq 1; then 0237 repacksource 0238 fi 0239 createsha 0240 echo "All release related files are located in work/out" 0241 ls work/out 0242 touch work/$1.finished 0243 } 0244 0245 function kde() { 0246 clean 0247 download 0248 unpack 0249 movepackage 0250 if test $usesrc -eq 1; then 0251 repacksource 0252 fi 0253 createsha 0254 upload 0255 echo "Content for ticket creating:" 0256 createdescription 0257 echo run "$0 ticket" to submit ticket 0258 touch work/$1.finished 0259 } 0260 0261 function help() { 0262 echo "syntax: release-windows-packages [<options>] <mode>" 0263 echo 0264 echo "options:" 0265 gawk '$0 ~ /^--[a-z].*) ##/ { sub(/) ##/,"",$0); a = $1; $1 = ""; printf(" %-20s - %s\n",a, $0); }' $0 0266 echo 0267 echo "modes:" 0268 gawk '$0 ~ /^[a-z].*) ##/ { sub(/) ##/,"",$0); a = $1; $1 = ""; printf(" %-20s - %s\n",a, $0); }' $0 0269 0270 } 0271 0272 case $1 in 0273 clean) ## clean working area 0274 clean; 0275 ;; 0276 0277 download) ## download rpm packages 0278 download 0279 ;; 0280 0281 downloadsrc) ## download source 0282 downloadsrc 0283 ;; 0284 0285 unpack) ## unpack rpm files 0286 unpack 0287 ;; 0288 0289 movepackage) ## move windows binary packages into upload folder 0290 movepackage 0291 ;; 0292 0293 repacksource) ## repackage source tar ball to 7z 0294 repacksource 0295 ;; 0296 0297 createsha) ## create sha256sums 0298 createsha 0299 ;; 0300 0301 upload) ## upload files to staging area 0302 upload 0303 ;; 0304 0305 createdescription) ## create ticket description 0306 createdescription 0307 ;; 0308 0309 ticket) ## submit phabricator ticket 0310 ticket 0311 ;; 0312 0313 sf) ## run all required targets for releasing on sourceforge 0314 sf 0315 ;; 0316 0317 kde) ## run all required targets for releasing on download.kde.org 0318 kde 0319 ;; 0320 *) 0321 help 0322 ;; 0323 esac 0324 0325 exit 0