From 0f06f905161c184920f4bd57796f055bf50387c1 Mon Sep 17 00:00:00 2001 From: Laurent Trinques Date: Wed, 25 Jan 2023 11:56:50 +0100 Subject: [PATCH] Refresh packaging_script_Debian_Ubuntu_Windows.sh example scripts --- packaging_script_Debian_Ubuntu_Windows.sh | 261 ++++++++++------------ 1 file changed, 119 insertions(+), 142 deletions(-) diff --git a/packaging_script_Debian_Ubuntu_Windows.sh b/packaging_script_Debian_Ubuntu_Windows.sh index 1f0e1c928..8edf90cfc 100644 --- a/packaging_script_Debian_Ubuntu_Windows.sh +++ b/packaging_script_Debian_Ubuntu_Windows.sh @@ -9,6 +9,10 @@ TEMP_DIR="$HOME" SSH_TARGET='scorpio810@ssh.tuxfamily.org:/home/qet/qelectrotech.org-web/htdocs/dl_link.inc.php' SSH_OPTIONS=-B +DEBEMAIL="scorpio@qelectrotech.org" +DEBFULLNAME="Laurent Trinques" +export DEBEMAIL DEBFULLNAME + cd $DEFAULT_DIR cd qet_git # get updates @@ -16,15 +20,16 @@ git pull --recurse-submodules GITCOMMIT=$(git rev-parse --short HEAD) -#Find Subversion revision number in trunk branch +#Count GIT commits revision number if [ -z "$HEAD" ] ; then A=$(git rev-list HEAD --count) +#sum of GIT count + old Subversion count commits HEAD=$(($A+473)) - # force displayed number + fi -VERSION=$(cat sources/qet.h | grep "const QString version" | cut -d\" -f2 | cut -d\" -f1) #Find version tag in Subversion sources/qet.h -tagName=$(cat sources/qet.h | grep displayedVersion | cut -d\" -f2 | cut -d\" -f1) #Find displayedVersion tag in Subversion sources/qet.h +VERSION=$(cat sources/qetversion.cpp | grep "return QVersionNumber{ 0, "| head -n 1| cut -c32-40| sed -e 's/,/./g' -e 's/ //g') #Find major, minor, and micro version numbers in sources/qetversion.cp + #clean /var/cache/pbuilder/ .. / result/debs echo -e "\033[1;31mWould you like to clean all debs n/Y?.\033[m" @@ -33,9 +38,7 @@ if [[ $a == "Y" || $a == "y" ]]; then echo -e "\033[1;31mClean_all_base_environment.\033[m" cd /var/cache/pbuilder/stable-amd64/result/ && sudo rm qe* cd /var/cache/pbuilder/unstable-amd64/result/ && sudo rm qe* - cd /var/cache/pbuilder/stable-i386/result/ && sudo rm qe* - cd /var/cache/pbuilder/unstable-i386/result/ && sudo rm qe* -else + else echo -e "\033[1;33mNo Clean_all_base_environment.\033[m" fi #clean all apt cache @@ -43,9 +46,7 @@ echo -e "\033[1;31mWould you like to clean all pbuilder n/Y?.\033[m" read a if [[ $a == "Y" || $a == "y" ]]; then echo -e "\033[1;31mClean_all_pbuilder_environment.\033[m" - DIST=stable ARCH=i386 sudo pbuilder --clean DIST=stable ARCH=amd64 sudo pbuilder --clean - DIST=unstable ARCH=i386 sudo pbuilder --clean DIST=unstable ARCH=amd64 sudo pbuilder --clean else echo -e "\033[1;33mNo Clean_all_pbuilder_environment.\033[m" @@ -56,8 +57,6 @@ echo -e "\033[1;31mWould you like to update all chroots n/Y?.\033[m" read a if [[ $a == "Y" || $a == "y" ]]; then echo -e "\033[1;33mUpdate_all_base_environment..\033[m" - sudo DIST=stable ARCH=i386 pbuilder update --override-config --configfile /home/laurent/.pbuilderrc - sudo DIST=sid ARCH=i386 pbuilder update --override-config --configfile /home/laurent/.pbuilderrc sudo DIST=stable pbuilder update --override-config --configfile /home/laurent/.pbuilderrc sudo DIST=sid pbuilder update --override-config --configfile /home/laurent/.pbuilderrc else @@ -70,7 +69,7 @@ cd $TEMP_DIR cp -r $DEFAULT_DIR/qet_git/ $TEMP_DIR/qelectrotech-$VERSION.r$HEAD/ rm -rf qelectrotech-$VERSION.r$HEAD/.git -#create svn tarball +#create GIT tarball tar cfvz qelectrotech-$VERSION.r$HEAD.tar.gz qelectrotech-$VERSION.r$HEAD/ #copy tarball in $DEFAULT_DIR @@ -113,13 +112,12 @@ fi cd debian/ && rm -rf *ex *EX README* -cd $DEFAULT_DIR/qelectrotech-$VERSION.r$HEAD/debian/patches/ -sed -i 's/'"$tagName+[0-9]*"'/'"$tagName+$GITCOMMIT"'/' 03_qet.diff +#cd $DEFAULT_DIR/qelectrotech-$VERSION.r$HEAD/debian/patches/ +#sed -i 's/'"$VERSION+[0-9]*"'/'"$VERSION+$GITCOMMIT"'/' 03_qet.diff #deplacement dans le paquet_qet cd $DEFAULT_DIR/qelectrotech-$VERSION.r$HEAD/ -quilt push -quilt push +quilt push -a -f quilt refresh echo -e "\033[1;31mWould you like to build Debian packages n/Y?.\033[m" @@ -129,25 +127,19 @@ if [[ $a == "Y" || $a == "y" ]]; then #build echo -e "\033[1;34mBuild_all_environements.\033[m" sudo DIST=sid ARCH=amd64 pdebuild --configfile /home/laurent/.pbuilderrc - sudo DIST=sid ARCH=i386 pdebuild --configfile /home/laurent/.pbuilderrc dch -i -D stable "Backport stable " && sudo DIST=stable ARCH=amd64 pdebuild --configfile /home/laurent/.pbuilderrc - sudo DIST=stable ARCH=i386 pdebuild --configfile /home/laurent/.pbuilderrc STRING="Build_all_environements is ready!!!" echo $STRING #prepare download copys cd $DEFAULT_DIR mkdir -p $HEAD/stable/amd64 - mkdir -p $HEAD/stable/i386 mkdir -p $HEAD/sid/amd64 - mkdir -p $HEAD/sid/i386 #copie des debs des results vers $HEAD find /var/cache/pbuilder/stable-amd64/result -name "qe*" -exec cp {} $DEFAULT_DIR/$HEAD/stable/amd64 \; - find /var/cache/pbuilder/stable-i386/result -name "qe*" -exec cp {} $DEFAULT_DIR/$HEAD/stable/i386 \; find /var/cache/pbuilder/unstable-amd64/result -name "qe*" -exec cp {} $DEFAULT_DIR/$HEAD/sid/amd64 \; - find /var/cache/pbuilder/unstable-i386/result -name "qe*" -exec cp {} $DEFAULT_DIR/$HEAD/sid/i386 \; #debsign echo -e "\033[1;31mWould you like to sign all packages n/Y?.\033[m" @@ -164,17 +156,7 @@ if [[ $a == "Y" || $a == "y" ]]; then debsign -k D3439F4E2273F7DCD3228C9EBC9F825E1D4FB6C1 *.changes echo -e "\033[1;33mAll sid amd64 are sign.\033[m" - #debsign stable i386 - cd $DEFAULT_DIR/$HEAD/stable/i386 - debsign -k D3439F4E2273F7DCD3228C9EBC9F825E1D4FB6C1 *.changes - echo -e "\033[1;33mAll stable i386 are sign.\033[m" - - #debsign sid i386 - cd $DEFAULT_DIR/$HEAD/sid/i386 - debsign -k D3439F4E2273F7DCD3228C9EBC9F825E1D4FB6C1 *.changes - echo -e "\033[1;33mAll sid i386 are sign.\033[m" - - else + else echo -e "\033[1;33mExit.\033[m" fi @@ -186,9 +168,7 @@ if [[ $a == "Y" || $a == "y" ]]; then cd ~/apt reprepro -vb . include unstable $DEFAULT_DIR/$HEAD/sid/amd64/*.changes - reprepro -vb . includedeb unstable $DEFAULT_DIR/$HEAD/sid/i386/*i386.deb reprepro -vb . include stable $DEFAULT_DIR/$HEAD/stable/amd64/*.changes - reprepro -vb . includedeb stable $DEFAULT_DIR/$HEAD/stable/i386/*i386.deb reprepro -b . export else @@ -222,153 +202,150 @@ echo -e "\033[1;31mWould you like to build Ubuntu PPA packages n/Y?.\033[m" read a if [[ $a == "Y" || $a == "y" ]]; then - #deplacement dans le paquet_qet - cd $DEFAULT_DIR/qelectrotech-$VERSION.r$HEAD/ +#deplacement dans le paquet_qet +cd $DEFAULT_DIR/qelectrotech-$VERSION.r$HEAD/ - dch -i -D bionic "Bionic Upload to ppa" - debuild -S -sa -kD3439F4E2273F7DCD3228C9EBC9F825E1D4FB6C1 +dch -i -D bionic "Bionic Upload to ppa" +debuild --no-lintian -S -sa -kD3439F4E2273F7DCD3228C9EBC9F825E1D4FB6C1 - dch -i -D eoan "Eoan Upload to ppa" - debuild -S -kD3439F4E2273F7DCD3228C9EBC9F825E1D4FB6C1 +dch -i -D focal "Focal Upload to ppa" +debuild --no-lintian -S -kD3439F4E2273F7DCD3228C9EBC9F825E1D4FB6C1 - dch -i -D disco "Disco Upload to ppa" - debuild -S -kD3439F4E2273F7DCD3228C9EBC9F825E1D4FB6C1 +dch -i -D jammy "Jammyh Upload to ppa" +debuild --no-lintian -S -kD3439F4E2273F7DCD3228C9EBC9F825E1D4FB6C1 - cd $DEFAULT_DIR/ +dch -i -D kinetic "Kinetic Upload to ppa" +debuild --no-lintian -S -kD3439F4E2273F7DCD3228C9EBC9F825E1D4FB6C1 + +cd $DEFAULT_DIR/ + +dput my-ppa-dev qelectrotech_$VERSION.r$HEAD-*ubuntu1_source.changes +dput my-ppa-dev qelectrotech_$VERSION.r$HEAD-*ubuntu2_source.changes +dput my-ppa-dev qelectrotech_$VERSION.r$HEAD-*ubuntu3_source.changes +dput my-ppa-dev qelectrotech_$VERSION.r$HEAD-*ubuntu4_source.changes - dput my-ppa-dev qelectrotech_$VERSION.r$HEAD-*ubuntu1_source.changes - dput my-ppa-dev qelectrotech_$VERSION.r$HEAD-*ubuntu2_source.changes - dput my-ppa-dev qelectrotech_$VERSION.r$HEAD-*ubuntu3_source.changes else - echo -e "\033[1;33mExit.\033[m" + echo -e "\033[1;33mExit.\033[m" fi + ############# Windows packages ################################################################################################ #copy and update folders of nsis_base skeleton echo -e "\033[1;31mWould you like to build Window packages n/Y?.\033[m" read a if [[ $a == "Y" || $a == "y" ]]; then - # 32 bits - cd $DEFAULT_DIR - cp -r qelectrotech-$VERSION.r$HEAD/ qelectrotech-$VERSION.r$HEAD-XP/ - cp -r nsis_base nsis_base$HEAD - cd qelectrotech-$VERSION.r$HEAD/ - cp -r {elements,examples,titleblocks} /$DEFAULT_DIR/nsis_base$HEAD/files - cp -r lang/*.qm /$DEFAULT_DIR/nsis_base$HEAD/files/lang - cd $DEFAULT_DIR - cd qelectrotech-$VERSION.r$HEAD/build-aux/windows/ - cp {lang_extra.nsh,QET.nsi,lang_extra_fr.nsh} /$DEFAULT_DIR/nsis_base$HEAD/ - # 64 bits - cd $DEFAULT_DIR - cp -r nsis_base nsis_base64$HEAD - cd qelectrotech-$VERSION.r$HEAD/ - cp -r {elements,examples,titleblocks} /$DEFAULT_DIR/nsis_base64$HEAD/files - cp -r lang/*.qm /$DEFAULT_DIR/nsis_base64$HEAD/files/lang +# 64 bits +cd $DEFAULT_DIR +cp -r nsis_base nsis_base64$HEAD +cd qelectrotech-$VERSION.r$HEAD/ +cp -r {elements,examples,titleblocks} /$DEFAULT_DIR/nsis_base64$HEAD/files +cp -r lang/*.qm /$DEFAULT_DIR/nsis_base64$HEAD/files/lang - cd $DEFAULT_DIR - cd qelectrotech-$VERSION.r$HEAD/build-aux/windows/ - cp {lang_extra.nsh,QET64.nsi,lang_extra_fr.nsh} /$DEFAULT_DIR/nsis_base64$HEAD/ +cd $DEFAULT_DIR +cd qelectrotech-$VERSION.r$HEAD/build-aux/windows/ +cp {lang_extra.nsh,QET64.nsi,lang_extra_fr.nsh} /$DEFAULT_DIR/nsis_base64$HEAD/ - #copy and update folders of readytouse_base skeleton - cd $DEFAULT_DIR - cp -r readytouse_base qelectrotech-$tagName+git$HEAD-x86-win32-readytouse - cd qelectrotech-$VERSION.r$HEAD/ - cp -r {elements,examples,titleblocks} /$DEFAULT_DIR/qelectrotech-$tagName+git$HEAD-x86-win32-readytouse - cp -r lang/*.qm /$DEFAULT_DIR/qelectrotech-$tagName+git$HEAD-x86-win32-readytouse/lang +#copy and update folders of readytouse_base skeleton +#cd $DEFAULT_DIR +#cp -r readytouse_base qelectrotech-$VERSION+git$HEAD-x86-win32-readytouse +#cd qelectrotech-$VERSION.r$HEAD/ +#cp -r {elements,examples,titleblocks} /$DEFAULT_DIR/qelectrotech-$VERSION+git$HEAD-x86-win32-readytouse +#cp -r lang/*.qm /$DEFAULT_DIR/qelectrotech-$VERSION+git$HEAD-x86-win32-readytouse/lang - ################################################################################################################# - export PATH=/media/backup6/digikam_new2/project/bundles/mxe/build.win32/usr/bin:$PATH - #cross-compil 32 bits - cd $DEFAULT_DIR/qelectrotech-$VERSION.r$HEAD - mkdir build/ && cd build +#copy and update folders of readytouse_base skeleton +cd $DEFAULT_DIR +cp -r readytouse_base qelectrotech-$VERSION+git$HEAD-x86-win64-readytouse +cd qelectrotech-$VERSION.r$HEAD/ +cp -r {elements,examples,titleblocks} /$DEFAULT_DIR/qelectrotech-$VERSION+git$HEAD-x86-win64-readytouse +cp -r lang/*.qm /$DEFAULT_DIR/qelectrotech-$VERSION+git$HEAD-x86-win64-readytouse/lang - /media/backup6/digikam_new2/project/bundles/mxe/build.win32/usr/bin/i686-w64-mingw32.static-qmake-qt5 $DEFAULT_DIR/qelectrotech-$VERSION.r$HEAD/qelectrotech.pro - make -j$(nproc) - #copy 32 bits binarie to /bin Windows packages - cd $DEFAULT_DIR/qelectrotech-$VERSION.r$HEAD/build/release/ - cp qelectrotech.exe /$DEFAULT_DIR/nsis_base$HEAD/files/bin - cp qelectrotech.exe /$DEFAULT_DIR/qelectrotech-$tagName+git$HEAD-x86-win32-readytouse/bin - #tag $HEAD by sed for nsis script - cd $DEFAULT_DIR/nsis_base$HEAD - sed -i 's/'"0.5-dev+[0-9]*"'/'"$tagName"+git"$HEAD"'/' QET.nsi +export PATH=/home/laurent/digikam3333/project/bundles/mxe/build.win64/usr/bin:$PATH - #build Windows installer - makensis QET.nsi - ################################################################################################################# - export PATH=/media/backup6/digikam_new2/project/bundles/mxe/build.win64/usr/bin:$PATH +#cross-compil 64 bits +cd $DEFAULT_DIR/qelectrotech-$VERSION.r$HEAD +#rm -r build/ +mkdir build/ && cd build - #cross-compil 64 bits - cd $DEFAULT_DIR/qelectrotech-$VERSION.r$HEAD - rm -r build/ - mkdir build/ && cd build - #mxe: qmake-qt5 x86_64-w64 - /media/backup6/digikam_new2/project/bundles/mxe/build.win64/usr/bin/x86_64-w64-mingw32.static-qmake-qt5 $DEFAULT_DIR/qelectrotech-$VERSION.r$HEAD/qelectrotech.pro - make -j$(nproc) +/home/laurent/digikam3333/project/bundles/mxe/build.win64/usr/bin/x86_64-w64-mingw32.static-qmake-qt5 $DEFAULT_DIR/qelectrotech-$VERSION.r$HEAD/qelectrotech.pro - cd $DEFAULT_DIR/qelectrotech-$VERSION.r$HEAD/build/release/ - mv qelectrotech.exe /$DEFAULT_DIR/nsis_base64$HEAD/files/bin - cd $DEFAULT_DIR/nsis_base64$HEAD +make -j$(nproc) - sed -i 's/'"0.5-dev_x86_64-win64+[0-9]*"'/'"$tagName"_x86_64-win64+git"$HEAD"'/' QET64.nsi +cd $DEFAULT_DIR/qelectrotech-$VERSION.r$HEAD/build/release/ +cp qelectrotech.exe /$DEFAULT_DIR/nsis_base64$HEAD/files/bin +cp qelectrotech.exe /$DEFAULT_DIR/qelectrotech-$VERSION+git$HEAD-x86-win64-readytouse/bin - makensis QET64.nsi +cd $DEFAULT_DIR/nsis_base64$HEAD +sed -i 's/'"0.5-dev_x86_64-win64+[0-9]*"'/'"$VERSION"_x86_64-win64+git"$HEAD"'/' QET64.nsi +makensis QET64.nsi - #crompress readytouse - cd $DEFAULT_DIR +################################################################################################################# - 7za a -m0=lzma qelectrotech-$tagName+git$HEAD-x86-win32-readytouse.7z qelectrotech-$tagName+git$HEAD-x86-win32-readytouse/ - echo -e "\033[1;31mWould you like to prepare to RSYNC Windows packages /Y?.\033[m" - read a - if [[ $a == "Y" || $a == "y" ]]; then - cd /home/laurent/builds/nightly/ +#crompress readytouse +cd $DEFAULT_DIR +7za a -m0=lzma qelectrotech-$VERSION+git$HEAD-x86-win64-readytouse.7z qelectrotech-$VERSION+git$HEAD-x86-win64-readytouse/ - name=$(date +%Y-%m-%d-) #defined a name based on the date +echo -e "\033[1;31mWould you like to prepare to RSYNC Windows packages /Y?.\033[m" +read a +if [[ $a == "Y" || $a == "y" ]]; then - #start increment to 1 - i=1 - #increment by i if the builds have already been created - while [ "$(ls /home/$USER/builds/nightly/ | grep $name$i)" != "" ]; do - ((i++)) - done - #create a new folder incremented by 1 - mkdir /home/$USER/builds/nightly/$name$i +cd /home/laurent/builds/nightly/ + +name=$(date +%Y-%m-%d-) #defined a name based on the date + +#start increment to 1 +i=1 +#increment by i if the builds have already been created +while [ "$(ls /home/$USER/builds/nightly/ | grep $name$i)" != "" ]; do + ((i++)) +done +#create a new folder incremented by 1 +mkdir /home/$USER/builds/nightly/$name$i + + +cd $DEFAULT_DIR/ +cp qelectrotech-$VERSION+git$HEAD-x86-win64-readytouse.7z /home/laurent/builds/nightly/$name$i + +cd $DEFAULT_DIR/nsis_base64$HEAD +cp Installer_QElectroTech-$VERSION"_x86_64-win64+git"$HEAD-1.exe /home/laurent/builds/nightly/$name$i - cd $DEFAULT_DIR/ - cp qelectrotech-$tagName+git$HEAD-x86-win32-readytouse.7z /home/laurent/builds/nightly/$name$i - cd /$DEFAULT_DIR/nsis_base$HEAD - cp Installer_QElectroTech-$tagName+git$HEAD-1.exe /home/laurent/builds/nightly/$name$i - cd $DEFAULT_DIR/nsis_base64$HEAD - cp Installer_QElectroTech-$tagName"_x86_64-win64+git"$HEAD-1.exe /home/laurent/builds/nightly/$name$i - else - echo -e "\033[1;33mExit.\033[m" - fi - #rsync to TF Windows builds - echo -e "\033[1;31mWould you like to upload Windows packages n/Y?.\033[m" - read a - if [[ $a == "Y" || $a == "y" ]]; then - rsync -e ssh -av --delete-after --no-owner --no-g --chmod=g+w --progress /home/laurent/builds/nightly/ scorpio810@ssh.tuxfamily.org:/home/qet/qet-repository/builds/nightly/ - if [ $? != 0 ]; then - { - echo "RSYNC ERROR: problem syncing qelectrotech-$VERSION.r$HEAD " - rsync -e ssh -av --delete-after --no-owner --no-g --chmod=g+w --progress /home/laurent/builds/nightly/ scorpio810@ssh.tuxfamily.org:/home/qet/qet-repository/builds/nightly/ - } fi - else - echo -e "\033[1;33mExit.\033[m" - fi else - echo -e "\033[1;33mExit.\033[m" + echo -e "\033[1;33mExit.\033[m" +fi + + +#rsync to TF Windows builds +echo -e "\033[1;31mWould you like to upload Windows packages n/Y?.\033[m" +read a +if [[ $a == "Y" || $a == "y" ]]; then +rsync -e ssh -av -W --delete-after --no-owner --no-g --chmod=g+w --progress /home/laurent/builds/nightly/ scorpio810@ssh.tuxfamily.org:/home/qet/qet-repository/builds/nightly/ +if [ $? != 0 ]; then +{ +echo "RSYNC ERROR: problem syncing qelectrotech-$VERSION.r$HEAD " +rsync -e ssh -av -W --delete-after --no-owner --no-g --chmod=g+w --progress /home/laurent/builds/nightly/ scorpio810@ssh.tuxfamily.org:/home/qet/qet-repository/builds/nightly/ +} fi + +#cd ~/paquet_qet/script +#sed -i 's/'[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]-[0-9]'/'"$name$i"'/' dl_link.inc.php +#scp dl_link.inc.php "${SSH_TARGET}" + +else + echo -e "\033[1;33mExit.\033[m" +fi +else + echo -e "\033[1;33mExit.\033[m" fi exit +