You are not logged in.

#1 2013-07-09 18:41:45

VanillaFunk
Member
From: MA. USA
Registered: 2013-06-10
Posts: 396
Website

GTK ISO Mounting App

So heres the long and the short of it...

I got tired of typing out commands to mount cd/dvd iso files so i built a gtk application to do it for me and have found it quite useful... not sure how things tend to get put on aur i dont know how to creat a pkgbuild and what not but thought it might be a useful tool for people.

im not sure in what way i should post source code and if its okay to put it on there forum. but if someone can create a package build for it i would be happy to give them source code to do so with it.

if anyone who knows how to go about putting stuff on aur can reply and point me in the right direction.  still new to developing software so bear with me plz and ty

big_smile

oh and it uses gksudo to gain root accsess to mount files and i dont believe it needs any dependencies beyond gtk
it mounts the img in /mnt but could change that easily ( i have my personal version using kdesu and into a local dir ) so its really easy to alter.

AUR link https://aur.archlinux.org/packages/mounter2-git/

Last edited by VanillaFunk (2013-11-04 22:06:58)


archx86_64 : awesomewm
https://github.com/dreemsoul

Remeber to feed the squirrels

Offline

#2 2013-07-09 18:44:35

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: GTK ISO Mounting App

Read the wiki and find out how to build PKGBUILDs and upload to AUR :-)


Edit: I personally use aliases, so it's just a couple characters to type.

Last edited by karol (2013-07-09 18:46:14)

Offline

#3 2013-07-09 19:38:54

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: GTK ISO Mounting App

VanillaFunk wrote:

i built a gtk application

i dont know how to creat a pkgbuild

Dude, if you can write a GTK application then I promise you can figure out how to write a PKGBUILD file. wink

Anyway, if you post a link to the repository (sourceforge, github...) then someone can easily make a PKGBUILD file for you.

Offline

#4 2013-07-09 19:56:11

VanillaFunk
Member
From: MA. USA
Registered: 2013-06-10
Posts: 396
Website

Re: GTK ISO Mounting App

yea im doing it as we speak... didnt know where to look on wiki but eventually found it.  gonna upload the source files to sourceforge in a few


archx86_64 : awesomewm
https://github.com/dreemsoul

Remeber to feed the squirrels

Offline

#5 2013-07-09 20:43:43

arokh
Member
Registered: 2013-05-30
Posts: 35

Re: GTK ISO Mounting App

There's also https://launchpad.net/gisomount although I never used it.

Offline

#6 2013-07-09 21:37:54

VanillaFunk
Member
From: MA. USA
Registered: 2013-06-10
Posts: 396
Website

Re: GTK ISO Mounting App

Well i didn't have time to finish the pkgbuild but the tar.gz is up on source forge with a install script.  please let me know wat you think of the app big_smile ill do the pkgbuild when i get back but for now here is the link to the tar.gz.

https://sourceforge.net/projects/mounte … urce=files

(the app isnt pretty atm i just wanted to share it.  if people like it ill do some work on it.)
thanks all for pointing me in the right direction i look forward to seeing this on aur and making better stuff in future

i did switch it back to kdesu when i uploaded it but if you peek at the source code its pretty obvious where to make changes on the mounted directory and to gksu if you want.  i just wasnt able to find what dependency id need for gksu

Last edited by VanillaFunk (2013-07-09 21:41:22)


archx86_64 : awesomewm
https://github.com/dreemsoul

Remeber to feed the squirrels

Offline

#7 2013-07-09 21:50:28

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,518
Website

Re: GTK ISO Mounting App

This looks pretty well written.  A couple bits of (hopefully) constructive feedback:
1) before you worry too much about a PKGBUILD, write a Makefile to take the place of that install script.  The makefile for this would be very simple, not much different from your install script really.
2) In that makefile, use make variables like DESTDIR, and don't try to create folders outside of your build directory (unless they are in DESTDIR, BINDIR, or some other variable that can be set by a package manager).  Definitely don't try to build or install to ~
3) A makefile would also allow for a 'clean' directive, which would help clean up the tarball - as it is the source tarball contains a regeratable object file.

Once you do these, the PKGBUILD will be trivial, basically the template code would work, but you can even get rid of the call to configure as you don't use autotools.

Last edited by Trilby (2013-07-09 21:52:38)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#8 2013-07-09 22:40:40

VanillaFunk
Member
From: MA. USA
Registered: 2013-06-10
Posts: 396
Website

Re: GTK ISO Mounting App

Okay cool thnx Trilby I'll sit down and do the makefile tonight then.  i gotta look into making installs cause i usually just run the ./mounter2 file from my dock.
This is the first real c program I've written for any functional purpose and was curious how sloppy my coding was. (glad to hear it's alright).


archx86_64 : awesomewm
https://github.com/dreemsoul

Remeber to feed the squirrels

Offline

#9 2013-07-09 22:49:02

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,518
Website

Re: GTK ISO Mounting App

The code itself looked great to me - that's the first thing I looked at and the only reason I looked any further was because it looked good.  I haven't tested it or read it too carefully, but it's organized, readable and has just the right amount of comments to indicate what is being done without interrupting from the flow of the code itself.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#10 2013-07-10 16:41:31

VanillaFunk
Member
From: MA. USA
Registered: 2013-06-10
Posts: 396
Website

Re: GTK ISO Mounting App

okay uploading the makefile to sourceforge now.  gonna fix a couple things in th source code before i make a pkgbuild


archx86_64 : awesomewm
https://github.com/dreemsoul

Remeber to feed the squirrels

Offline

#11 2013-07-10 18:00:36

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: GTK ISO Mounting App

Moving to AUR Issues...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#12 2013-07-10 19:13:20

VanillaFunk
Member
From: MA. USA
Registered: 2013-06-10
Posts: 396
Website

Re: GTK ISO Mounting App

Hey i finished the pkgbuild its up on sourceforge anyone who wants to test it before i see about uploading it to aur?

I also edited the source code to fix some cosmetics so should be ready to put it on the aur if that is okay as long as i did my dependencies correctly

Last edited by VanillaFunk (2013-07-10 19:20:57)


archx86_64 : awesomewm
https://github.com/dreemsoul

Remeber to feed the squirrels

Offline

#13 2013-07-10 20:42:16

VanillaFunk
Member
From: MA. USA
Registered: 2013-06-10
Posts: 396
Website

Re: GTK ISO Mounting App

Package submited to AUR.  Enjoy.


archx86_64 : awesomewm
https://github.com/dreemsoul

Remeber to feed the squirrels

Offline

#14 2013-07-11 05:45:56

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: GTK ISO Mounting App

You should put a link to the package in the first post.

Last edited by x33a (2013-07-11 07:17:46)

Offline

#15 2013-07-11 05:54:58

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: GTK ISO Mounting App

The package is listed as "mounter2" in the AUR, right?  If it is a "GTK ISO Mounting App" and "(you) dont believe it needs any dependencies beyond gtk", why is it pulling in kdebase-runtime?  I don't have KDE on my system, and it wanted to pull in 200MB of deps!

Offline

#16 2013-07-11 06:06:47

VanillaFunk
Member
From: MA. USA
Registered: 2013-06-10
Posts: 396
Website

Re: GTK ISO Mounting App

i did switch it back to kdesu when i uploaded it but if you peek at the source code its pretty obvious where to make changes on the mounted directory and to gksu if you want.  i just wasnt able to find what dependency id need for gksu

know what the gksu dependency is?  as it said i had trouble finding it.
sorry the adaption wasnt clear wonderwoofy


archx86_64 : awesomewm
https://github.com/dreemsoul

Remeber to feed the squirrels

Offline

#17 2013-07-11 06:07:34

VanillaFunk
Member
From: MA. USA
Registered: 2013-06-10
Posts: 396
Website

Re: GTK ISO Mounting App

i did switch it back to kdesu when i uploaded it but if you peek at the source code its pretty obvious where to make changes on the mounted directory and to gksu if you want.  i just wasnt able to find what dependency id need for gksu

know what the gksu dependency is?  as it said i had trouble finding it.
sorry the adaption wasnt clear wonderwoofy

--edit--

wow
i just realized gksu isnt in gnome-policykit
thats what i get for writting code on no sleep... ill change it right now

Last edited by VanillaFunk (2013-07-11 06:21:40)


archx86_64 : awesomewm
https://github.com/dreemsoul

Remeber to feed the squirrels

Offline

#18 2013-07-11 06:30:16

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: GTK ISO Mounting App

Yeah, there is a gksu package in the Arch repos.  When in doubt, you can use pkgfile.  You need to install it, but it compliments pacman quite nicely.  It will show you what file belongs to what package.  So in this case you would have just had to do "pkgfile gksu".  If you want all the files from the gksu package, you can do "pkgfile -l gksu".

So the dependency is really for gksu, and not for anything truly kde related then?  If that is the case, I could just use ktsuss, right?

Edit: Since you have git as the source, it should probably be named mounter2-git.  To do this, make a new package under that name, then email the [aur-general] mailing list and ask them to remove the old one.

Last edited by WonderWoofy (2013-07-11 06:32:00)

Offline

#19 2013-07-11 06:36:42

VanillaFunk
Member
From: MA. USA
Registered: 2013-06-10
Posts: 396
Website

Re: GTK ISO Mounting App

fixed and updated sorry for the mistake. now uses gksu as a standard.

(again first tiime writing an app for anyone other than me)

let me know of any other issues people have with it big_smile

--edit--

ok its late so ill rename the package to mounter2-git in the am and send them an email then

thankyou.

Last edited by VanillaFunk (2013-07-11 06:52:17)


archx86_64 : awesomewm
https://github.com/dreemsoul

Remeber to feed the squirrels

Offline

#20 2013-07-11 07:28:08

Jristz
Member
From: America/Santiago
Registered: 2011-06-11
Posts: 1,048

Re: GTK ISO Mounting App

gksu? that is so old
why not try if a pkexec can help??, in AUR many packages drop gksu for a custom olkit pkexec that remplace it


Lenovo ThinkPad L420 modified
:: Intel i7 2560QM :: 8 GB RAM :: SSD 256 GB ::
:: DVD read+Writter :: 3 USB 3.0 Expresa Card ::
:: a Favulous 1 mins lasting Io-Li battery ::cry::

Offline

#21 2013-07-11 07:36:09

VanillaFunk
Member
From: MA. USA
Registered: 2013-06-10
Posts: 396
Website

Re: GTK ISO Mounting App

would it be easier for you guys if i required it to be run as su?
that way there will be no issue on how we obtain root privilages
and you all can use which ever you want?

ill set it to do that in am unless i hear otherwise


archx86_64 : awesomewm
https://github.com/dreemsoul

Remeber to feed the squirrels

Offline

#22 2013-07-11 11:38:49

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,401

Re: GTK ISO Mounting App

depends a bit on how you intend people to start the app, VanillaFunk .

if users are meant to start the app from cli or console, then using su will be fine.
Incase you aim to have them start the app from  a menu item through a .desktop file, then gksu may be a better solution.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#23 2013-07-11 14:49:56

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: GTK ISO Mounting App

There is always the option of adding gksu, pkexec, kdesu, etc as optional dependencies instead of a hard dependency.  That way the user is not forced to install a certain graphical su application, and can instead choose which ever, or even none at all and just launch from a root terminal as mentioned above.

I took out the kdesu dep, and it built just fine though.  I haven't actually tried ti yet though.

Offline

#24 2013-07-11 15:16:23

VanillaFunk
Member
From: MA. USA
Registered: 2013-06-10
Posts: 396
Website

Re: GTK ISO Mounting App

so here is the thing... if you're gonna use a different way to gain root privilages...

on lines 68 and 81 of the main.c file youll need to change 'gksu' to your desired command and then recompile.... or just keep it as gksu

wonderwoofy... you posted:
I took out the kdesu dep, and it built just fine though.  I haven't actually tried ti yet though.


if you dont download the new version it will still compile using kdesu.
or you can edit the source as i mentioned above

big_smile

the reason this matters is  the c file uses a system() command to execute the mount command.  so making it run with a couple options of su commands i will build into the next version then set optional dependencys.. but wonder woofy i guarentee if you dont recompile it... (use the make fiile in the src code) it will fail

Last edited by VanillaFunk (2013-07-11 15:20:30)


archx86_64 : awesomewm
https://github.com/dreemsoul

Remeber to feed the squirrels

Offline

#25 2013-07-11 16:37:45

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: GTK ISO Mounting App

You can take the gsmartcontrol approach. It uses a script called gsmartcontrol-root to check the environment and uses the appropiate command.

Here's the script, in case you don't want to download the full program.

https://pastee.org/f4z35

Offline

Board footer

Powered by FluxBB