Skip to content

Commit

Permalink
initial files
Browse files Browse the repository at this point in the history
  • Loading branch information
phlummox committed Feb 1, 2022
1 parent 5a2307f commit e69e26a
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.*.swp
47 changes: 47 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@

.PHONY: build-deb clean

.DELETE_ON_ERROR:

VERSION=0.12.1
RESTIC_URL = https://github.com/restic/restic/releases/download/v$(VERSION)/restic_$(VERSION)_linux_amd64.bz2

RESTIC=usr/bin/restic
RESTIC_MAN=usr/share/man/man1/restic.1
RESTIC_BASH_COMPLETION=usr/share/bash-completion/completions/restic
DEB_CONTROL=restic-0.12.1/debian/control

$(RESTIC):
mkdir -p `dirname $@`
curl -L $(RESTIC_URL) | bunzip2 > $@
chmod a+rx $@

$(RESTIC_BASH_COMPLETION): $(RESTIC)
mkdir -p `dirname $@`
$(RESTIC) generate --bash-completion $@

$(RESTIC_MAN): $(RESTIC)
mkdir -p `dirname $@`
$(RESTIC) generate --man `dirname $@`

restic-$(VERSION).tgz: $(RESTIC_MAN) $(RESTIC_BASH_COMPLETION)
fakeroot tar cf $@ --gzip ./usr

# generate dirs + files directly needed to build .deb
restic-$(VERSION): restic-$(VERSION).tgz
fakeroot alien --generate --to-deb \
--description "restic backup program" \
$<

restic_0.12.1-2_all.deb: restic-$(VERSION)
sed -i 's|^Maintainer:.*|Maintainer: https://github.com/phlummox-dev/restic-deb/|' $(DEB_CONTROL)
sed -i 's/^Architecture:.*/Architecture: amd64/' $(DEB_CONTROL)
sed -i 's/^Section:.*/Section: utils/' $(DEB_CONTROL)
echo "Homepage: https://github.com/restic/restic" >> $(DEB_CONTROL)
cd $< && fakeroot ./debian/rules binary

build-deb: restic_$(VERSION)-2_all.deb

clean:
-rm -rf restic* usr

34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

# restic-deb

[restic][restic-repo], shoved into a .deb file (created
using the [alien][alien] package converter).

The .deb file contains the static binary, man pages,
and bash-completion function.

## rationale

As at the time of writing (Jan 2022), the version of restic contained in
the Ubuntu repositories is missing bugfixes and capabilities found in
recent versions of restic (e.g. the ability to use [rclone][rclone]
backends, added in restic 0.9.0 in 2018).

So this repo downloads the static binary for restic 0.12.1 from the
GitHub releases page for restic, uses it generate man pages and a bash
completion file, and shoves it all into a .deb.

[restic-repo]: https://github.com/restic/restic/
[alien]: https://sourceforge.net/projects/alien-pkg-convert/
[rclone]: https://github.com/rclone/rclone

## copyright

The restic binary and everything it generates are licensed under the BSD
2-Clause "Simplified" License ([here][restic-license]).

[restic-license]: https://github.com/restic/restic/blob/master/LICENSE

Insofar as they represent anything copyrightable, the contents of this
repo are placed in the public domain.

22 changes: 22 additions & 0 deletions UNLICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of
this software dedicate any and all copyright interest in the software to
the public domain. We make this dedication for the benefit of the public
at large and to the detriment of our heirs and successors. We intend
this dedication to be an overt act of relinquishment in perpetuity of
all present and future rights to this software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

For more information, please refer to <http://unlicense.org/>

0 comments on commit e69e26a

Please sign in to comment.