You are not logged in.

#1 2008-09-15 22:57:27

Bionic Apple
Member
Registered: 2008-08-05
Posts: 59

Easystroke: Mouse Gestures

From Tombuntu and lifehacker I discovered a mouse gesture application for X11.  It is still in early stages of development, but works really well.  Upon discovering this, I decided to learn packaging for Arch Linux and use this as a test.  After a couple of tries to get my package to work, I have given up and decided this program is too strange for a beginner.  I have already done the monotonous work (I think).  So, can you guys just finish it?

Project site

Download

My PKGBUILD

Pictures from Tombuntu/lifehacker:

___________________________________________________________________________

easystroke_cropped.jpg
___________________________________________________________________________

easystroke_action.jpg
___________________________________________________________________________

easystroke1.jpg
___________________________________________________________________________

Offline

#2 2008-09-16 04:28:51

foutrelis
Developer
From: Athens, Greece
Registered: 2008-07-28
Posts: 705
Website

Re: Easystroke: Mouse Gestures

You've done a great job so far. smile

Some small points that need taken care of:

1) Since the license used isn't listed in /usr/share/licenses/common, you'll need to include a copy in your package and install it under /usr/share/licenses/<package name> (e.g. in your package it would available at /usr/share/licenses/easystroke/LICENSE). You're also going to change the PKGBUILD's license field to read: license=('custom:ISC'). See the packaging standards for more information on licenses.

2) The build instructions in /usr/share/pacman/PKGBUILD.proto will do the trick for most packages (maybe with minor tweaking). However, easystroke doesn't provide a configure script (part of autotools), but instead ships a custom Makefile. Therefore, you'll need to specify the PREFIX during the "make install" step. So, you'll do something like this to build the package (the -j2 switch can be safely omitted):

build() {
  cd "$srcdir/$pkgname-$pkgver"

  make || return 1
  make PREFIX=/usr DESTDIR="$pkgdir/" install
}

3) Regarding dependencies, something like this should be fairly accurate and complete:

depends=('gtkmm' 'boost' 'libxtst' 'xinput' 'dbus-glib') # xinput is from AUR
makedepends=('gcc' 'pkgconfig')

4) Lastly, empty lines (provides, replaces, etc.) should be removed from the PKGBUILD to make it cleaner, leaner and meaner. tongue

A general advice for package maintainers is to test their packages using namcap. It will point out any problems it finds with the package (e.g. missing or unneeded dependencies, problematic file permissions, license issues and more). For example, in your package it reported that libxrandr doesn't have to be listed as a dependency (as it's a dependency of gtk2, which our gtkmm depends on).

That's pretty much it! I hope I haven't confused you further. If something is unclear, feel free to ask for clarification.

As I've already said, you're doing more than fine. If you have the time and interest in maintaining easystroke, please do submit it to the AUR.

Offline

#3 2008-09-16 22:44:29

Bionic Apple
Member
Registered: 2008-08-05
Posts: 59

Re: Easystroke: Mouse Gestures

Thanks for the great post!  I will test this out and alert you if there are any problems.

Offline

#4 2008-09-17 22:55:30

Bionic Apple
Member
Registered: 2008-08-05
Posts: 59

Re: Easystroke: Mouse Gestures

Alright, I have few questions. 

How do I put the license in /usr/share/licenses/common/...?


How do I modify the .desktop to use an explicit icon path?
  Checking other packages, some come with a .desktop in their ABS folder.  It looks like I should do the scripting in the build function, but I don't know if and how to do it.

Does the .install file have to do with any of this?
  I made one already from the gnome-proto.install file.  However, I haven't modified it.

Basically, how do I customize the installation through makepkg for some specific needs?

Offline

#5 2008-09-18 00:12:24

foutrelis
Developer
From: Athens, Greece
Registered: 2008-07-28
Posts: 705
Website

Re: Easystroke: Mouse Gestures

Bionic Apple wrote:

How do I put the license in /usr/share/licenses/common/...?

The install utility can help you copy the license over. For example, you can include the LICENSE file in the source=() array and then copy it with:

install -D -m644 ${srcdir}/LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
Bionic Apple wrote:

How do I modify the .desktop to use an explicit icon path?

.desktop files don't need to specify the full path to the icon, only the file name. The Makefile shipped with easystroke will copy the icon to /usr/share/icons/hicolor/scalable/apps/easystroke.svg. You just need to run gtk-update-icon-cache to update the cache. This is done in the .install file. See /var/abs/extra/terminal/terminal.install for an example.

I'll also quote the wiki here:

GTK Icon cache

Quite some packages install icons in the hicolor icon theme. These packages should depend on hicolor-icon-theme and should have gtk-update-icon-cache -q -t -f usr/share/icons/hicolor in the post_install, post_upgrade and post_remove function.

Bionic Apple wrote:

Does the .install file have to do with any of this?

Commands that need to be run when the user installs/removes/updates a package, are placed in a .install file inside the appropriate function.

Bionic Apple wrote:

Basically, how do I customize the installation through makepkg for some specific needs?

The package is built in the build() function. Remember that PKGBUILDs are basically shell scripts. As such, you can use whatever command you'd use in a terminal to do your job.

Offline

#6 2008-09-18 01:11:58

Bionic Apple
Member
Registered: 2008-08-05
Posts: 59

Re: Easystroke: Mouse Gestures

Oh wow, this package is nearly perfect.  There is one last problem that I (well, in all honesty, you) need to solve.  The actual creation of the package is flawless.  Namcap, which I noticed is Pacman spelled backwards, gave me a few warnings.  I am pretty sure they are minor, but here they are anyway:

Namcap PKGBUILD output:

PKGBUILD (easystroke) W: Missing Maintainer tag
PKGBUILD (easystroke) W: Missing CVS Id tag

Namcap package output:

easystroke W: Dependency included but already satisfied (libxrandr)
easystroke W: Dependency included and not needed (xinput)

Anyway, the actual installation through Pacman is where the real error I wanted to talk about resides:

loading package data...
checking dependencies...
(1/1) checking for file conflicts                   [#####################] 100%
(1/1) installing easystroke                         [#####################] 100%
I/O warning : failed to load external entity "/usr/share/gconf/schemas/easystroke.schemas"
Failed to open `/usr/share/gconf/schemas/easystroke.schemas': No such file or directory

PKGBUILD

.install


When this package is completed, I will put my name in it, clean it up, and submit it to the AUR.

Offline

#7 2008-09-18 01:38:48

Megamixman
Member
Registered: 2008-05-04
Posts: 73

Re: Easystroke: Mouse Gestures

Uhh..., from looking at the package there is no scheme file, so you can't do the gconfpkg commands. Those need schema files.

Offline

#8 2008-09-18 02:12:14

foutrelis
Developer
From: Athens, Greece
Registered: 2008-07-28
Posts: 705
Website

Re: Easystroke: Mouse Gestures

Megamixman wrote:

Uhh..., from looking at the package there is no scheme file, so you can't do the gconfpkg commands. Those need schema files.

Exactly. easystroke.install is simply:

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

post_upgrade() {
  post_install $1
}

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

Also, remember to include a local copy of the license in your package and have it listed in the source=() array.

Offline

#9 2008-09-18 03:58:45

foutrelis
Developer
From: Athens, Greece
Registered: 2008-07-28
Posts: 705
Website

Re: Easystroke: Mouse Gestures

I came across something interesting.

easystroke doesn't depend on xinput. It makedepends on inputproto.

OK, this may not be very interesting, but after trying to figure out why easystroke wouldn't compile for half an hour, it's a relief. tongue

Offline

#10 2008-09-18 05:00:05

Bionic Apple
Member
Registered: 2008-08-05
Posts: 59

Re: Easystroke: Mouse Gestures

I've gotta go for now, however why did you do "post_install $1" for the second function, then revert to the original for the third function?

Plus, apparently I can take out xinput, but put in inputproto for makedepends?  And I can take out libxrandr because it is already installed through another dependency?

Final thing: Why do I need to have the license separate if it is included in the download?  When I installed the package, the license thing worked out fine.

Offline

#11 2008-09-18 06:26:18

foutrelis
Developer
From: Athens, Greece
Registered: 2008-07-28
Posts: 705
Website

Re: Easystroke: Mouse Gestures

Bionic Apple wrote:

I've gotta go for now, however why did you do "post_install $1" for the second function, then revert to the original for the third function?

There is no technical reason for that. It just doesn't appeal to me to call post_install from within post_remove (silly me hmm).

Bionic Apple wrote:

Plus, apparently I can take out xinput, but put in inputproto for makedepends?  And I can take out libxrandr because it is already installed through another dependency?

Correct.

Bionic Apple wrote:

Final thing: Why do I need to have the license separate if it is included in the download?  When I installed the package, the license thing worked out fine.

Ah, my mistake. What you did is perfectly valid.

Offline

#12 2008-09-18 21:06:15

Bionic Apple
Member
Registered: 2008-08-05
Posts: 59

Re: Easystroke: Mouse Gestures

Alright, I finished it and submitted it to the AUR.  Thank you foutrelis, as you pretty much made the package!  I actually learned a lot by packaging this program and I can't thank you enough for the help.  Oh, and one last thing:  Should I fix those warnings that Namcap gives me when it scans the PKGBUILD?

Offline

#13 2008-09-18 22:26:16

foutrelis
Developer
From: Athens, Greece
Registered: 2008-07-28
Posts: 705
Website

Re: Easystroke: Mouse Gestures

Bionic Apple wrote:

Alright, I finished it and submitted it to the AUR.

May I suggest the install file to be reduced to something like #8? Sorry for nitpicking. tongue

Bionic Apple wrote:

Oh, and one last thing:  Should I fix those warnings that Namcap gives me when it scans the PKGBUILD?

The CVS Id is for packages in [community] maintained by TUs and it doesn't apply to packages in [unsupported]. As for the Maintainer tag, I think it's safe to ignore the warning since you're the original contributor anyway.

Offline

#14 2008-09-20 05:38:10

Bionic Apple
Member
Registered: 2008-08-05
Posts: 59

Re: Easystroke: Mouse Gestures

What is:

update-desktop-database -q

Also, I will clean up the .install.  However, I'm only going to specify the command once.

Offline

#15 2008-09-20 10:22:45

foutrelis
Developer
From: Athens, Greece
Registered: 2008-07-28
Posts: 705
Website

Re: Easystroke: Mouse Gestures

The description I found in a man page is:

Update the desktop-MIME mappings

I think it reads the desktop files in /usr/share/applications and sees which application can open what files, based on the MimeType field.

Offline

#16 2008-09-22 21:51:07

Bionic Apple
Member
Registered: 2008-08-05
Posts: 59

Re: Easystroke: Mouse Gestures

Sorry for taking so long, but shouldn't I keep that in there?  Or is that only for programs that open special files such as .html, .py, and others?  As far as I can tell, Easystroke doesn't open any files.

Offline

#17 2008-09-23 05:25:51

foutrelis
Developer
From: Athens, Greece
Registered: 2008-07-28
Posts: 705
Website

Re: Easystroke: Mouse Gestures

Bionic Apple wrote:

Sorry for taking so long, but shouldn't I keep that in there?  Or is that only for programs that open special files such as .html, .py, and others?  As far as I can tell, Easystroke doesn't open any files.

Easystroke's .desktop file doesn't define any mime types so I assume, with a high level of certainty, that it's not needed.

Offline

#18 2008-09-23 20:32:38

Bionic Apple
Member
Registered: 2008-08-05
Posts: 59

Re: Easystroke: Mouse Gestures

Alright, I updated it.  All of my questions have been answered, so I think it is safe to say this thread can die.

Oh, and a million thanks foutrelis!

Offline

Board footer

Powered by FluxBB