diff --git a/debian/changelog b/debian/changelog index a3f969166d2c23a5325988d3d6a05fd8aacc46e4..42a9bd05a1cb0f3d9286d38beb77cf7655dfb02c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +liber (0.2) unstable; urgency=medium + + * Migrated to new on-disk database format. + + -- ale <ale@incal.net> Sat, 13 Feb 2016 13:00:07 +0000 + liber (0.1p6) unstable; urgency=medium * Fixed issues with user input. diff --git a/debian/control b/debian/control index 4a17cd1a351d5c17305fac47e5c3a1a3515a68a6..311d06bc0f369b31994e161371006037fbdd8112 100644 --- a/debian/control +++ b/debian/control @@ -2,13 +2,13 @@ Source: liber Section: net Priority: extra Maintainer: ale <ale@incal.net> -Build-Depends: debhelper (>= 8.0.0), libicu-dev, libleveldb-dev (>=1.15) +Build-Depends: debhelper (>= 8.0.0), dh-systemd (>= 1.5) Standards-Version: 3.9.4 Homepage: https://git.autistici.org/ale/liber Package: liber Architecture: any -Depends: libleveldb1 (>=1.15), libicu48, ${shlibs:Depends}, ${misc:Depends} +Depends: ${shlibs:Depends}, ${misc:Depends} Description: Ebook collection indexer. Index and search an ebook collection. diff --git a/debian/liber.default b/debian/liber.default index 2b126d44b59e1e81f854df93b9f0fa93887a69f1..be75f2f0e559c476ce5e8564ce5392fd7bf8cbcf 100644 --- a/debian/liber.default +++ b/debian/liber.default @@ -3,7 +3,11 @@ #ENABLE_SERVER=true # Set the address (host:port) to listen on. -#ADDR=:4040 +ADDR="--http-server=127.0.0.1:4040" # Directory where books are stored. -#BOOK_DIR=/var/lib/liber/books +BOOK_DIR="--book-dir=/var/lib/liber/books" + +# Put any other options here. +LIBER_OPTIONS= + diff --git a/debian/liber.init b/debian/liber.init index 08ac6769b34538531199e36f338973bca47af025..398a429dc851ab1b870e288fb55419f24641ada6 100755 --- a/debian/liber.init +++ b/debian/liber.init @@ -56,13 +56,13 @@ case "$1" in stop) do_stop ;; - restart) + restart|force-reload) $0 stop sleep 1 $0 start ;; *) - echo "Usage: $0 {start|stop|restart}" >&2 + echo "Usage: $0 {start|stop|restart|force-reload}" >&2 exit 3 ;; esac diff --git a/debian/liber.postinst b/debian/liber.postinst index 510181207b4edbd7ef66c1b24f61a16f37444a2f..2edbe03502012a34d77b848e99909b0b066a153d 100755 --- a/debian/liber.postinst +++ b/debian/liber.postinst @@ -18,14 +18,14 @@ esac #DEBHELPER# -adduser --quiet --system --home /var/lib/liber --no-create-home --ingroup nogroup liber +if ! getent passwd liber >/dev/null; then + useradd --system --home-dir /var/lib/liber -M liber +fi for dir in /var/lib/liber /var/lib/liber/books; do test -d $dir || mkdir $dir chmod 700 $dir - chown liber:nogroup $dir + chown liber $dir done -update-rc.d liber defaults >/dev/null - exit 0 diff --git a/debian/liber.service b/debian/liber.service new file mode 100644 index 0000000000000000000000000000000000000000..a302008ddadae279d89f05ab803fe26105506ee5 --- /dev/null +++ b/debian/liber.service @@ -0,0 +1,14 @@ +[Unit] +Description=Ebook collection indexer +After=network.target + +[Service] +User=liber +EnvironmentFile=/etc/default/liber +ExecStart=/usr/bin/liber $BOOK_DIR $ADDR $LIBER_OPTIONS +Restart=always + +[Install] +WantedBy=multi-user.target + + diff --git a/debian/rules b/debian/rules index 268071dc42c690ae65dc7ca9663b147bfe44c478..12af07b6e28ec8d18e276fb7ec7a360324a9cc2d 100755 --- a/debian/rules +++ b/debian/rules @@ -7,17 +7,29 @@ # This has to be exported to make some magic below work. export DH_OPTIONS +export DH_GOPKG = git.autistici.org/ale/liber + DEBDIR = $(CURDIR)/debian PKGDIR = $(DEBDIR)/liber %: - dh $@ + dh $@ --with systemd override_dh_install: # Build the sources using your locally-installed Go version. - # This is crazy, clearly, but it's a temporary workaround for wheezy. + # NB: This is not an acceptable way to build a proper Debian package. install -m 755 -o root -g root -d $(PKGDIR)/usr/bin install -m 755 -o root -g root -d $(PKGDIR)/usr/share/liber - go build -o $(PKGDIR)/usr/bin/liber cmd/liber/liber.go + -mkdir build + (export PATH=$$PATH:/usr/local/go/bin ; export GOPATH=$(CURDIR)/build ; mkdir -p build/src/$(shell dirname $(DH_GOPKG)) ; ln -s $(CURDIR) build/src/$(DH_GOPKG) ; cd build/src/$(DH_GOPKG) && go install -v ./...) + (for f in liber liberdbtool ; do \ + install -m 755 -o root -g root build/bin/$$f $(PKGDIR)/usr/bin/$$f ; done) (umask 022; cp -R --preserve=timestamps htdocs $(PKGDIR)/usr/share/liber/htdocs) +override_dh_clean: + -rm -fr build + dh_clean + +# Do not enable the liber HTTP server by default. +override_dh_systemd_enable: +