Skip to content

Instantly share code, notes, and snippets.

@pulecp
Created May 25, 2018 16:41
Show Gist options
  • Save pulecp/89d97a2ed61804f2121a72de60f11501 to your computer and use it in GitHub Desktop.
Save pulecp/89d97a2ed61804f2121a72de60f11501 to your computer and use it in GitHub Desktop.
Build RPM package of wkhtmltopdf tool
#!/bin/bash
URL=https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/
SRC_FILE=wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
WORK_DIR=wkhtmltox
VERSION=0.12.4
[ -f $SRC_FILE ] || wget "${URL}${SRC_FILE}"
rm -rf $WORK_DIR
tar -xf $SRC_FILE
rm -f *.rpm
cd $WORK_DIR
fpm -s dir \
-t rpm \
-n wkhtmltopdf \
--iteration 1 \
--version $VERSION \
--no-rpm-autoreqprov \
--architecture 'x86_64' \
--description 'Simple shell utility to convert html to pdf using the webkit rendering engine, and qt.' \
--rpm-use-file-permissions \
--rpm-user root \
--rpm-group root \
bin/wkhtmltopdf=/usr/bin/wkhtmltopdf
mv *.rpm ../
cd ..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment