Skip to content

Commit

Permalink
Merge pull request #729 from just-paja/feature/deb-package
Browse files Browse the repository at this point in the history
Fix Ubuntu Build Process
  • Loading branch information
prikhi committed Sep 21, 2015
2 parents 5167f46 + a89794c commit 8b4d11a
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 21 deletions.
8 changes: 7 additions & 1 deletion build/Linux/pencil
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
#!/bin/bash

# Target for application ini
APP_INI="/usr/share/evolus-pencil/application.ini"
APP_INI="/usr/share/pencil/application.ini"

# If it does not exist, try legacy one
if [ ! -e "${APP_INI}" ]; then
APP_INI="/usr/share/evolus-pencil/application.ini"
fi


# List of firefox binaries to search
BINARIES="xulrunner iceweasel firefox firefox-bin"
Expand Down
10 changes: 10 additions & 0 deletions build/Ubuntu/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Package: pencil
Version: {VERSION}
Section: devel
Priority: optional
Architecture: amd64
Depends: firefox (>= {MIN_VERSION})
Installed-Size: 9216
Maintainer: {MAINTAINER}
Description: GUI Prototyping/Wireframing
Pencil is a multiplatform tool for GUI Prototyping/Wireframing
3 changes: 3 additions & 0 deletions build/Ubuntu/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Files: *
Copyright: 2014-2015 {MAINTAINER}
License: /usr/share/common-licenses/GPL-2
71 changes: 51 additions & 20 deletions build/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

. ./properties.sh
. ./functions.sh

prep() {
rm -Rf ./Outputs/
Expand Down Expand Up @@ -241,30 +242,60 @@ mac() {
cd ../..
}


ubuntu() {
PKG="pencil_${VERSION}"
DIR_TARGET="./Outputs/Ubuntu"
DIR_BASE="${DIR_TARGET}/${PKG}"
DIR_DEB="${DIR_BASE}/DEBIAN"
DIR_SHARE="${DIR_BASE}/usr/share"

echo "---------------------------------------------"
echo "* Building Ubuntu amd 64 *"
echo "---------------------------------------------"
rm -Rf ./Outputs/Ubuntu/
mkdir ./Outputs/Ubuntu/

mkdir ./Outputs/Ubuntu/pencil-2.0.2
mkdir ./Outputs/Ubuntu/pencil-2.0.2/usr
mkdir ./Outputs/Ubuntu/pencil-2.0.2/usr/bin
mkdir ./Outputs/Ubuntu/pencil-2.0.2/usr/share/
mkdir ./Outputs/Ubuntu/pencil-2.0.2/usr/share/applications
cp ./Ubuntu/pencil ./Outputs/Ubuntu/pencil-2.0.2/usr/bin/pencil
cp ./Ubuntu/pencil.desktop ./Outputs/Ubuntu/pencil-2.0.2/usr/share/applications/pencil.desktop
cp -r ./Ubuntu/share/pencil ./Outputs/Ubuntu/pencil-2.0.2/usr/share/pencil
#curl -nc http://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/15.0.1/runtimes/xulrunner-15.0.1.en-US.linux-x86_64.tar.bz2 -o ./Ubuntu/xulrunner-15.0.1.en-US.linux-x86_64.tar.bz2
#tar xvfj ./Ubuntu/xulrunner-15.0.1.en-US.linux-x86_64.tar.bz2
#cp -r ./xulrunner ./Outputs/Ubuntu/pencil-2.0.2/usr/share/pencil/xre
cp ./Ubuntu/deb ./Outputs/Ubuntu/pencil-2.0.2/deb
cp ./Ubuntu/control ./Outputs/Ubuntu/pencil-2.0.2/control
cp ./Ubuntu/rules ./Outputs/Ubuntu/pencil-2.0.2/rules
cd ./Outputs/Ubuntu/pencil-2.0.2
sh ./deb
mv ../evoluspencil_2.0.2_all.deb ../../evoluspencil_2.0.2_all.deb

rm -Rf ${DIR_TARGET}

run_task mkdir -p "${DIR_BASE}/usr/bin" "${DIR_SHARE}/applications" "${DIR_SHARE}/doc/pencil"
run_task cp ./Linux/pencil "${DIR_BASE}/usr/bin/pencil"
run_task cp ./Linux/pencil.desktop "${DIR_SHARE}/applications/pencil.desktop"
run_task cp -r ./Outputs/Pencil "${DIR_BASE}/usr/share/pencil"
run_task mkdir -p "${DIR_DEB}"

old_ifs="${IFS}"
IFS=$(echo -e "\n")
ctrl=$(cat Ubuntu/control)
copy=$(cat Ubuntu/copyright)

for line in $ctrl; do
line=$(echo $line | sed "s/{VERSION}/${VERSION}/g")
line=$(echo $line | sed "s/{MAINTAINER}/${MAINTAINER}/g")
line=$(echo $line | sed "s/{MIN_VERSION}/${MIN_VERSION}/g")
echo $line >> ${DIR_DEB}/control
done

for line in $copy; do
line=$(echo $line | sed "s/{MAINTAINER}/${MAINTAINER}/g")
echo $line >> ${DIR_SHARE}/doc/pencil/copyright
done

IFS="${old_ifs}"
run_task chown -R root ${DIR_BASE}
run_task cp ../CHANGELOG.md ${DIR_SHARE}/doc/pencil/changelog
run_task gzip -9 ${DIR_SHARE}/doc/pencil/changelog

# Remove extra license files to avoid Lintian warning
rm ${DIR_SHARE}/pencil/content/pencil/license.txt
rm ${DIR_SHARE}/pencil/license.txt

dpkg-deb --build ${DIR_BASE}

#~ run_task cp ./Ubuntu/control ${DIR_BASE}/control
#~ run_task cp ./Ubuntu/rules ${DIR_BASE}/rules
#~ run_task cd ${DIR_BASE}

#~ run_task sh ./deb
#~ run_task mv ../evoluspencil_2.0.2_all.deb ../../evoluspencil_2.0.2_all.deb
}

clean() {
Expand Down
16 changes: 16 additions & 0 deletions build/functions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

function run_task {
task=$@

${task}
result=$?

if [ "${result}" != "0" ]; then
echo ":: Task has failed with exit code ${result}" 1>&2
echo " -> ${task}"
exit ${result}
fi
}

export -f run_task
1 change: 1 addition & 0 deletions build/properties.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export NAME='Pencil'
export VERSION='2.0.13'
export BUILD=`date +%Y%m%d`
export AUTHOR='Pavan Rikhi(pavan.rikhi@gmail.com) and Contributors'
export MAINTAINER='Pavan Rikhi <pavan.rikhi@gmail.com>'
export XPI_NAME='Pencil-'$VERSION'-firefox.xpi'
export MIN_VERSION='36.0'
export MAX_VERSION='41.*'
Expand Down

0 comments on commit 8b4d11a

Please sign in to comment.