Skip to content

Commit

Permalink
migrate to ansible
Browse files Browse the repository at this point in the history
  • Loading branch information
kringkaste committed Feb 23, 2024
1 parent fc858d2 commit 52fcb77
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
14 changes: 14 additions & 0 deletions roles/mozjpeg/files/installer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
VERSION="4.1.1"

cd /tmp
wget https://github.com/mozilla/mozjpeg/archive/refs/tags/v${VERSION}.tar.gz -O mozjpeg.tar.gz
tar xvzf mozjpeg.tar.gz
cd mozjpeg-${VERSION}
mkdir build
cd build
sudo cmake -G"Unix Makefiles" -DPNG_SUPPORTED=OFF ../
make install
make deb
sudo dpkg -i mozjpeg_*.deb
sudo ln -s /opt/mozjpeg/bin/cjpeg /usr/bin/cjpeg
sudo ln -s /opt/mozjpeg/bin/jpegtran /usr/bin/jpegtran
41 changes: 41 additions & 0 deletions roles/mozjpeg/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---

# Build and install mozjpeg

- name: Install build packages for mozjpeg
ansible.builtin.apt:
name:
- cmake
- autoconf
- automake
- libtool
- nasm
- make
- pkg-config

- name: Copy install script
ansible.builtin.copy:
src: installer.sh
dest: /tmp/installer.sh
owner: root
group: root
mode: '0755'

- name: Build and install mozjpeg
ansible.builtin.command:
cmd: /tmp/installer.sh
chdir: /tmp
changed_when: true

- name: Remove build packages
ansible.builtin.apt:
name:
- cmake
- autoconf
- automake
- libtool
- nasm
- make
- pkg-config
state: absent
autoremove: true

0 comments on commit 52fcb77

Please sign in to comment.