Skip to content

Commit 3dbb664

Browse files
author
apelly
committed
simple linux build script
roughly translate the existing batch file to bash for ease of building under ubuntu
1 parent e3c6006 commit 3dbb664

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,4 +258,5 @@ paket-files/
258258

259259
# Python Tools for Visual Studio (PTVS)
260260
__pycache__/
261-
*.pyc
261+
*.pyc
262+
/YetAnotherFaviconDownloader.plgx

ubuntu-plgx-build.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
3+
PROJDIR=$(dirname ${0}) # directory name of the build script
4+
5+
# Configuration
6+
SOURCE=${PROJDIR}/YAFD
7+
TARGET=${PROJDIR}/publish # Copy the source here pefore building
8+
PLGX_LOC="/usr/lib/keepass2/Plugins" # Where to install the plugin
9+
KEEPASS=$(which keepass2) # keepass binary location
10+
NAME=YetAnotherFaviconDownloader
11+
12+
13+
# Clean old files
14+
echo Cleaning...
15+
if [ -d "${TARGET}" ]; then # remove the build dir
16+
rm -r ${TARGET}
17+
fi
18+
if [ -e publish.plgx ]; then # remove the compiled binary
19+
rm publish.plgx
20+
fi
21+
if [ -e ${NAME}.plgx ]; then # remove renamed binary
22+
rm ${NAME}.plgx
23+
fi
24+
25+
# Copy the files needed to build the plugin
26+
echo Copying...
27+
cp -r ${SOURCE} ${TARGET}
28+
29+
# Let KeePass do its magic
30+
echo Building...
31+
${KEEPASS} --plgx-create "${TARGET}" --plgx-prereq-kp:2.34
32+
mv publish.plgx ${NAME}.plgx
33+
34+
# Deploy PLGX file
35+
echo Deploying...
36+
sudo cp ${NAME}.plgx ${PLGX_LOC}

0 commit comments

Comments
 (0)