Permalink
Browse files

Add .deb creation for Debian jessie.

  • Loading branch information...
aaron42net committed Mar 7, 2016
1 parent 461cec4 commit 42aa8e7cd6312a5f267a04fff2e66e43cb1bd4b7
View
@@ -21,7 +21,7 @@ _testmain.go
*.exe
*.rpm
*.dpkg
*.deb
/fotomat
/cmd/fotomat/fotomat
*~
View
@@ -0,0 +1,63 @@
# Build Fotomat RPM for Debian jessie using Docker.
#
# Run:
# docker build -f Dockerfile.dpkg-jessie -t dienet/fotomat:dpkg-jessie .
# docker run --name fotomat-dpkg-jessie dienet/fotomat:dpkg-jessie /bin/true
# docker export fotomat-dpkg-jessie | tar --strip-components=7 -xvf - app/src/github.com/die-net/fotomat/pkg/dpkg/fotomat.deb
# docker rm fotomat-dpkg-jessie
# docker rmi dienet/fotomat:dpkg-jessie
#
# And you'll end up with a fotomat*.dpkg in the current directory.
FROM debian:jessie
ADD . /app/src/github.com/die-net/fotomat
RUN \
# Apply updates and install our dependencies
apt-get -q update && \
apt-get -y -q dist-upgrade && \
DEBIAN_FRONTEND=noninteractive apt-get install -y -q --no-install-recommends \
ca-certificates curl \
fakeroot git automake build-essential libglib2.0-dev libjpeg-dev libpng12-dev \
libwebp-dev libtiff5-dev libexif-dev libmagickwand-dev libfftw3-dev libffi-dev && \
# Create a few directories
mkdir -p /usr/local/go /usr/local/vips /app/pkg /app/bin && \
# Fetch and install Go
curl -sS https://storage.googleapis.com/golang/go1.6.linux-amd64.tar.gz | \
tar --strip-components=1 -C /usr/local/go -xzf - && \
# Fetch and build VIPS (enabling GCC's auto-vectorization)
curl -sS http://www.vips.ecs.soton.ac.uk/supported/8.2/vips-8.2.2.tar.gz | \
tar --strip-components=1 -C /usr/local/vips -xzf - && \
cd /usr/local/vips && \
CFLAGS="-O2 -ftree-vectorize -msse4.2 -ffast-math -fPIC" CXXFLAGS="-O2 -ftree-vectorize -msse4.2 -ffast-math -fPIC" LDFLAGS="-lstdc++" \
./configure --disable-debug --disable-dependency-tracking --disable-gtk-doc-html --disable-pyvips8 --disable-shared \
--with-OpenEXR --with-jpeg --with-lcms --with-libexif --with-magick --with-tiff --with-libwebp --with-png \
--without-cfitsio --without-fftw --without-gsf --without-matio --without-openslide --without-orc \
--without-pangoft2 --without-python --without-x --without-zip && \
make && make install && \
# Build, install, and test fotomat
GOPATH=/app /usr/local/go/bin/go get -tags vips_static -t github.com/die-net/fotomat/cmd/fotomat github.com/die-net/fotomat/thumbnail github.com/die-net/fotomat/format && \
GOPATH=/app /usr/local/go/bin/go test -tags vips_static -v github.com/die-net/fotomat/cmd/fotomat github.com/die-net/fotomat/thumbnail github.com/die-net/fotomat/format && \
# Build the dpkg.
cd /app/src/github.com/die-net/fotomat/ && \
(perl -ne '/FotomatVersion.*\b(\d+\.\d+\.\d+)/ and print "Version: ${1}-1\n"' cmd/fotomat/version.go; \
ldd /app/bin/fotomat | awk '($2=="=>"&&substr($3,1,11)!="/usr/local/"){print $3}' | \
xargs dpkg -S | cut -d: -f1 | sort -u | xargs echo "Depends:" | sed 's/ /, /g;s/:,/:/' \
) >> pkg/dpkg/fotomat/DEBIAN/control && \
install -d -m 755 pkg/dpkg/fotomat/usr/sbin/ && \
install -s -m 755 /app/bin/fotomat pkg/dpkg/fotomat/usr/sbin/ && \
fakeroot dpkg-deb --build pkg/dpkg/fotomat && \
# And remove almost everything else that we installed
apt-get remove -y fakeroot git automake build-essential libglib2.0-dev libjpeg-dev libpng12-dev \
libwebp-dev libtiff5-dev libexif-dev libmagickwand-dev libfftw3-dev libffi-dev && \
apt-get autoremove -y && \
apt-get autoclean && \
apt-get clean && \
rm -rf /usr/local/go /usr/local/vips /app/pkg /var/lib/apt/lists/*
View
@@ -8,7 +8,7 @@ import (
const (
// Updated by git-hooks/pre-commit
FotomatVersion = "2.0.144"
FotomatVersion = "2.0.145"
)
var (
@@ -0,0 +1,10 @@
Package: fotomat
Section: contrib/web
Priority: optional
Architecture: amd64
Maintainer: Aaron Hopkins <tools@die.net>
Description: Fotomat is an extremely fast image resizing proxy, enabling
on-the-fly resizing and cropping of JPEG, PNG, GIF, and WebP images.
Written in Go and using the fast and flexible VIPS image library, it aims to
deliver beautiful images in the shortest time and at the smallest file size
possible. See: https://github.com/die-net/fotomat
@@ -0,0 +1,11 @@
Copyright 2013, 2014, 2015, 2016 Aaron Hopkins and contributors
Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy
of the License at: http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.

0 comments on commit 42aa8e7

Please sign in to comment.