LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Evernote (https://www.linuxquestions.org/questions/slackware-14/evernote-4175466015/)

Iuz 06-14-2013 10:17 AM

Evernote
 
Is there any client for evernote or everpad to slackware 14?

Did not find any on slackbuilds, should I try and do a slackbuild myself for it?

willysr 06-14-2013 10:45 AM

perhaps this one? nevernote ?

Iuz 06-14-2013 03:43 PM

well its a .deb anyway, I'll have to try and make a slackbuild...

ruario 06-14-2013 04:32 PM

Not just debs, they have tars as well:

sourceforge.net/projects/nevernote/files/Current/

Don't bother with their nixnote/install.sh script. Just delete it and run makepkg within the nixnote directory.

EDIT: You can also kill the pointless, empty nixnote/usr/share/man directory.

Iuz 06-14-2013 07:00 PM

worked like a charm, thank you guys very much.

willysr 06-14-2013 08:47 PM

I have make a SlackBuild for nixnote (formerly nevernote) and it's available on SlackHacks. I have also submitted to SBo, but it would take some time before it gets approved by the admins

ruario 06-15-2013 01:30 AM

@willysr: Why use three mkdir commands, followed by three move commands to shift over the files to another directory? You currently have the following:

Code:

mkdir -p $PKG/usr/share/nixnote
mkdir -p $PKG/usr/bin
mkdir -p $PKG/usr/share/applications

cp usr/share/applications/nixnote.desktop $PKG/usr/share/applications
cp -r usr/share/nixnote/* $PKG/usr/share/nixnote
cp -r usr/bin/nixnote.sh $PKG/usr/bin

When you could just do all of this in one command:

Code:

cp -r usr $PKG
Better yet, you could extract straight into $PKG:

Code:

tar xf $CWD/$PRGNAM-${VERSION}_$SOURCEARCH.tar.gz --exclude \*install.sh --exclude \*/share/man --strip 2 -C $PKG
Then run your chown and chmod commands on $PKG itself.

However I would actually give the tar a miss and start with the rpm package, given you are not compiling anything. The advantage of this is that the rpm (and deb) packages include some docs and a man page. The tar does not have these, it just has an empty man directory in the wrong (for Slackware) location. Additionally you do not need to strip or exclude anything. Rather than use rpm2cpio + cpio (as is traditional with rpms), just use bsdtar to do the extraction in one pass, like so:

Code:

bsdtar xf $CWD/$PRGNAM-${VERSION}-${RPMBUILD}_$SOURCEARCH.rpm -C $PKG
Or if you don't want to define RPMBUILD, you could extract the deb in a similar way (albeit with two programs rather than one):

Code:

ar p $CWD/$PRGNAM-${VERSION}_$SOURCEARCH.deb data.tar.gz | tar -xzf- -C $PKG
Also remember to mv the usr/share/doc and usr/share/man directories and their contents to their correct locations.

Code:

mv $PKG/usr/share/{man,doc} $PKG/usr
mv $PKG/usr/doc/$PRGNAM $PKG/usr/doc/${PRGNAM}-$VERSION

Optionally you might want to replace the stupid usr/bin/nixnote shell script with a simple symlink to usr/share/nixnote/nixnote.sh. Personally I would also skip setting things like SLKCFLAGS and LIBDIRSUFFIX since you don't need them (because you never compile and the lib directory is not used). All they currently do is make the SlackBuild harder to follow for inexperienced users, who might try to work out why these are set and how they are used.

willysr 06-15-2013 10:00 AM

Thanks Ruario
I will use your suggestion to simplify to move the content with a single mv command and also to remove SLKCFLAGS and LIBDIRSUFFIX

ruario 06-15-2013 02:24 PM

Cool, I still think you should use the rpm or deb but hey you are the one offering to maintain it so its your call. ;)

P.S. You could always extract the man page from the rpm or deb and have it as an extra file alongside the SlackBuild from where it could be installed. It will probably be OK since these things don't change so often (and this one wasn't even written by the original authors of the software anyway). Again, it is your call though.

P.P.S. You might also want to kill ./usr/share/nixnote/install.sh and ./usr/share/nixnote/uninstall.sh (as I did with my tar --exclude above).

willysr 06-15-2013 07:56 PM

the *.sh is not that harmless, so i will leave it as it is
as for the selection of source, i would rather use the tarballs instead of RPM or DEB format

ruario 06-16-2013 05:07 AM

I don't think I will ever understand why people are reluctant to use an rpm in cases like this. It would make perfect sense to me if the tar was actual source code and the rpm a recompiled binary but that is not the case here. They have exactly the same contents but for a few extra (useful) files in the rpm (i.e. a man page and some docs).

For me what you state is the same as saying "I would rather use tarballs instead of cpio archives as a source", because that is exactly what an rpm is, a compressed cpio archive with a tiny bit of meta information tacked on the front. Those few extra bytes can easily be ignored on any non-rpm distro, where you can consider it just another archive format rather than a package.

Besides the wealth of dedicated, pre-installed tools that can pull apart an rpm provided by Slackware (bsdtar, bsdcio, rpm2cpio, etc.) it is even possible to strip the rpm header off the front of the archive with little more than grep and tail, e.g. the following shell script would do the job for pretty much every rpm you are ever likely to care about:

Code:

#!/bin/sh
RPMINFO=$(LANG=C grep -abom1 ".7zXZ\|BZh9\|$(printf '\x1f\x8b\x08')" $1)
case "$RPMINFO" in
  *:?7zXZ) EXT=xz ;;
  *:BZh9)  EXT=bz2 ;;
  *:*)    EXT=gz ;;
  *)      echo "No compressed archive found in: $1"; exit 1 ;;
esac
tail -c+$(expr 1 + $(echo $RPMINFO | cut -f1 -d:)) $1 > $(basename $1 .rpm).cpio.$EXT

(Yes, the above would fail for an LZMA compressed rpm archives, but these days those are rarer than hens teeth!)

As for using deb packages, everything useful is actually within a tar archive (data.tar.*), with an ar archive wrapped around it (plus a couple of meta files), so here it is the same as saying, "I would rather use tarballs instead of tarballs!" :p

willysr 06-16-2013 08:23 AM

i think that would make the SlackBuild script a lot complex to understand :)

ruario 06-16-2013 09:19 AM

sure but this would not


Code:

bsdtar xf $CWD/$PRGNAM-${VERSION}-${RPMBUILD}_$SOURCEARCH.rpm
Edit: The other code was just to demonstrate that rpm files are really just compressed cpio archives by stripping the small header off the front.

willysr 06-16-2013 10:31 AM

I know about RPM format, but i think most users will prefer to use tarballs instead of RPM and DEBS if they are available

ruario 06-16-2013 11:12 AM

I agree, they might but their reasons are not based on logic.


All times are GMT -5. The time now is 05:36 AM.