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 1 commit
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
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ matrix:
script:
# Build the package, its tests, and its docs and run the tests
- test/script
- name: build ff deb
install:
# Build ff
- $STACK build ff
script:
# Create .deb from binary
- make deb
- name: hlint
install:
- $STACK build hlint
Expand Down
36 changes: 36 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Environment
BIN_NAME := ff

LOCAL_BINARY_PATH = $(shell stack path --local-install-root)

LOCAL_FF_VERSION = $(shell stack query locals ff version | tr -d \')

LOCAL_FF_SIZE = $(shell ls -l --b=K $(LOCAL_BINARY_PATH)/bin/$(BIN_NAME) | cut -d " " -f5 | tr -d K)

# prepare deb
.PHONY: deb
deb:
rm -rf ff-deb

mkdir -p ff-deb/
mkdir -p ff-deb/usr/bin
cp $(LOCAL_BINARY_PATH)/bin/$(BIN_NAME) ff-deb/usr/bin/

mkdir ff-deb/DEBIAN
touch ff-deb/DEBIAN/control

echo \
"Package: ff \
\nVersion: $(LOCAL_FF_VERSION) \
\nArchitecture: all \
\nMaintainer: Yuriy Syrovetskiy \
\nInstalled-Size: $(LOCAL_FF_SIZE) \
\nSection: text \
\nPriority: optional \
\nHomepage: https://github.com/ff-notes/ff \
\nDescription: A distributed note taker and task manager." \
>> ff-deb/DEBIAN/control

cp LICENSE ff-deb/DEBIAN/copyright

cd ff-deb && dpkg-deb -b ./ ./