michaldaniel / ebook-viewer

Modern GTK Python Ebook Reader app to easily read epub files
GNU General Public License v3.0
410 stars 47 forks source link

Provide please AUR pkg (archlinux) for easy installation #10

Open proft opened 8 years ago

proft commented 8 years ago

It would be nice if we have a AUR pkg, so that we don't have to go through the trouble of compiling :).

joelobrecht commented 8 years ago

I've done one, see below. This project could be a very nice one to be helped to by the Arch community, because it respects entirely Arch philosophy : light, simple, smart, does only one thing.

It's my first one, so please be kind, and check it first :). Also, although it worked, I wasn't able to open books, I guess because of dependencies problems ? But then the forked reader (pPub) had the same errors so... It would have been php or jquery I would have tried to debug...

As it wasn't working, I didn't submit it to the AUR. Spent 5 hours working on it though, so if it can be of use to peers who can pick up from there and make it work :). To make it work just create ~/abs/ebook-viewer, cd to it, and with your favorite editor create a file named PKGBUILD and another named Ebook-Viewer.install and put the corresponding code within. Save, and in a terminal run makepkg -s. It should compile nicely. Then sudo pacman -U yourpackage.tar.xz.

PKGBUILD I added a sed script to remove the gtk-update-cache command to a post-install operation that is in the Ebook-Viewer.install file.

# Maintainer: myself <firstname.name@gmail.com>
pkgname=Ebook-Viewer
pkgver=0.1
pkgrel=1
epoch=
pkgdesc="Modern GTK Python app to easily read ePub files"
arch=('i686' 'x86_64')
url="https://github.com/michaldaniel/Ebook-Viewer"
license=('GPL-3.0')
groups=()
depends=('webkitgtk' 'gobject-introspection' 'python-gobject' 'python3' 'gtk3')
makedepends=('git' 'make')
checkdepends=()
optdepends=()
provides=('Ebook-Viewer')
conflicts=('Ebook-Viewer')
replaces=()
backup=()
options=()
install=$pkgname.install
changelog=
source=("$pkgname::git+https://github.com/michaldaniel/Ebook-Viewer")
noextract=()
md5sums=('SKIP')
validpgpkeys=()

prepare() {
     cd $pkgname
   sed -i '/gtk-update-icon-cache/d' Makefile
    }

build() {
    cd "$pkgname"
    make 
}

package() {
    cd "$pkgname"
    make PREFIX="$pkgdir/usr" install 
}

Ebook-Viewer.install Contains a post-install script to update the icon cache.

post_install() {
  gtk-update-icon-cache -q -t -f usr/share/icons/gnome
}

post_upgrade() {
  post_install
}

post_remove() {
  post_install
}
michaldaniel commented 7 years ago

This script has some errors regarding app naming, I fixed python2 to python3 dependency. For now please guys, hold your horses. When the app is closer to release I'll look into possible distribution channels. Thanks for the PKGBUILD script, after some fixing it can be handy later.

joelobrecht commented 7 years ago

Thanks for the corrections added to the pkgbuild, Now it works perfectly well !!! Nice :) I still think it is worth to contribute it to the AUR as development version (with a "-git" suffix) so arch users can find it with AUR helpers like 'packer'. But perhaps you would like to do this yourself so you can maintain it ?

michaldaniel commented 7 years ago

@quatrecouleurs I'm putting some work into project website right now. I also found great open source user style for epub books, I'm working to make it compatible with light and dark theme, font picking and font size control. The app currently has empty window for settings. Distributing product that is half done to people isn't going to do much good. I feel really flattered so many people star it and install, that you even made a build script for it but putting "maintainer" packages out feels a lot like saying it's ready to adopt. It's not. It will be soon, but not yet.

Then again, it's free software if you want to put in in places who am I to stop you. ¯(ツ)/¯ It feels really good that people are already interested in it tho.

rizaumami commented 7 years ago

Just use AppImage. One file for all distros.

michaldaniel commented 7 years ago

@rizaumami I think of doing .deb + ubuntu PPA, appimage or flatpack and aur. If it gets more popular it might be nice to also include rpm package and whatever those guys use for repositories. This might change when it's time to build and maintain them tho.

probonopd commented 7 years ago

Let me know if you need help on the AppImage.

dunkelstern commented 7 years ago

Hi, i didn't see that someone already made a PKGBUILD. I've created one too and already pushed to the AUR. If you want in as a co-maintainer just tell me and i'll invite you.

proft commented 7 years ago

@dunkelstern Good job! approved :)