Compiler GUI and other packaging tools

Stuff that has yet to be sorted into a category.
Message
Author
amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#151 Post by amigo »

Aha! You've discovered one of the nicer features of src2pkg. It seems such a simple thing to create a slack-desc file. But it consumes a lot of time. Before creating the routines which 'mine' the description, writing the desc file usually tooik more time than the whole rest of the process of creating a package. so, even though it was a bit daunting at first, I started looking for ways to pull a description from existing files.

What you are seeing is probably pulled from an rpm *.spec file included in the sources, or from a debian/control file in the sources. These are the two most common and best places to get descriptive info. And for that very reason I usually use the debian patch for a given source tarball, or use a *.src.rpm I can find one. Often, after a first build which gets me the description, I thn stop using the patch or use the tarball instead of the src.rpm -I hate writing desc files.

src2pkg can use text found in *.spec, debian/control, *.lsm, PKGINFO or PKG-INFO(from python modules sources), description-pak files like used by checkinstall(some distros like vector linux use these) or from a NAME.txt file which accompanies a slackware binary package.

Somer real tricky code in there for wrapping the text and each type of description file needs its' own parser -but it's all done in pure bash so it is faster than calling externals.

You may have also noticed that src2pkg will discover what kind of license is being used by the software and write that info to the desc file, as welll as the URL of the homepage :-)

The code which wraps the text allows you to change the line-length if you want and you can also set the number of lines to use in a description file -although the standard length for slack packages is 9-13

As some users have suggested, it would be nice to be able to simply 'read' the README and get the info, but 'simply' is simply not that simple! Anyway, The whole routine is one of the most complex and *lovely* routines in src2pkg. I don't know whether to be more proud or pleased as it saves me loads of work.

User avatar
Gedrean
Posts: 139
Joined: Fri 05 Jun 2009, 05:59

#152 Post by Gedrean »

I figured that was the case. I was MORE impressed by the fact that it found out the license for SDL was LGPL -- but also that it was LGPL 2.1 -- and I couldn't find the 2.1 designator ANYWHERE in source files or text files anywhere.

So I don't know HOW it knew the LGPL version number. Did it just guess, or did it figure out based upon some of the wording in the license?

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#153 Post by amigo »

Yep, it greps for key phrases typical of each license type. Handy. huh?

A couple of quick pointers since you are up and running:

Use the option -Z? to reduce package size:
-Z1 uses bzip2 on man-pages
-Z2 uses upx-ucl, upx or exepak to compres binaries
-Z3 will link the License of the package to a common location (each package contains and installs the license, but subsequent installation which use the same license overwrite the same file.
-Z4 creates an archive of all docs.
Edit: The -Z options are cumulative: -Z4 does all of -Z1, -Z2 and -Z3.

Open /etc/src2pkg/src2pkg.conf and scroll down to line ~230
Uncomment and fill in all those extra compiler flags you want to use:
[[ $EXTRA_FLAGS ]] || EXTRA_FLAGS="-pipe"

If you want to use a bunch of extra options to configure scripts, uncomment and fill in line ~289:
AUTO_CONFIG_OPTIONS="sysconfdir localstatedir"
then use the -ACN option when running src2pkg. Note that src2pkg will examine the configure to script to see if these options are actually available and only those which are will be added to the config options.

Another note: you don't ever need to specify libdir, mandir or infodir as these are handled automatically. well, you can specify libdir, but you should never need to. Since src2pkg handles man-pages and info files -correcting their location when wrongly installed, it doesn't matter where they get installed -src2pkg will fix them according to which FSH_POLICY is in force.

You may find it nicer to uncomment these lines:
[[ $SOURCES_DIR ]] || SOURCES_DIR="$CWD"
[[ $SRC_BUILDS_DIR ]] || SRC_BUILDS_DIR="$CWD"
[[ $PKG_BUILDS_DIR ]] || PKG_BUILDS_DIR="$CWD"
[[ $PKG_DEST_DIR ]] || PKG_DEST_DIR="$CWD"
[[ $BACKUP_DIR ]] || BACKUP_DIR="$CWD"
They cause everything to be built in the current directory which makes it *much* easier to examine the package tree, or go into the sources for whatever reason.

If you have sound, you may wish to uncomment line ~347:
AUDIO_NOTIFICATION=SAY
Set to BEEP or PLAY or, if you have flite or festival (not likely) you can use SAY. Handy when you are watching something else while building packages in the background.
You can get a build script and flite sources here:
http://distro.ibiblio.org/pub/linux/dis ... flite-1.3/

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#154 Post by technosaurus »

Here is a full pet of the cumulative results. more, smaller scripts for building pets and pxts (requires xz and tar >= 1.22)

Fixes:
Fixed expansion for bad tarballs (ex. SDL)
Replaced ../local/pcompile/...... with /usr/local/pcompile/.... so you don't need to run it from within /usr/somedir
New GUI for making pet packages for the new format pet.specs
tweaks to default options

New utilities
adopt - fixes a dir for building a pet (used by adoptpet and adopt pxt)
adoptpet - fixes dir and actually builds pet
adoptpxt - fixes dir and actually builds pxt
dir2pet2 - assumes dir has been "adopted" and turns it into a pet
dir2pxt - assumes dir has been "adopted" and turns it into a pxt (uses xz compression instead of gz like pet packages do)
dumpdir - skips the "adopt" gui and assumes all is good
dmp2pet - runs dumpdir and dir2pet (for DEV, DOC, NLS or known good packages that already have proper menu entry and pet.specs)
dmp2pxt - runs dumpdir and dir2pxt (same as dmp2pet but better compression)
Attachments
pcompile-0.1.8.pet
Still a small TODO list but much better
(17.74 KiB) Downloaded 873 times
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#155 Post by technosaurus »

typo in gzip tarballs - here is the fix:

Code: Select all

sed -i "s/gunzip -k/gunzip/g" /usr/local/pcompile/pcomp_script
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
Gedrean
Posts: 139
Joined: Fri 05 Jun 2009, 05:59

#156 Post by Gedrean »

technosaurus wrote: Replaced ../local/pcompile/...... with /usr/local/pcompile/.... so you don't need to run it from within /usr/somedir
I //KNEW// I forgot a debug setting. ;)
New GUI for making pet packages for the new format pet.specs
tweaks to default options
Wicked. I can't wait to play!

User avatar
Gedrean
Posts: 139
Joined: Fri 05 Jun 2009, 05:59

#157 Post by Gedrean »

Alright, from reviewing the code, so far I have the following comments...

In the EXTENSIONS case statement, at one point we check if it's "tar" (the case), then we check if it's "tar" (the if) and if so, we make it "tar"... the if statement is really only necessary to check if there's another extension BEFORE the final extension... such as in the case of .tar.gz, or .tar.bz2 ... so that if statement in there is superfluous and can be removed, saving us a grep.

I noted the removal of the Invalid_Package gtkdialog, replacing with an xdialog -- this is nice as it uses less RAM, is faster, and has less space in the script. Nice going.

Also, it would be ABSOLUTELY lovely to get the source directory from TAR, in case it doesn't match, but the problem with that is that ZIP can contain multiple directories, and if we're including ZIP support, to be honest we have to hope/assume that the maintainers of the source code followed standards and named the tarball or zip arch the same as their source directory -- if not, to be honest, we may end up having this run on non-source tarballs, creating unexpected results when the user, say, selects the wrong tarball. We don't really want to screw that up, and the output of TAR isn't gonna tell us much, unless we want to build a rather complex parser for TAR output, which has to determine if the tar is even a directory, as it could just be a bunch of files! While it's not our job to clean up after the user, it's not really necessary to assume the code maintainers did things wrong... that's just my opinion, and really shouldn't add up to two grains of salt, but still. :) If you wanna do that, be my guest.:)

The extra invalid dialog calls (I see the again why? ;) ) were to use as debug, so that if errors occurred from make, they weren't erased by dir2pet's horrible clear command.

The use of the XDialogs all over to replace my troubled GTKDIALOGS was brilliant. Thanks. :)

All in all, very wonderful.

Though I //am// wishing that at the end, the specs file remained in the package dir, so we could see the specs file without extracting out an extra copy of the pet package. <G>

EDIT: Oooh! Oooh! Move the specs and pinstall.sh to the rtdir!

User avatar
Gedrean
Posts: 139
Joined: Fri 05 Jun 2009, 05:59

#158 Post by Gedrean »

Oops, run through gave me a problem...

It gave me a message "/.pet created".

And no SDL pet. <G> Trying again but I think there may be errors in adoptapet...

EDIT: I have a 0 Byte pxt file! :) That help?

User avatar
Gedrean
Posts: 139
Joined: Fri 05 Jun 2009, 05:59

#159 Post by Gedrean »

Okay, changed dir2pxt in the final section (where it builds pets) to dir2pet2 -- it built, but gave the same message (/.pet created) -- however it VERY QUICKLY made that box go away (I didn't click anything) and then exited with the whole "we're done" message.

However it DID create a pet - so I think there may be some tweaking with dir2pxt to be done.

Particularly as I don't think I have xz installed -- maaay want to have a check if xz exists, if so do the pxt -- or may want to have a checkbox in pcompile that is auto-unchecked that says "make PXT - smaller but requires xz and updated pxtget on end-user's machine" or something like that... tooltips could be useful!

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#160 Post by technosaurus »

gzipped tarballs - I may download the latest gzip and see if it supports leaving the existing file in place since some tar.gz files (specifically the ones for SDL and friends) are not recognized by tar for whatever reason (this is why I decided to add plain tar support in the first place)

I also changed some of the default values to false so that it doesn't stop a configure script due to a missing argument

Forgot to mention pxt support (xz compressed pets) currently set to use default compression through tar, but may get better results by using xz separately using -ze9

'adopt' needs a better method of doing the menu category AND I kinda screwed up by setting the default value to the program name (which will never be a useful category) - unfortunately there is no "Miscellaneous" category

Somewhat unrelated but concerning tar:
I also notice that the old tar supported the -y option for bzip, but using tar 1.22 (which supports xz) this is no longer available - now only -j works for bzip/bz2 and -J is for xz. I think I fixed all -y occurances (actually -xyf) but hope that this tar doesn't break any compatibilities for other scripts. I am going to take a look at the Xarchive wrapper scripts since it hasn't been updated for a couple years now.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#161 Post by technosaurus »

I had planned to add a checkbox but In order to not break stuff I just had it make both - if you don't have xz and tar >1.21 you will only get a pet and an error - otherwise you will get both pet and pxt

the infobox is convenient for messages that you don't want to get in the way
Xdialog --infobox "Will automatically timeout in ($X/1000) seconds" 0 0 $X
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#162 Post by technosaurus »

Need to figure out how to add an exit code to the configure options dialog that will let you easily restart pcompile if you hit cancel - any ideas? ... or should the configure options be separated?

for restarts maybe we should check for the confopts file and have a button to open them in the main gui

This is for the "Oh crap I forgot to enable/disable XXX" scenario.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
Gedrean
Posts: 139
Joined: Fri 05 Jun 2009, 05:59

#163 Post by Gedrean »

technosaurus wrote:gzipped tarballs - I may download the latest gzip and see if it supports leaving the existing file in place since some tar.gz files (specifically the ones for SDL and friends) are not recognized by tar for whatever reason (this is why I decided to add plain tar support in the first place)
That's really odd - I've not had it have ANY problems with the SDL packages - in fact those are the ones I end up compiling because they don't have any strange dependencies I don't already have.
I also changed some of the default values to false so that it doesn't stop a configure script due to a missing argument
Good thing.

User avatar
Gedrean
Posts: 139
Joined: Fri 05 Jun 2009, 05:59

#164 Post by Gedrean »

technosaurus wrote:I had planned to add a checkbox but In order to not break stuff I just had it make both - if you don't have xz and tar >1.21 you will only get a pet and an error - otherwise you will get both pet and pxt

the infobox is convenient for messages that you don't want to get in the way
Xdialog --infobox "Will automatically timeout in ($X/1000) seconds" 0 0 $X
The problem is, if I have it remain as dir2pxt, it just gives a /.pet message and NOTHING is made, so apparently your expected behavior is not what's happening.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#165 Post by technosaurus »

I will look into that tomorrow. I am planning to separate out the scripts again so that users have a chance to change configure options without rerunning the entire thing. I'm also adding a cleanup section to remove accidentally captured compile-time files. (for example <pkgdir>/root/my-documents/.... if you compile from there) ... needs to be done before copying the "extras". Will also revert back to tar -xf instead of using gunzip since it messes up the dirname portion - big 00ps.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#166 Post by sunburnt »

Hi technosaurus; Old thread, hope you still have interest in it.

As to configure options, saving all of them in a config. file would be good.
A config. profile file selector combo perhaps, the default config. at the top.

I`ve used the cli arguments to fill the source file and the user def. opt.
I need to set user def. opt.: --prefix=/tmp/apps.sq/mnt/( SrcFileName )
It conflicts with the checkbox: "--prefix=/usr" ( A saved config. would fix it.)

I need to compile apps. to run in the path setup by --prefix .
PCompile has lots of options, I understand some of them.
Some of the options might be useful for building apps. like this.

It seems to me PCompile is capable of building for other Linux distros.
I need to understand the options better. Are you willing to discuss this?
Perhaps by PM so your forum thread stays cleaner?

User avatar
harii4
Posts: 448
Joined: Fri 30 Jan 2009, 04:08
Location: La Porte City, IA , U.S.A.
Contact:

#167 Post by harii4 »

It seems to me PCompile is capable of building for other Linux distros.
I need to understand the options better. Are you willing to discuss this?
Perhaps by PM so your forum thread stays cleaner?
Other forum users might find such info useful as well? :wink:
It might be over my head but just saying.....
3.01 Fat Free / Fire Hydrant featherweight/ TXZ_pup / 431JP2012
----------------------------------------------------------------------------------------
Peace and Justice are two sides of the same coin.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#168 Post by technosaurus »

I guess I could revisit this a bit, maybe even add download support too. It needs smarter handling for cflags too (gc-sections sometimes breaks plugins and xml based UI.) and some tooltips explaining various nuances for each flag.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#169 Post by sunburnt »

Download support? What repository?
I looked at Slack but I didn`t see many packages, maybe I missed them.
I tried with Debian but it`s a mess to try to follow dependencies.
Tiny Core Linux`s dependency tree files were complete.

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#170 Post by sunburnt »

A GtkDialog gui I made, lists package groups, then packages and it`s info.
Attachments
DebianPackageTool.png
(25.93 KiB) Downloaded 666 times

Post Reply