Skip to content

Commit e408263

Browse files
committed
Ubuntu packaging [skip ci].
1 parent 0954b73 commit e408263

19 files changed

+213
-1
lines changed

.gitignore

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
.stack-work/
2-
gtk3test.cabal
32
ghcprofview.cabal
43
*.hi
54
*.o
65
*.swp
76
*~
7+
docker/work
8+
docker/target
9+
docker/stack
10+
docker/build/
11+
debian/ghcprofview/
12+
debian/files
13+
debian/debhelper-build-stamp
14+

debian/changelog

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
ghcprofview (0.1.0.0-1) UNRELEASED; urgency=low
2+
3+
* Initial release
4+
5+
-- Ilya V . Portnov <[email protected]> Sat, 09 Mar 2019 10:56:44 +0500

debian/compat

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9

debian/control

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Source: ghcprofview
2+
Maintainer: Ilya V . Portnov <[email protected]>
3+
Priority: optional
4+
Section: haskell
5+
Build-Depends: debhelper (>= 9)
6+
Standards-Version: 3.9.6
7+
Homepage: https://github.com/githubuser/ghcprofview-hs#readme
8+
X-Description:
9+
Please see the README on GitHub at <https://github.com/githubuser/ghcprofview-hs#readme>
10+
11+
Package: ghcprofview
12+
Architecture: any
13+
Section: misc
14+
Depends: ${shlibs:Depends}
15+
Description: GHC .prof files viewer, implemented in Haskell + Gtk3.
16+
.
17+
Unlike profiterole and profiteur, ghcprofview uses a traditional approach to
18+
profiling. It allows you to view cost centres tree as it is and browse it
19+
interactively, and allows you to do some actions that you may be used to in,
20+
for example, Java's visualvm.
21+

debian/copyright

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2+
Upstream-Name: ghcprofview
3+
Upstream-Contact: [email protected]
4+
Source: https://hackage.haskell.org/package/ghcprofview
5+
6+
Files: *
7+
Copyright: 2018 Author name here
8+
License: BSD3
9+
10+
Files: debian/*
11+
Copyright: held by the contributors mentioned in debian/changelog
12+
License: BSD3
13+
14+
License: BSD3
15+
Copyright Ilya Portnov (c) 2018
16+
.
17+
All rights reserved.
18+
.
19+
Redistribution and use in source and binary forms, with or without
20+
modification, are permitted provided that the following conditions are met:
21+
.
22+
* Redistributions of source code must retain the above copyright
23+
notice, this list of conditions and the following disclaimer.
24+
.
25+
* Redistributions in binary form must reproduce the above
26+
copyright notice, this list of conditions and the following
27+
disclaimer in the documentation and/or other materials provided
28+
with the distribution.
29+
.
30+
* Neither the name of Author name here nor the names of other
31+
contributors may be used to endorse or promote products derived
32+
from this software without specific prior written permission.
33+
.
34+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
35+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
36+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
37+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
38+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
39+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
40+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
41+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
42+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
43+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
44+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

debian/ghcprofview.debhelper.log

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
dh_prep
2+
dh_installdirs
3+
dh_install
4+
dh_installdocs
5+
dh_installchangelogs
6+
dh_installman
7+
dh_installdebconf
8+
dh_compress
9+
dh_fixperms
10+
dh_strip
11+
dh_makeshlibs
12+
dh_shlibdeps
13+
dh_installdeb
14+
dh_gencontrol
15+
dh_md5sums
16+
dh_builddeb
17+
dh_builddeb

debian/ghcprofview.dirs

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
usr/bin

debian/ghcprofview.install

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.stack-work/install/x86_64-linux/f328d036c19212621926aa2ee41f803cf30cd4dff8e8592f72da38ad18df83b3/8.6.5/bin/ghcprofview usr/bin

debian/ghcprofview.substvars

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
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)
2+
misc:Depends=
3+
misc:Pre-Depends=

debian/rules

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/usr/bin/make -f
2+
3+
clean:
4+
rm -rf debian/ghcprofview
5+
rm -rf *.log
6+
rm -rf *.cabal
7+
stack clean --allow-different-user
8+
9+
check:
10+
11+
build-arch: build
12+
13+
build:
14+
stack build --allow-different-user
15+
16+
override_dh_auto_build:
17+
stack build --allow-different-user
18+
19+
binary-arch: binary
20+
21+
binary:
22+
dh_clean
23+
dh_testroot
24+
dh_prep
25+
dh_installdirs
26+
dh_install
27+
dh_installdocs
28+
dh_installchangelogs
29+
dh_installman
30+
dh_installdebconf
31+
dh_compress
32+
dh_fixperms
33+
dh_strip
34+
dh_makeshlibs
35+
dh_shlibdeps
36+
dh_installdeb
37+
dh_gencontrol
38+
dh_md5sums
39+
dh_builddeb
40+
41+
%:
42+
dh $@
43+

debian/source/format

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.0 (quilt)

debian/source/options

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
tar-ignore = .git
2+
tar-ignore = .gitignore
3+
tar-ignore = .stack-work
4+
tar-ignore = debian
5+
tar-ignore = docker
6+
tar-ignore = test
7+
tar-ignore = *.tar.xz
8+
tar-ignore = *.cabal
9+
10+
extend-diff-ignore = "(^|/)(\.git|\.gitignore|\.stack-work|debian|docker|test|.*tar.xz|.*cabal)"
11+

debian/watch

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
version=3
2+
https://hackage.haskell.org/package/ghcprofview/distro-monitor .*-([0-9\.]+)\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))

docker/.dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
stack/

docker/Dockerfile.ubuntu

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM ubuntu
2+
MAINTAINER Ilya V. Portnov <[email protected]>
3+
4+
RUN apt-get update -y && \
5+
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
6+
# Version of stack in ubuntu repos is too old.
7+
RUN curl -sSL https://get.haskellstack.org/ | sh
8+
RUN ln /usr/local/bin/stack /usr/bin/stack
9+
10+
WORKDIR /src
11+
VOLUME /dst
12+
13+
ADD debian-entrypoint.sh /
14+
15+
CMD ["/bin/bash", "/debian-entrypoint.sh"]

docker/build-ubuntu-package.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
set -e
3+
4+
SRC=$(realpath $PWD/..)
5+
6+
docker build -t ghcprofview-ubuntu -f Dockerfile.ubuntu .
7+
8+
docker run --name ghcprofview-ubuntu --rm -v $(pwd)/target:/dst -v $(pwd)/stack:/root/.stack -v $SRC:/src ghcprofview-ubuntu
9+

docker/builder-entrypoint.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
set -e
3+
4+
curl -sSL https://github.com/portnov/ghcprofview-hs/archive/master.zip -o master.zip
5+
unzip master.zip && rm master.zip
6+
cd ghcprofview-hs-master/
7+
stack install --work-dir=./build --allow-different-user
8+
9+
cp /root/.local/bin/ghcprofview /dst/

docker/debian-entrypoint.sh

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
set -e
3+
set -x
4+
5+
cd /src
6+
bash prepare_debian_package.sh
7+
8+
cp ../*.deb /dst/

prepare_debian_package.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
set -e
3+
set -x
4+
5+
TARGET=ghcprofview_0.1.0.0.orig.tar.xz
6+
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 .
7+
8+
LOCAL_INSTALL_ROOT=$(stack path --local-install-root --allow-different-user)
9+
LOCAL_INSTALL_ROOT=$(realpath --relative-to=$PWD $LOCAL_INSTALL_ROOT)
10+
echo "$LOCAL_INSTALL_ROOT/bin/ghcprofview usr/bin" > debian/ghcprofview.install
11+
12+
debuild -uc -us
13+

0 commit comments

Comments
 (0)