Skip to content

Commit

Permalink
Ubuntu packaging [skip ci].
Browse files Browse the repository at this point in the history
  • Loading branch information
portnov committed Aug 20, 2019
1 parent 0954b73 commit e408263
Show file tree
Hide file tree
Showing 19 changed files with 213 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
.stack-work/
gtk3test.cabal
ghcprofview.cabal
*.hi
*.o
*.swp
*~
docker/work
docker/target
docker/stack
docker/build/
debian/ghcprofview/
debian/files
debian/debhelper-build-stamp

5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ghcprofview (0.1.0.0-1) UNRELEASED; urgency=low

* Initial release

-- Ilya V . Portnov <[email protected]> Sat, 09 Mar 2019 10:56:44 +0500
1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9
21 changes: 21 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Source: ghcprofview
Maintainer: Ilya V . Portnov <[email protected]>
Priority: optional
Section: haskell
Build-Depends: debhelper (>= 9)
Standards-Version: 3.9.6
Homepage: https://github.com/githubuser/ghcprofview-hs#readme
X-Description:
Please see the README on GitHub at <https://github.com/githubuser/ghcprofview-hs#readme>

Package: ghcprofview
Architecture: any
Section: misc
Depends: ${shlibs:Depends}
Description: GHC .prof files viewer, implemented in Haskell + Gtk3.
.
Unlike profiterole and profiteur, ghcprofview uses a traditional approach to
profiling. It allows you to view cost centres tree as it is and browse it
interactively, and allows you to do some actions that you may be used to in,
for example, Java's visualvm.

44 changes: 44 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: ghcprofview
Upstream-Contact: [email protected]
Source: https://hackage.haskell.org/package/ghcprofview

Files: *
Copyright: 2018 Author name here
License: BSD3

Files: debian/*
Copyright: held by the contributors mentioned in debian/changelog
License: BSD3

License: BSD3
Copyright Ilya Portnov (c) 2018
.
All rights reserved.
.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
.
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
.
* Neither the name of Author name here nor the names of other
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17 changes: 17 additions & 0 deletions debian/ghcprofview.debhelper.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
dh_prep
dh_installdirs
dh_install
dh_installdocs
dh_installchangelogs
dh_installman
dh_installdebconf
dh_compress
dh_fixperms
dh_strip
dh_makeshlibs
dh_shlibdeps
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
1 change: 1 addition & 0 deletions debian/ghcprofview.dirs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
usr/bin
1 change: 1 addition & 0 deletions debian/ghcprofview.install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.stack-work/install/x86_64-linux/f328d036c19212621926aa2ee41f803cf30cd4dff8e8592f72da38ad18df83b3/8.6.5/bin/ghcprofview usr/bin
3 changes: 3 additions & 0 deletions debian/ghcprofview.substvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
shlibs:Depends=libatk1.0-0 (>= 2.12.0), libc6 (>= 2.14), libcairo-gobject2 (>= 1.10.0), libcairo2 (>= 1.2.4), libgdk-pixbuf2.0-0 (>= 2.31.1), libgirepository-1.0-1 (>= 0.9.2), libglib2.0-0 (>= 2.47.1), libgmp10, libgtk-3-0 (>= 3.17.9), libpango-1.0-0 (>= 1.37.2), libpangocairo-1.0-0 (>= 1.14.0), zlib1g (>= 1:1.1.4)
misc:Depends=
misc:Pre-Depends=
43 changes: 43 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/usr/bin/make -f

clean:
rm -rf debian/ghcprofview
rm -rf *.log
rm -rf *.cabal
stack clean --allow-different-user

check:

build-arch: build

build:
stack build --allow-different-user

override_dh_auto_build:
stack build --allow-different-user

binary-arch: binary

binary:
dh_clean
dh_testroot
dh_prep
dh_installdirs
dh_install
dh_installdocs
dh_installchangelogs
dh_installman
dh_installdebconf
dh_compress
dh_fixperms
dh_strip
dh_makeshlibs
dh_shlibdeps
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb

%:
dh $@

1 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (quilt)
11 changes: 11 additions & 0 deletions debian/source/options
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
tar-ignore = .git
tar-ignore = .gitignore
tar-ignore = .stack-work
tar-ignore = debian
tar-ignore = docker
tar-ignore = test
tar-ignore = *.tar.xz
tar-ignore = *.cabal

extend-diff-ignore = "(^|/)(\.git|\.gitignore|\.stack-work|debian|docker|test|.*tar.xz|.*cabal)"

2 changes: 2 additions & 0 deletions debian/watch
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version=3
https://hackage.haskell.org/package/ghcprofview/distro-monitor .*-([0-9\.]+)\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))
1 change: 1 addition & 0 deletions docker/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
stack/
15 changes: 15 additions & 0 deletions docker/Dockerfile.ubuntu
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM ubuntu
MAINTAINER Ilya V. Portnov <[email protected]>

RUN apt-get update -y && \
apt-get install -y ca-certificates curl unzip zlib1g-dev c2hs pkg-config libreadline-dev debhelper devscripts libgmp-dev alex happy libgtk-3-dev libgirepository-1.0-1 libgirepository1.0-dev gobject-introspection
# Version of stack in ubuntu repos is too old.
RUN curl -sSL https://get.haskellstack.org/ | sh
RUN ln /usr/local/bin/stack /usr/bin/stack

WORKDIR /src
VOLUME /dst

ADD debian-entrypoint.sh /

CMD ["/bin/bash", "/debian-entrypoint.sh"]
9 changes: 9 additions & 0 deletions docker/build-ubuntu-package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -e

SRC=$(realpath $PWD/..)

docker build -t ghcprofview-ubuntu -f Dockerfile.ubuntu .

docker run --name ghcprofview-ubuntu --rm -v $(pwd)/target:/dst -v $(pwd)/stack:/root/.stack -v $SRC:/src ghcprofview-ubuntu

9 changes: 9 additions & 0 deletions docker/builder-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -e

curl -sSL https://github.com/portnov/ghcprofview-hs/archive/master.zip -o master.zip
unzip master.zip && rm master.zip
cd ghcprofview-hs-master/
stack install --work-dir=./build --allow-different-user

cp /root/.local/bin/ghcprofview /dst/
8 changes: 8 additions & 0 deletions docker/debian-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
set -e
set -x

cd /src
bash prepare_debian_package.sh

cp ../*.deb /dst/
13 changes: 13 additions & 0 deletions prepare_debian_package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
set -e
set -x

TARGET=ghcprofview_0.1.0.0.orig.tar.xz
tar -v -cJ --exclude-vcs --exclude='*.cabal' --exclude='*.log' --exclude='*.build' --exclude=./docker --exclude=./work --exclude=./.stack-work --exclude=./debian --exclude=./test --exclude='*.tar.xz' -f ../$TARGET .

LOCAL_INSTALL_ROOT=$(stack path --local-install-root --allow-different-user)
LOCAL_INSTALL_ROOT=$(realpath --relative-to=$PWD $LOCAL_INSTALL_ROOT)
echo "$LOCAL_INSTALL_ROOT/bin/ghcprofview usr/bin" > debian/ghcprofview.install

debuild -uc -us

0 comments on commit e408263

Please sign in to comment.