longNowForMd/debian/createSeries.sh
2021-06-30 22:58:58 +02:00

72 lines
2.1 KiB
Bash
Executable File

#!/bin/bash
# What to update before running:
# - The error message in line 43
# - The version number in line 60
stemFolder="$(pwd)/$1"
stemFolderName="$1"
seriesFolder="$(pwd)/$1~series"
seriesNames=("focal" "groovy" "hirsute" "impish")
gitFolder="/home/nuno/Documents/core/software/fresh/bash/sid/longnowformd_package/longnow-git/"
rm -rf "$stemFolder"
mkdir "$stemFolder"
rm -rf "$seriesFolder"
mkdir "$seriesFolder"
cp "$gitFolder/longnow" "$stemFolder/longnow"
for seriesName in "${seriesNames[@]}"; do
# Create corresponding folder
newSeriesFolder="$seriesFolder/$stemFolderName~$seriesName"
echo "$seriesName"
cp -r "$stemFolder" "$newSeriesFolder"
cd "$newSeriesFolder"
# Make
dh_make --createorig -c mit --indep -y
wait
# Modify corresponding files
touch debian/install
echo "longnow usr/bin" > debian/install ## Add files to debian/install; depends on the files
cd debian
# Replace "unstable" for the series name ("bionic", "focal",...)
sed -i "s|unstable|$seriesName|g" changelog
# Meaningful update message
sed -i 's|Initial release (Closes: #nnnn) <nnnn is the bug number of your ITP>|Minor tweak.|g' changelog
# Edit the control file; change "unknown" section to "utils" (or some other section)
sed -i 's|Section: unknown|Section: utils|g' control
# Cosmetic stuff
# Delete the .ex and .docs and README.Debian files
rm *.ex; rm *.docs; rm README*; rm *.EX
sed -i 's|<insert the upstream URL, if relevant>|https://github.com/NunoSempere/longNowForMd|g' control
sed -i 's|Nuno <nuno@unknown>|Nuno Sempere <nuno.semperelh@gmail.com>|g' *
# Build
cd ..
debuild -S
wait
cd ..
dput ppa:nunosempere/longnowformd longnow_1.1~$seriesName-1_source.changes
wait
done
## How to use: ./createSeries.sh longnow-1.1
cp -r "$stemFolder" "$gitFolder/debian/$stemFolderName"
cp -r "$seriesFolder" "$gitFolder/debian/$stemFolderName~series"
cp "/home/nuno/Documents/core/software/fresh/bash/sid/longnowformd_package/createSeries.sh" "$gitFolder/debian/createSeries.sh"
sudo cp "$gitFolder/longnow" "/usr/bin/longnow"
sudo chmod 555 "/usr/bin/longnow"