Skip to content

Pack ff in deb #115 #206

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions dockers/debianizer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
FROM ubuntu:18.04

ENV LANG=C.UTF-8 \
LC_ALL=C.UTF-8

ARG EULER_UID
ARG EULER_GID
ARG STACK_RESOLVER
ARG apt_install="apt install --no-install-recommends --yes"
ARG PACKAGE_NAME=ff
ARG USER=ff
ARG GROUP=ff
ARG HOME=/home/$USER
ARG REPO=$HOME/ff-repo
ARG TMP_BIN=$HOME/temp
ARG BUILD_DIRECTORY=$HOME/ff-deb
ARG DEB=$HOME/deb
ARG BIN=$BUILD_DIRECTORY/opt/$PACKAGE_NAME

RUN \
# Check for mandatory build arguments
: "${EULER_UID:?mandatory build argument is missing}" \
: "${EULER_GID:?mandatory build argument is missing}" \
: "${STACK_RESOLVER:?mandatory build argument is missing}"

RUN groupadd -g ${EULER_GID} $GROUP
RUN useradd -m -u ${EULER_UID} -g ${EULER_GID} $USER

RUN mkdir -p $HOME/.stack
RUN mkdir -p $TMP_BIN
RUN mkdir -p $REPO
RUN mkdir -p $BUILD_DIRECTORY
RUN mkdir -p $BIN
RUN mkdir -p $DEB
RUN chown -R ${EULER_UID}:${EULER_GID} $HOME/

RUN apt update
RUN $apt_install lintian fakeroot debhelper git curl tree \
g++ libtinfo-dev zlib1g-dev qt5-default ca-certificates libgmp-dev

WORKDIR $HOME
RUN tree

RUN curl -sSL https://get.haskellstack.org/ | sh

RUN git clone https://github.com/willbasky/ff.git $REPO
RUN chown -R ${EULER_UID}:${EULER_GID} $HOME/

RUN tree

WORKDIR $BUILD_DIRECTORY
COPY ./ff-deb .

# WORKDIR $HOME
# RUN tree

WORKDIR $REPO
RUN stack --allow-different-user --local-bin-path=$TMP_BIN/ install $PACKAGE_NAME

WORKDIR $HOME
RUN cp $TMP_BIN/$PACKAGE_NAME $BIN

RUN tree

WORKDIR $BUILD_DIRECTORY
RUN dpkg-buildpackage -rfakeroot -b -us -uc -d

WORKDIR $HOME
RUN lintian --suppress-tags dir-or-file-in-opt,embedded-library *.deb

RUN cp *.deb $DEB
5 changes: 5 additions & 0 deletions dockers/debianizer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Guide for debianizer

- You want `docker` and `docker-compose` and [yq](https://github.com/kislyuk/yq) be installed for doing `deb`
- Launch `make deb` command from project root directory for debianizing
- Working of final deb checked with `Ubuntu-18.04`, `Ubuntu-20.04` and `Ubuntu-21.04`
14 changes: 14 additions & 0 deletions dockers/debianizer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: "3"
services:

ff:
image: ff-deb
build:
context: .
dockerfile: Dockerfile
args:
EULER_UID: ${EULER_UID}
EULER_GID: ${EULER_GID}
STACK_RESOLVER: ${STACK_RESOLVER}
stdin_open: true
tty: true
5 changes: 5 additions & 0 deletions dockers/debianizer/ff-deb/debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ff (0.15) unstable; urgency=medium

* Initial Release.

-- Yuriy Syrovetskiy <<[email protected]>> Tue, 05 Nov 2019 18:44:35 +0500
1 change: 1 addition & 0 deletions dockers/debianizer/ff-deb/debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10
12 changes: 12 additions & 0 deletions dockers/debianizer/ff-deb/debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Source: ff
Section: text
Priority: optional
Maintainer: Yuriy Syrovetskiy <[email protected]>
Standards-Version: 0.15

Package: ff
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Homepage: https://github.com/ff-notes/ff
Description: Distributed note taker and task manager.
Available offline and synchronizes without conflicts.
22 changes: 22 additions & 0 deletions dockers/debianizer/ff-deb/debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: ff
Source: https://github.com/ff-notes/ff

Files: debian/*
Copyright: 2019 Yuriy Syrovetskiy <[email protected]>
License: GPL-3.0+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
.
On Debian systems, the complete text of the GNU General
Public License version 3 can be found in /usr/share/common-licenses/GPL-3.
103 changes: 103 additions & 0 deletions dockers/debianizer/ff-deb/debian/docs/ff.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6.
.TH VERSION "1" "November 2019" "Version 0.13, Git revision 9ed639fdf16f5bbe85dd6b4168faf4f9f0b73757, dirty" "User Commands"
.SH NAME
Version \- ff
.SH SYNOPSIS
.B ff
[\fI\,-b|--brief\/\fR] [\fI\,-C|--data-dir DIRECTORY\/\fR] \fI\,(\/\fR[\fI\,-V|--version\/\fR] \fI\,| \/\fR[\fI\,COMMAND\/\fR] \fI\,|\/\fR
.SH DESCRIPTION
.IP
[\-l|\-\-limit ARG] ([\-n|\-\-no\-tag] | [\-\-tag TAG]...)
[\-\-without\-tag TAG]...)
.IP
A note taker and task tracker
.SS "Available options:"
.TP
\fB\-b\fR,\-\-brief
List only note titles and ids
.TP
\fB\-C\fR,\-\-data\-dir DIRECTORY
Path to the data dir
.TP
\fB\-V\fR,\-\-version
Current ff\-note version
.TP
\fB\-l\fR,\-\-limit ARG
Number of issues
.TP
\fB\-n\fR,\-\-no\-tag
Filter items that has no tags
.TP
\fB\-\-tag\fR TAG...
Filter by tag
.TP
\fB\-\-without\-tag\fR TAG...
Filter items without tag
.TP
\fB\-h\fR,\-\-help
Show this help text
.SS "Available commands:"
.TP
add
add new task or note
.TP
agenda
show what you can do right now [default action]
.TP
config
show/edit configuration
.TP
contact
show contacts
.TP
delete
delete a task
.TP
done
mark a task done (archive)
.TP
edit
edit a task or a note
.TP
new
synonym for `add`
.TP
postpone
make a task start later
.TP
search
search for notes with the given text
.TP
show
show note by id
.TP
tags
show tags of all notes
.TP
sponsors
show project sponsors
.TP
track
track issues from external sources
.TP
unarchive
restore the note from archive
.TP
upgrade
check and upgrade the database to the most recent
format
.TP
wiki
show all wiki notes
.SH "SEE ALSO"
The full documentation for
.B Version
is maintained as a Texinfo manual. If the
.B info
and
.B Version
programs are properly installed at your site, the command
.IP
.B info Version
.PP
should give you access to the complete manual.
1 change: 1 addition & 0 deletions dockers/debianizer/ff-deb/debian/ff.dirs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
opt/ff
1 change: 1 addition & 0 deletions dockers/debianizer/ff-deb/debian/ff.install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
opt/ff/ff
1 change: 1 addition & 0 deletions dockers/debianizer/ff-deb/debian/ff.manpages
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docs/ff.1
10 changes: 10 additions & 0 deletions dockers/debianizer/ff-deb/debian/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
# postinst script
#
# see: dh_installdeb(1)

set -e

ln -sf /opt/ff/ff /usr/bin/ff

exit 0
7 changes: 7 additions & 0 deletions dockers/debianizer/ff-deb/debian/postrm
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

set -e

rm -f /usr/bin/ff

exit 0
25 changes: 25 additions & 0 deletions dockers/debianizer/ff-deb/debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1


# see FEATURE AREAS in dpkg-buildflags(1)
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed


%:
dh $@


# dh_make generated override targets
# This is example for Cmake (See https://bugs.debian.org/641051 )
#override_dh_auto_configure:
# dh_auto_configure -- # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)

103 changes: 103 additions & 0 deletions dockers/debianizer/ff-deb/docs/ff.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6.
.TH VERSION "1" "November 2019" "Version 0.13, Git revision 9ed639fdf16f5bbe85dd6b4168faf4f9f0b73757, dirty" "User Commands"
.SH NAME
Version \- ff
.SH SYNOPSIS
.B ff
[\fI\,-b|--brief\/\fR] [\fI\,-C|--data-dir DIRECTORY\/\fR] \fI\,(\/\fR[\fI\,-V|--version\/\fR] \fI\,| \/\fR[\fI\,COMMAND\/\fR] \fI\,|\/\fR
.SH DESCRIPTION
.IP
[\-l|\-\-limit ARG] ([\-n|\-\-no\-tag] | [\-\-tag TAG]...)
[\-\-without\-tag TAG]...)
.IP
A note taker and task tracker
.SS "Available options:"
.TP
\fB\-b\fR,\-\-brief
List only note titles and ids
.TP
\fB\-C\fR,\-\-data\-dir DIRECTORY
Path to the data dir
.TP
\fB\-V\fR,\-\-version
Current ff\-note version
.TP
\fB\-l\fR,\-\-limit ARG
Number of issues
.TP
\fB\-n\fR,\-\-no\-tag
Filter items that has no tags
.TP
\fB\-\-tag\fR TAG...
Filter by tag
.TP
\fB\-\-without\-tag\fR TAG...
Filter items without tag
.TP
\fB\-h\fR,\-\-help
Show this help text
.SS "Available commands:"
.TP
add
add new task or note
.TP
agenda
show what you can do right now [default action]
.TP
config
show/edit configuration
.TP
contact
show contacts
.TP
delete
delete a task
.TP
done
mark a task done (archive)
.TP
edit
edit a task or a note
.TP
new
synonym for `add`
.TP
postpone
make a task start later
.TP
search
search for notes with the given text
.TP
show
show note by id
.TP
tags
show tags of all notes
.TP
sponsors
show project sponsors
.TP
track
track issues from external sources
.TP
unarchive
restore the note from archive
.TP
upgrade
check and upgrade the database to the most recent
format
.TP
wiki
show all wiki notes
.SH "SEE ALSO"
The full documentation for
.B Version
is maintained as a Texinfo manual. If the
.B info
and
.B Version
programs are properly installed at your site, the command
.IP
.B info Version
.PP
should give you access to the complete manual.
Binary file added dockers/debianizer/ff_0.15_amd64.deb
Binary file not shown.
Loading