diff --git a/.travis.yml b/.travis.yml index 33f6c18f..bda7ad97 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,20 +1,31 @@ language: c -matrix: - include: - # Access more recent gcc and clang via a Trusty image - - os: linux - dist: trusty - compiler: gcc - - os: linux - dist: trusty - compiler: clang - - os: osx - compiler: gcc - - os: osx - compiler: clang -script: - - export CFLAGS=-Werror - - make clean - - make - - make clean - - make -f Makefile.generic +sudo: required +env: + matrix: + - OS_TYPE=centos OS_VERSION=7 + - OS_TYPE=fedora OS_VERSION=24 +services: + - docker + +before_install: + - sudo docker pull $OS_TYPE:$OS_VERSION + +script: + - ./build-docker $OS_TYPE $OS_VERSION + - sudo chown -R $(id -un).$(id -gn) dist + +after_success: +- ls -l dist + +deploy: + skip_cleanup: true + provider: releases + api-key: + secure: ZtMbo/H21MoodNvw7+tvPId97meS4Xs2beUzqOhI166iuaLSWtjXxQgeC7vdYTWgPNacN6gxwhnXTLMXpt81a7g0NWxjRQ72/Rwh7aCdgQkJI/Y+0c7RNNVdLOtAWBM8csPoJy0jFdI34yHRj053tm9x65V4fMEKC9ArRm7pbTjNNovYXbW2KmRh6kr3dJdB/7tpoCpiMov6l4uHyWIcniFx97P+3dGnGqBd8SpR3IxeEypm8fzIGiX7NIJqwyG5MbLaWoyloBu21ilwh07dDifF6MI4mrkxtGY0yQ9GtHVp5cr7qyMgCt60hUGtrKhTtPQWwpzK0GSZ5eeYiLt6I/kkcj8FkWP+OazRLy/MydjGtG7q8tnbgNcmGqsbv+g1jJMEfZsnTfozeGOPPsYlhB/7kCi2BVqguXlKMRmpNPMZsc4HYK9yjV4HNsEkmwJcXgD350XS5iFu/koIGiT2PJ+/msdwPir74JpgRn00iGC0fD25V8M2TRnKn43g6jNRAZYMITaYDx+ML0SkdWIjksalW0759BgLfQopNbs9a9PbsKiNbfRRRF3xA8j2fQI6my7hXx0TzRwWTC7aMAuJkdjKn5UYOrMAZ+VXhHSOcX5LPiefwgtoU0YGjgWQdgTkQ7aR13rKuDSKepGonnkyiHWnM9gGftnNbNFi7WZRk5w= + file_glob: true + file: + - dist/*.deb + - dist/*.rpm + on: + repo: jarun/nnn +tags: true diff --git a/build-docker b/build-docker new file mode 100755 index 00000000..6be8c7a9 --- /dev/null +++ b/build-docker @@ -0,0 +1,42 @@ +#!/bin/bash + +set -xe + +if [[ $# -ne 2 ]]; then + echo "Usage: $0 " + exit 1 +fi + +os_type="$1" +os_version="$2" + +docker_args="-e OS_TYPE=$os_type -e OS_VERSION=$os_version -v $(pwd):/build:rw --rm=true" + +case $os_type in + centos|fedora) + # check for correct package manager + if [[ $os_type == "fedora" ]]; then + YUM=dnf + else + YUM=yum + fi + + # set up the docker image with a baseline + cat >Dockerfile < #include #include #include @@ -30,6 +29,7 @@ #include #include #include +#include #define __USE_XOPEN_EXTENDED #include diff --git a/redhat/build-rpm b/redhat/build-rpm new file mode 100755 index 00000000..bc05625a --- /dev/null +++ b/redhat/build-rpm @@ -0,0 +1,25 @@ +#!/bin/bash + +set -xe + +# create the rpm tree +rpmdir=$(mktemp -d) +install -d -m0755 $rpmdir/{BUILD,BUILDROOT,RPMS/$(uname -m),SOURCES,SPECS,SRPMS} + +# copy the sources into place +cp redhat/nnn.spec $rpmdir/SPECS/nnn.spec +vers=$(git describe --always | sed 's/^v//' | tr - .) +sed -i -e "s/Version:\s*\(\S\+\)/Version: $vers/" $rpmdir/SPECS/nnn.spec +git archive --prefix=nnn-$vers/ --format=tar.gz -o $rpmdir/SOURCES/nnn-$vers.tar.gz HEAD + +# do the build +( cd $rpmdir/SPECS && rpmbuild --define="%_topdir $rpmdir" -ba nnn.spec ) + +# retreive the artifacts +mkdir -p dist +cp $rpmdir/{SRPMS,RPMS/*}/*.rpm dist/ + +# clean up +rm -rf $rpmdir + +# vim: et:ai:ts=4:sw=4 diff --git a/redhat/nnn.spec b/redhat/nnn.spec new file mode 100644 index 00000000..07efaca1 --- /dev/null +++ b/redhat/nnn.spec @@ -0,0 +1,48 @@ +%global debug_package %{nil} + +Name: nnn +Version: 1.0 +Release: 1%{?dist} +Summary: The missing terminal file browser for X + +Group: Applications/Engineering +License: GPLv3 +URL: https://github.com/jarun/nnn +Source0: %{name}-%{version}.tar.gz + +BuildRequires: gcc binutils make gzip +BuildRequires: ncurses-devel readline-devel + +%description +nnn is a fork of noice, a blazing-fast lightweight terminal file browser with easy keyboard shortcuts for navigation, opening files and running tasks. noice is developed considering terminal based systems. There is no config file and mime associations are hard-coded. However, the incredible user-friendliness and speed make it a perfect utility on modern distros. + +nnn can use the default desktop opener at runtime. It also comes with nlay - a customizable bash script to handle media types. It adds new navigation options, enhanced DE integration, a disk usage analyzer mode, comprehensive file details and much more. Add to that a huge performance boost. For a detailed comparison, visit nnn vs. noice. + +If you want to edit a file in vim with some soothing music in the background while referring to a spec in your GUI PDF viewer, nnn got it! All from the same terminal session. Follow the instructions in the quickstart section and see how nnn simplifies those long desktop sessions... + +%prep +%setup -q + + +%build +make %{?_smp_mflags} + +%install +%{__install} -m755 -d %{buildroot}%{_bindir} +%{__install} -m755 -d %{buildroot}%{_mandir}/man1 +%{__install} -m755 nnn %{buildroot}%{_bindir}/nnn +%{__install} -m755 nlay %{buildroot}%{_bindir}/nlay +%{__install} -m644 nnn.1 %{buildroot}%{_mandir}/man1/nnn.1 + +%files +%{_bindir}/nnn +%{_bindir}/nlay +%{_mandir}/man1/nnn.1.gz +%doc README.md +%doc LICENSE +%doc CHANGELOG + + +%changelog +* Wed Apr 26 2017 Michael Fenn - 1.0-1 +- Initial RPM