Skip to content

Commit

Permalink
DEB stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
danpla committed Oct 17, 2015
1 parent c18b0ff commit 6f78ad6
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 0 deletions.
69 changes: 69 additions & 0 deletions dist/deb/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/bin/sh

APPNAME='fontlink'
DATA_DIR='../..'

BUILD_DIR=build
mkdir -p $BUILD_DIR

cp -r $DATA_DIR/bin $BUILD_DIR

INSTALL_DIR=$BUILD_DIR/usr/share

mkdir -p $INSTALL_DIR
rsync -a --exclude=**__pycache__* $DATA_DIR/${APPNAME} $INSTALL_DIR


# Compile mo
grep -v '^#' $DATA_DIR/po/LINGUAS | while read -r lang;
do
modir=$INSTALL_DIR/locale/$lang/LC_MESSAGES;
mkdir -p $modir;
msgfmt $DATA_DIR/po/$lang.po -o $modir/${APPNAME}.mo;
done

# Icons
rsync -a --exclude=*x*/*/*.svg $DATA_DIR/data/icons $INSTALL_DIR

# Desktop file
DESKTOP_DIR=$INSTALL_DIR/applications
mkdir -p $DESKTOP_DIR
cp $DATA_DIR/data/${APPNAME}.desktop $DESKTOP_DIR

# Docs
DOC_DIR=$INSTALL_DIR/doc/${APPNAME}
mkdir -p $DOC_DIR
cp $DATA_DIR/LICENSE $DOC_DIR/copyright

cp changelog $DOC_DIR/changelog.Debian
gzip -9 $DOC_DIR/changelog.Debian


# DEBIAN
DEB_DIR=$BUILD_DIR/DEBIAN
mkdir -p $DEB_DIR

cp postinst prerm $DEB_DIR
cp control.in $DEB_DIR/control

set -- `cd ${DATA_DIR}/${APPNAME}; python3 -B -c \
'from app_info import *; print(VERSION, WEBSITE)'`
version=$1
website=$2
size=`find ${BUILD_DIR} -type f -not -path "${DEB_DIR}/*" -print0 |
xargs -r0 du --apparent-size -chk | tail -n -1 | awk '{print $1}'`

sed \
-e "s/@VERSION@/${version}/" \
-e "s/@SIZE@/${size}/" \
-e "s,@URL@,${website}," \
-i $DEB_DIR/control


chmod -R u+rwX,go+rX,go-w $BUILD_DIR
chmod +x $DEB_DIR/postinst $DEB_DIR/prerm $BUILD_DIR/bin/${APPNAME}


fakeroot dpkg-deb --build $BUILD_DIR .

rm -rf $BUILD_DIR
20 changes: 20 additions & 0 deletions dist/deb/control.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Package: fontlink
Version: @VERSION@-1
Architecture: all
Maintainer: Daniel Plachotich <[email protected]>
Installed-Size: @SIZE@
Depends: python3, python3-gi, gir1.2-appindicator3-0.1
Section: utils
Priority: optional
Homepage: @URL@
Description: Small utility to install fonts temporarily
FontLink is a small GTK+ utility to install fonts temporarily on Unix-like
systems.
.
It allows you to quickly install certain fonts only when you really
need them without copying fonts or creating symlinks to special
directories by hand.
.
FontLink has a very simple interface with which you can group fonts into
sets (for example, one set per project) and quickly enable or disable
certain fonts as well as entire sets in a single click.
5 changes: 5 additions & 0 deletions dist/deb/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

set -e

python3 -m compileall -q /usr/share/fontlink
5 changes: 5 additions & 0 deletions dist/deb/prerm
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

set -e

find usr/share/fontlink -name __pycache__ -type d -exec rm -rf {} +

0 comments on commit 6f78ad6

Please sign in to comment.