Skip to content
Snippets Groups Projects
Commit 694045e2 authored by Ruben Rodriguez's avatar Ruben Rodriguez
Browse files

Merge branch 'fsdg/ui5426-calibre' into 'toutatis'

Fix ui5426 EPUB manual included with Calibre steers user toward non-free software

https://trisquel.info/en/issues/5426

This addresses the remaining Toutatis only part of the above aged FSDG user issue.  EPUB format is 'just' a ZIP archive of XHTML, which approximates to a source form.  This helper unpacks the book, does the sed edit, and repacks it.

Calibre copies the book into the user's book library in their home directory on first run. So this fix won't address existing installs unless the user copies the book manually.

The rm:s at the end are a bit cargo cult programming. But I thought them best with the build system still being tweaked.

See merge request !78
parents a45d0712 36b6385b
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
#
# Copyright (C) 2015 Andrew M. Lindley <andrew@andrewlindley.co.uk>
#
# 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 2 of the License, or
# (at your option) any later version.
#
# This program 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, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
VERSION=1
. ./config
TEMP=$(mktemp -d --tmpdir)
TEMP_EPUB=$(mktemp --tmpdir --suffix=.zip -u)
EPUB="resources/quick_start.epub"
unzip $EPUB -d $TEMP
sed 's% or <a href="http://www.bookdesigner.org/wordpress/">Book Designer</a>%%' -i $TEMP/OEBPS/Text/calibre_quick_start_split_007.xhtml
pushd $TEMP
zip --quiet --recurse-paths $TEMP_EPUB .
pushd
mv $TEMP_EPUB $EPUB
chmod 0644 $EPUB
rm -rf $TEMP
changelog 'Remove steer to non-free software from resources/quick_start.epub
#5426'
compile
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment