LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Simplenote or similar .deb package install Slackware64 14.2? (https://www.linuxquestions.org/questions/slackware-14/simplenote-or-similar-deb-package-install-slackware64-14-2-a-4175627828/)

globetrotterdk 04-17-2018 03:27 AM

Simplenote or similar .deb package install Slackware64 14.2?
 
I have studied the threads that I have been able to find on using .deb files in Slackware, and bassmadrigal seems to have the best KISS method for extracting the contents of a .deb file:
Code:

ar p package-name-0.1.2.deb data.tar.xz | unxz | tar -xv
When I run:
Code:

ar p Simplenote-linux-1.1.3.deb data.tar.xz | unxz | tar -xv
I get two directories ("opt" and "usr") with the contents of the .deb file. How do you tell if everything needed to create a Slackware package is in the correct place? Specifically, what do you need to look out for?

I have found this command:
Code:

makepkg -l y -c n ../app-version-arch-tag.tgz
in the Slackware Docs
According to the manpage, the "-l" option seems safe:
Quote:

If y, add any symbolic links found to the install script (doinst.sh) and delete them.
as does the "-c" option, but what is the alternative to default permission and ownership for a Slackware package? Here, I am particularly wondering if the complexity of the program has an effect or simply the number of directories generated by "ar". I could imagine that a more complex program such as a DAW would need to be treated with more care...

Any advice on creating a Simplenote (or similar) Slackware package?

Didier Spaier 04-17-2018 04:36 AM

Quote:

Originally Posted by globetrotterdk (Post 5844072)
When I run:
Code:

ar p Simplenote-linux-1.1.3.deb data.tar.xz | unxz | tar -xv
I get two directories ("opt" and "usr") with the contents of the .deb file. How do you tell if everything needed to create a Slackware package is in the correct place? Specifically, what do you need to look out for?

You need to look at everything and ask yourself for each item these questions:
  1. Do i need this in the package?
  2. Where should it be installed in Slackware?
This being said there is also a tar binary package available and personally, I would certainly stay away from an app the needs a web account to be used, not knowing who stores the notes and where.

globetrotterdk 04-17-2018 04:52 AM

Quote:

Originally Posted by Didier Spaier (Post 5844091)
You need to look at everything and ask yourself for each item these questions:
  1. Do i need this in the package?
  2. Where should it be installed in Slackware?

Thanks for the reply. These questions are a bit difficult to answer as I am relatively new to Slackware and have never tried this before.

Quote:

Originally Posted by Didier Spaier (Post 5844091)
This being said there is also a tar binary package available and personally, I would certainly stay away from an app the needs a web account to be used, not knowing who stores the notes and where.

So in this instance, I should use src2pkg with the tar binary package? I have used Simplenote for some years, mainly to save notes that I have written about songs that I practice playing by ear in my rehearsal room, so I am not really worried about giving info away. I always have it with me on my phone and I can edit at home or on the road without much effort. It is also a way to avoid Google Keep :)

Skaendo 04-17-2018 04:57 AM

Quote:

Originally Posted by globetrotterdk (Post 5844094)
So in this instance, I should use src2pkg with the tar binary package? I have used Simplenote for some years, mainly to save notes that I have written about songs that I practice playing by ear in my rehearsal room, so I am not really worried about giving info away. I always have it with me on my phone and I can edit at home or on the road without much effort. It is also a way to avoid Google Keep :)

The package that Didier linked to is a binary package, in theory you should be able to extract it and run it. If you wanted to get fancy and make a SlackBuild for it you would need to figure out where you want to install it (probably /opt) make a .desktop, link icons, link the binary and so on. If you want a SlackBuild I could make one and put it in my GitHub repo, but I probably wouldn't test the program itself or maintain it.

EDIT:
Actually, here you go:
https://github.com/Skaendo/slackbuil...ter/Simplenote

I've also submitted it to SBo so it should be there by this weekend. But I don't plan on keeping up with it too often. If you see that there is a update let me know and I'll update it.

Or you can take it over, it shouldn't need more than a version bump when it gets updated.

55020 04-17-2018 06:29 AM

Protip: these Electron packages are truly *awful*. Just look at the ocean of bloat inside that thing.

Skaendo 04-17-2018 06:31 AM

Quote:

Originally Posted by 55020 (Post 5844125)
Protip: these Electron packages are truly *awful*. Just look at the ocean of bloat inside that thing.

Sorry I had to remove and resubmit the SlackBuild. I forgot to add the doinst.sh to the SlackBuild.

55020 04-17-2018 06:39 AM

Ssssh!!! that's our secret :)

globetrotterdk 04-17-2018 01:02 PM

Quote:

Originally Posted by 55020 (Post 5844125)
Protip: these Electron packages are truly *awful*. Just look at the ocean of bloat inside that thing.

I know! It is really disappointing that the developers have apparently shifted to Electron.

globetrotterdk 04-17-2018 01:10 PM

Quote:

Originally Posted by Skaendo (Post 5844127)
Sorry I had to remove and resubmit the SlackBuild. I forgot to add the doinst.sh to the SlackBuild.

I need to ask - how did you learn to write SlackBuild scripts? I have looked at a couple of beginner howtos, but your script is over my head. I went through it and found a lot of stuff at the beginning that I assume is for Github and SlackBuilds.org verification (and of course this is unfortunately an Electron program), but there still seems to be way more links, HTML, metadata and such than I would expect in a SlackBuild script.

bassmadrigal 04-17-2018 03:51 PM

Quote:

Originally Posted by globetrotterdk (Post 5844284)
I need to ask - how did you learn to write SlackBuild scripts? I have looked at a couple of beginner howtos, but your script is over my head. I went through it and found a lot of stuff at the beginning that I assume is for Github and SlackBuilds.org verification (and of course this is unfortunately an Electron program), but there still seems to be way more links, HTML, metadata and such than I would expect in a SlackBuild script.

The SlackBuild itself is relatively straightforward and mostly well commented (beyond the normal commands that exist in most SlackBuilds like setting the variables, extracting the source, and ensuring proper permissions are there).

The .info file is used by SBo (SlackBuilds.org) to provide all the information on the program, the homepage, the download location, the md5sum to ensure the download isn't corrupted, and the maintainer's information. It can also include dependencies if the program requires them. These are used to display the information you see on a program's page on SBo (in addition to the README).

The slack-desc is a file used by Slackware's package manager to display the information on the package. You can view this information in pkgtool.

The doinst.sh is an optional post-install script that can do things like update menus/icons, copy new configs into place, and create any symlinks that might be needed.

Finally, he also included a .desktop file, which will allow this program to be accessed within "start" menus of various Window Managers/Desktop Environments like KDE or XFCE. Many programs will include this automatically and won't need to be generated by the maintainer.

If you have any specific questions on what code or files do, feel free to ask and one of us would be happy to answer :)

Skaendo 04-17-2018 06:14 PM

Quote:

Originally Posted by globetrotterdk (Post 5844284)
I need to ask - how did you learn to write SlackBuild scripts? I have looked at a couple of beginner howtos, but your script is over my head. I went through it and found a lot of stuff at the beginning that I assume is for Github and SlackBuilds.org verification (and of course this is unfortunately an Electron program), but there still seems to be way more links, HTML, metadata and such than I would expect in a SlackBuild script.

For me it took a little bit of studying a SlackBuild someone else made, opening up the source/binary archive, comparing them, seeing what was going on and it just made sense to me. The first one that I made was a simple binary repackage (like this Simplenote one) where all I had to do was extract the archive and put everything in the right place, then I moved on to a source build.

This is really the only part of the SlackBuild that I had to write:
Code:

# Install into /opt
mkdir -p $PKG/opt/Simplenote
cp -vr * $PKG/opt/Simplenote

# Link the Binary
mkdir -p $PKG/usr/bin
ln -s /opt/Simplenote/Simplenote $PKG/usr/bin/Simplenote

# Link the Icon
mkdir -p $PKG/usr/share/icons/hicolor/256x256/apps
ln -s /opt/Simplenote/Simplenote.png \
  $PKG/usr/share/icons/hicolor/256x256/apps/Simplenote.png

# Install the .desktop file
mkdir -p $PKG/usr/share/applications
cp $CWD/$PRGNAM.desktop $PKG/usr/share/applications

and i "borrowed" the .desktop file from the Debian package.

After some time and figuring out how to find the options that you can use (like './configure -h' for a autotools build) it became relatively easy. (I'm no pro and the guys over at SBo still have to touch up any new ones that I submit)

I also use a handy little tool called mkslack by David Woodfall that you run against the source archive and it figures out what kind of build job it is and makes the necessary files (.SlackBuild, .info, slack-desc, etc) then you only need to fill in the blanks of what cannot be done automagically.

You are not going to get the first one perfect the first time, at least I didn't, and some are more difficult than others. A little bit of bash scripting knowledge goes a long way with making SlackBuilds.

bassmadrigal has laid out a very good overview of the files.

You can also look at the templates they have over at SBo to get a feel of what is a pretty standard SlackBuild, and they are well commented:
https://slackbuilds.org/templates/
I would suggest saving one and opening it in a text editor so that you get the syntax highlighting.


All times are GMT -5. The time now is 05:47 PM.