VectorLinux
December 19, 2014, 04:34:02 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to http://vectorlinux.com/forum1. The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
 
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: [1] 2 3 ... 15
  Print  
Author Topic: Package builder utility  (Read 79834 times)
M0E-lnx
Administrator
Vectorian
*****
Posts: 3195



« on: April 09, 2007, 09:57:43 am »

A while back, I started looking into slackbuilds, and tried to learn some bash scripting because I wanted to understand what really was going on in the slackbuild... Ran into some good guides, and help from other users in the VL community. So here is the thing.

I've managed to write this script that sort of works like a slackbuild. It helps me shave prescious seconds off the package-building process, by automating some steps.
Here is some information on how to use it

The script is designed to be smart, and interactive.

Download and isntall this http://m0e.lnx.googlepages.com/vl-pbu-0.1.5-i586-2vl58.tlz
  • This will isntall the script to your box
Take it for a spin
  • Download a source tarball (.tar.gz or .tar.bz2)
  • Write description file ( a must for every package) name it description-pak or <name_of_application>.desc
  • Call the script from that dir (as root)

There is also a way to automate the entire thing by writing a .build file in the same dir as the source tarball...
see vl-pbu -h for help

For those of you who want to take a peek at the script itself,
Code:
cat /usr/sbin/vl-pbu
after you've installed the package above package

This is good for building every-day stuff.. will not build python applications. (maybe later? )

If any of the packagers would like to try it out, and get me some feedback on it, tell me if you see this helps out at all... It's a tool I wrote for my own personal use, but then I thought it might help others too, and decided to share it.

Issues may be reported ON THIS THREAD ONLY or via a PM to me or via email
« Last Edit: April 09, 2007, 10:29:01 am by M0E-lnx » Logged

blurymind
Packager
Vectorian
****
Posts: 1082



« Reply #1 on: April 13, 2007, 03:59:42 am »

this is very interesting.
It would be nice to make compiling more accessable and easy for the mainstream user.

There already are some frontends like:
http://www.kde-apps.org/content/show.php/Kompile?content=30223

and i really would love it if there was something like this for tgz/tlz slackware packages:
http://www.kde-apps.org/content/show.php/RPM+Package+Maker?content=33228

A tool to create packages 
~~~~~~~~~~
This is really a good idea and the script is sweet too. Here are a bunch of improvements ideas:

*make it easier to write description files.It would be awesome if it was possible to automate the proces as much as possible. Like,instead of going into howto's if the user gets a little pop-up box ,where he can write name of the app,version of the app,version of the package,architecture,and description of the package+license and home page...
This can be partially automated- it can be possible to pick the name of the app from the name of the tar.gz archive, same applies for its version...but they should be changeable by the user in the dialogue window.
I mean if it was possible to make a very siple frontend to this script which basically works like this:
it has one window in which the user picks the file from anywhere ("browse" button?) or from a certain folder and under that there are text boxes for:
>name of the package
>version
>architecture ?
>version of software
>version of the package
>and where it should be installed (could be done with a slide down menu: /opt/kde ;/opt ;/usr ;custom.. or just a box: Prefix=...)
------------automated description file generator: (sepparate script to work with this one?)-------------
>a box to write description of package
>under it - license
>under it - homepage
-------------------------------------------
and after all this info is inputed the user could just click "make package" and the terminal window pops out and starts "make" and after that "checkinstall"... I know this way the user wont be able to control compile flags,etc...so the advanced user would do it by hand.

This all can be done with a simple gui frontend and needs only one or two windows...idk,atleast that is a packager's dream... Tongue But this script is also very nice, i just suggest how it can be improved into something user-friendly.. Having a way to generate package description files is a way to go.
« Last Edit: April 13, 2007, 04:01:54 am by blurymind » Logged

status: playing around with new tablet and learning to 3d :p
google page :  http://blurymind.googlepages.com
DA PAGE :  http://www.blurymind.deviantart.com/
M0E-lnx
Administrator
Vectorian
*****
Posts: 3195



« Reply #2 on: April 13, 2007, 04:51:05 am »

That would be sweet blurymind... What you've said is absolutely doable... the one problem I see with it is that I dont know any C or Gambas programming... I dont know if it's possible to create a GUI for a bash script.

I could rigg the script as you said for the description, but you'd still see not much more than a terminal window.
But I have to agree... a GUI package creator would be nice.

Actually, This script already takes care of the compile flags, the packager information, arch and those goodies...
Logged

blurymind
Packager
Vectorian
****
Posts: 1082



« Reply #3 on: April 13, 2007, 05:54:17 am »

I've seen bash scripts that launch simple gui interface.
Someone at a beryl irc sent me such a script and it had three checkboxes and a one button.The script was less than 20 lines of code..
Zenity or what was it that it used for gui..
http://bashcurescancer.com/man/cmd/zenity
Edit: it was zenity that he used.

Thats not only the question.I think that is completely possible to make a simple description file generator...and not too hard too..
Anyways,m0e you are the one who brought to life this great script and the idea itself for a more easy and less time consuming way to create packages.Not only for mainstream users.

http://www.linuxpackages.net/slackcreator.php
linuxpackages has such a slack-desc file creator.I wonder how to put it in a bash script with zenity..
« Last Edit: April 13, 2007, 06:33:39 am by blurymind » Logged

status: playing around with new tablet and learning to 3d :p
google page :  http://blurymind.googlepages.com
DA PAGE :  http://www.blurymind.deviantart.com/
M0E-lnx
Administrator
Vectorian
*****
Posts: 3195



« Reply #4 on: April 13, 2007, 06:55:27 am »

I've been looking into Zenity and Xdialog (Xdialog looks a lot easier)... and also the slackcreator thing at linuxpackages...
I could probabbly code something like that in php, but it would require a browser window, which I wouldn't really want... I'm also looking into GAMBAS... maybe If I lean that, I could even help do other things for VL to (ie, help into the new installer and stuff)... but I'm a n00b really... for now, I could probabbly make the script try to find a slack-desc in a slack repo somewhere... that's doable right now... but a GUI would be probabbly the better way to go...

but it's prolly further down the road
Logged

blurymind
Packager
Vectorian
****
Posts: 1082



« Reply #5 on: April 13, 2007, 07:53:05 am »

you are probably right about gambas.
I myself too feel like a noob sometimes,but we are all bount to learn and never reach full knowledge..

I looked into the subject and saw that while zenity is pretty usefull for dialogue boxes,its unpractical for a gui frontend in this case. Roll Eyes
Logged

status: playing around with new tablet and learning to 3d :p
google page :  http://blurymind.googlepages.com
DA PAGE :  http://www.blurymind.deviantart.com/
M0E-lnx
Administrator
Vectorian
*****
Posts: 3195



« Reply #6 on: April 13, 2007, 09:51:56 am »

I thinik it would prolly be a lot easier to write an entirely new application in gambas than to create a GUI front end to this script. Xdialog looks good, but I believe it lacks some functionality for this script.
I'm digging into gambas... looks easy enough.. I'll see if I can get a hang of it and start writing some code... maybe eventually I can come up with a GUI package builder
Logged

blurymind
Packager
Vectorian
****
Posts: 1082



« Reply #7 on: April 13, 2007, 01:06:17 pm »

i too am interested in this. Are there any good web manuals and tutorials out there?

All i have now is a book about programming with some basic commands in bash,tcl and perl..From which i could understand best bash.. "programming under linux" by i forgot his name.. Embarrassed its not an old book.

gambas 2 looks abit like visual basic.. Tongue Long time since i've seen that one  Grin brings back memories from high school..
Logged

status: playing around with new tablet and learning to 3d :p
google page :  http://blurymind.googlepages.com
DA PAGE :  http://www.blurymind.deviantart.com/
easuter
Global Moderator
Vectorian
*****
Posts: 2160



« Reply #8 on: April 13, 2007, 01:49:03 pm »

I haven't used Gambas2 yet, but Gambas (1.0.x) is pretty simple.
There is a free Gambas manual call "A Beginner's Guide to Gambas" that can help you get started.
I'd been starting and stopping with Gambas since early December, but only during my easter holidays did I commit myself to actually learning it, ad this is the result: http://www.vectorlinux.com/forum2/index.php?topic=2648.msg15316#msg15316

I think the GUI installer is written in Gambas2 and IIRC Gambas1 and Gambas2 projects are incompatible, so I'm not sure which one is best to chose for a long-term project. Joe1962 is the Gambas-man  Wink so he'll be able to tell you a lot more about Gambas2/Gambas1 pros-and-cons.
« Last Edit: April 13, 2007, 02:26:23 pm by easuter » Logged

rbistolfi
Packager
Vectorian
****
Posts: 2291


« Reply #9 on: April 13, 2007, 02:29:55 pm »

Wow, this is a nice project.
Looks like you are not alone in the "learning gambas" thing.
http://www.vectorlinux.com/forum2/index.php?topic=2524.0
We could start a wiki or a blog or something to join efforts and make the learning process more easy, dont you think?.
May be in that way we can make more easy to a noob like me and others to get involved in the vl development. Just an idea.
PS: my only coding experience is some php, do you think that is enough to take a shot with gambas?
Logged

"There is a concept which corrupts and upsets all others. I refer not to Evil, whose limited realm is that of ethics; I refer to the infinite."
Jorge Luis Borges, Avatars of the Tortoise.

--
Jumalauta!!
Joe1962
Administrator
Vectorian
*****
Posts: 2499



WWW
« Reply #10 on: April 13, 2007, 02:47:54 pm »

Gambas2 is far beyond Gambas 1.0.x in language and IDE features, but it was in a very unstable phase where even the syntax could change from one release to the next. For this reason, I have stuck to 1.0.x for the official VL utilities. The Gambas 1.0.x runtime is a standard part of VL 5.8 base. I went with Gambas2 for the installer because I needed (or maybe wanted is more precise) the window embedding functionality to get cfdisk and gparted inside the installer window. However, in the Gambas mailing list as of last week, Benoit (the main Gambas author) has posted the following:
Quote
Hi everyone,

In the current SVN trunk, you will find a new IDE packager that allows you to
make RPM packages from a gambas project.

At the moment, this packager only supports Mandriva and Fedora distributions.

---- Why?

Because at the moment I have a clear documentation for these two distributions
only. In the future, I want to support OpenSuse, Debian, and Slackware.

---- How does it work?

These RPM packages:
1) Install the project executable in /usr/bin.
2) Install an icon in the distribution icon directory. (this is not a
standard).
3) Install the XDG *.desktop menu file, so that you see the application in
your menu.
4) Depends on distribution specific gambas binary packages.

---- What are the problems?

1) is not a problem.

2) depends on the distribution. Fedora needs one icon in /usr/share/pixmaps.
Mandriva has three icon directories. And I don't know for the other
distributions.

** I need information about that for the other distributions **

3) works only if the distribution supports the free-desktop XDG menu system.
This is the case for Mandriva and Fedora, even if these two distributions
don't have the same menu organization.

** I need information about that for the other distributions. Do they support
XDG menu system, or another one? **

4) relies on the distribution packagers. At the moment, if you want to install
a package made by the IDE, you have to force it.

There are other problems:

5) Debian and Slackware are not RPM-based. The Gambas 1.0.x IDE relied
on 'alien' to make a debian package from a RPM, but I am not sure that it is
the good solution.

6) There are many Debian-based distributions, and Debian packages do not
necessarilly work on these distributions! (Somebody said 'Ubuntu' ?)

** I need information about how to make packages on these distributions **

---- How can you help?

By making gambas binary packages for your distribution, if you can of course!
The gambas binary packages specifications are at:

http://gambasdoc.org/help/howto/package

By testing the packager on your distribution. The packagers relies on the
rpmbuild tool at the moment. Which tool is needed on your distribution? How
does that tool work? This is especially important on non-RPM distribution
like Debian or Slackware.

By giving me information about your distribution if it is different from the
standard ones.

Please help me making a really working packager for Gambas 2.0. This is the
last big step before making a release candidate! With a few other little
things of course... :-)

Thanks in advance!

Regards,

--
Benoit Minisini
A bit long, but I thought it important to quote here in it's entirety. This means a Gambas 2.0 RC is coming in the near future, but also, that we should chime in with the new packager, so it supports Slackware packages properly, but maybe even VL packages with full dependency info.

WRT a joint Gambas discussion place, I can offer this forum I was experimenting with a while back and sort of abandoned (time to make it work, hehe): http://jjrweb.byethost.com/forum/index.php

Post away in Vector Linux Development: Gambas.


EDIT: Give me a name and I'll create another sub-sub-Forum inside Gambas for this project, or any other.
« Last Edit: April 13, 2007, 02:50:15 pm by Joe1962 » Logged

O'Neill (RE the Asgard): "Usually they ask nicely before they ignore us and do what they damn well please."
http://joe1962.bigbox.info
Running: VL 7 Std 64 + self-cooked XFCE-4.10
easuter
Global Moderator
Vectorian
*****
Posts: 2160



« Reply #11 on: April 16, 2007, 09:42:42 am »

Quote from: Joe1962
Give me a name and I'll create another sub-sub-Forum inside Gambas for this project, or any other.

Maybe "Lobbying for VectorLinux package support in Gambas2"?  Smiley
Logged

cintyram
Packager
Member
****
Posts: 72



WWW
« Reply #12 on: April 16, 2007, 10:57:31 am »

Moe and blurrymind,
  this is an awesome project. May the force be with you:).
in order to simplify the process, i will first review your script and give you feedback.
as for the gui part, i suggest that we collect all feature requests in a thread, and summarize so that you can freeze the requirements and aim for a stable release.  This approach has helped hanumizzle work on VASM2 in the past.

So lets start with the most significant problems, and wants.

the most significant problem i find when trying to build packages is dependencies.
i agree that the other features like automated desc file generator etc.. are helpful too. but for me something that confirms that all the dependencies are in place is a boon.  ususally this is the job of
configure if you do everything by hand.  how to go about implementing a solution for this is a different discussion, lets not get into that in this thread.

the second most important point is to have some test packages that this tool can make life simple with.
i suggest we go with some tough ones too.

1 cinelerra
2 kinodv
3 gnustep [ they even have their own script like xfce does ]
4 VLC

thanks
cheers
ram

Logged
M0E-lnx
Administrator
Vectorian
*****
Posts: 3195



« Reply #13 on: April 16, 2007, 11:23:25 am »

Thank you guys for the replies... It's great to know other are interested on this kind of thing as well.

I'd like to point out a few more things about the script.
First off, the GUI is no where close, so for now, I'd be happy with just a working script. (Although, I am in the process of learning gambas (1.x) and getting very familiar with it.)

The script can already generate the slack-desc file. Here is how you do it
Simply write out the description in a text file. Call it <name-of-application>.desc. This should be done before executing the script, if it's not there, you should see a red warning, telling you no description is found.
You can also write a description-pak file, the script will test both of these for compatibility before using them...

@ cintyram
I understand exactly what you mean with the dependancy thing... Not much we can do there, however... on tough applications to build, you can extend the functionality of the script by creating a <name-of-application>.build file
This helps the script more accurately identify values to variables it needs in order to build a package.

Keep in mind though, that it is still a work in progress, which is why I must go back and thank all of you for your input
Logged

M0E-lnx
Administrator
Vectorian
*****
Posts: 3195



« Reply #14 on: April 20, 2007, 11:01:10 am »

I've been trying to come up with a GUI layout of the program...
Here is what I got so far. Functinality ATM is limited.

Fist screen:


Second Screen


@ Blurymind
I could prolly use some graphics to add in the buttons...
maybe in the next screen, have a summary of what's about to happen, and have one button with a bzip / gzip to .tlz/.tgz graphic
Logged

Pages: [1] 2 3 ... 15
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!