Updates version number and deb build script.

This commit is contained in:
Olivier Keshavjee 2017-11-22 22:26:28 +01:00
parent 117cc1f862
commit 519d4666cf
3 changed files with 38 additions and 32 deletions

3
.gitignore vendored
View file

@ -11,4 +11,5 @@ icons/Numix
.idea .idea
dist dist
build build
test-projects test-projects
.cache

View file

@ -3,7 +3,7 @@
# Single source the package version # Single source the package version
# https://packaging.python.org/guides/single-sourcing-package-version/ # https://packaging.python.org/guides/single-sourcing-package-version/
__version__ = "0.5.0" __version__ = "0.6.0"
def getVersion(): def getVersion():
return __version__ return __version__

View file

@ -1,25 +1,28 @@
#!/bin/bash #!/bin/bash
# Can take two parameters: AppVersion PkgNumber # Can take two parameters: AppVersion PkgNumber
# Default values are: 0.5.0 1 # If not provided, AppVersion is found in manuskript/version.py
# PkgNumber is 1.
# Manuskript Vars
AppName=manuskript
AppVersion=${1:-0.5.0}
PkgNumber=${2:-1}
PkgVersion=$AppVersion-$PkgNumber
#PkgSizeInKb # find with: du -sk manuskript-0.5.0-1
# Program vars # Program vars
ScriptPath="$( cd "$(dirname "$0")" ; pwd -P )" ScriptPath="$( cd "$(dirname "$0")" ; pwd -P )"
Dest="$ScriptPath/../dist/$AppName-$PkgVersion" Root="$ScriptPath/../"
echo Package directory: $Dest # Manuskript Vars
AppName=manuskript
Version=$(grep -E "__version__.*\".*\"" "$Root/manuskript/version.py" \
| cut -d\" -f2) # Look for version in manuskript/version
AppVersion=${1:-$Version}
PkgNumber=${2:-1}
PkgVersion=$AppVersion-$PkgNumber
Dest="$Root/dist/$AppName-$PkgVersion"
echo -n Creating folder structure echo "Package directory: $Dest"
mkdir -p $Dest/DEBIAN
mkdir -p $Dest/usr/bin echo -n "Creating folder structure"
mkdir -p $Dest/usr/share/applications mkdir -p "$Dest/DEBIAN"
mkdir -p "$Dest/usr/bin"
mkdir -p "$Dest/usr/share/applications"
echo " [✓]" echo " [✓]"
# Getting manuskript files, by downloading # Getting manuskript files, by downloading
@ -32,29 +35,31 @@ echo " [✓]"
# Using the current direction as source # Using the current direction as source
echo -n Copying manuskript content echo -n "Copying manuskript content"
rsync -a --exclude=.git --include="*.msk" --exclude-from=.gitignore $ScriptPath/../ $Dest/usr/share/manuskript rsync -a --exclude=.git --include="*.msk" --exclude-from="$Root/.gitignore" \
cp $ScriptPath/create_deb/manuskript $Dest/usr/bin/manuskript "$ScriptPath/../" "$Dest/usr/share/manuskript"
cp $ScriptPath/create_deb/manuskript.desktop $Dest/usr/share/applications/manuskript.desktop cp "$ScriptPath/create_deb/manuskript" "$Dest/usr/bin/manuskript"
cp $ScriptPath/create_deb/control $Dest/DEBIAN/control cp "$ScriptPath/create_deb/manuskript.desktop" \
"$Dest/usr/share/applications/manuskript.desktop"
cp "$ScriptPath/create_deb/control" "$Dest/DEBIAN/control"
sed -i "s/{PkgVersion}/$PkgVersion/" $Dest/DEBIAN/control sed -i "s/{PkgVersion}/$PkgVersion/" "$Dest/DEBIAN/control"
PkgSizeInKb=$(du -sk $Dest | cut -f 1) PkgSizeInKb=$(du -sk "$Dest" | cut -f 1)
sed -i "s/{PkgSizeInKb}/$PkgSizeInKb/" $Dest/DEBIAN/control sed -i "s/{PkgSizeInKb}/$PkgSizeInKb/" "$Dest/DEBIAN/control"
echo " [✓]" echo " [✓]"
echo -n Setting permissions echo -n "Setting permissions"
chmod 0755 $Dest/usr/bin/manuskript chmod 0755 "$Dest/usr/bin/manuskript"
echo " [✓]" echo " [✓]"
echo Your root password might now be asked to finish setting permissions: echo "Your root password might now be asked to finish setting permissions:"
sudo chown root:root -R $Dest sudo chown root:root -R "$Dest"
echo Creating the package… echo "Creating the package…"
dpkg -b $Dest dpkg -b "$Dest"
echo -n Removing build folder echo -n "Removing build folder"
sudo rm -r $Dest sudo rm -r "$Dest"
echo " [✓]" echo " [✓]"
echo Done ! echo Done !