LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   New src2pkg bug-fix version (https://www.linuxquestions.org/questions/slackware-14/new-src2pkg-bug-fix-version-620130/)

gnashley 02-10-2008 01:18 PM

New src2pkg bug-fix version
 
Just uploaded a new bug-fix version of src2pkg which addresses a few problems that have shown up lately.

A couple of minor features have been added, like automatic handling of conf files in the etc directory. If src2pkg finds conf files it will automatically rename them with the .new prefix and add lines to the doinst.sh file to have them configured when the package is installed.

Automatic handling of patches -no matter which -p? option they use -no more having to rename your pacthes if they use something other than -p1. Just place patches in the same directory with the sources and they will be applied for you.

Improved handling of make install rules -several people reported problems lately with this -some were very common erros, but other were more obscure. Seems to be fixed now...

Several changes to the routine which sets CFLAGS (and others) to accomodate athlon and other arches. Still evaluating the best compiler options to use...

Handle slack-suggests and slack-conflicts files if present.

DOCLIST can now include a whole subdirectory of documents.

Several other nagging things have been fixed.

You can get the new version (src2pkg-1.9.5) at the usual place:
http://distro.ibiblio.org/pub/linux/...nload/src2pkg/

Still trying to make sure and get all the minor bugs out so that I can release a really, really stable src2pkg-2.0. So please report any problems you have.

Gilbert

jelaiwang 02-10-2008 04:42 PM

I had the opportunity to try src2pkg 1.9.5 today on a problem I reported earlier with building an HPLIP package using trackinstall (see http://www.linuxquestions.org/questi...estion-616648/).

Unfortunately, I'm getting the same error:

jelai@etoh:~/tmp/hplip-2.8.2$ trackinstall
Client or user supplied NAME and VERSION: hplip-2.8.2
Deleting old build files - Done
Creating working directories:
PKG_DIR=/tmp/hplip-2.8.2-pkg-1
Checking for 'install' rule -
NOTICE! No install rule in Makefile.
FAILED!
trackinstall FAILURE in GENERIC_INSTALL No executables found

Hope this helps.

hitest 02-10-2008 05:12 PM

Thanks, gnashley:-)

Chuck56 02-10-2008 10:04 PM

I recently started trancoding video files to feed my D-Link DSM-520 Media Receiver. I had to install many new packages. Those packages that weren't available on SlackBuilds.org I built with src2pkg. All is well with the new packages created by src2pkg. Thanks gnashley!

C-Sniper 02-10-2008 10:31 PM

cheers gnashley! thanks for the great app!

rkrishna 02-11-2008 02:40 AM

upgraded package

do i need to run
*
src2pkg --setup
*
after every upgrade?

gnashley 02-11-2008 03:29 AM

jelaiwang, thanks for reporting your problem. I had checked out the functionality of src2pkg a week or so ago, but on hplip-2.7.10, which worked okay.
I've just tried with the new hplip-2.8.2 and also had no problems.
Are you manually configuring and compiling first? If so, what options are you passing to configure? The only thing I can see that would be causing this problem is that you are not pre-configuring and compiling the application first.

Is there a particular reason for not using the src2pkg program, instead of using trackinstall?

I seem to have no problems here creating packages of either version when using:
simply 'src2pkg hplip-2.8.2.tar.gz'

Still, the standard SlackBuild for hplip passes a few arguments to configure and also includes a couple of tweaks for the udev rules which should be included in the build.

You'll probably get the best results by including these tweaks and extra options. Below is a src2pkg script for hplip which includes them. Create an empty file in the same directory as the hplip tarball, named 'hplip.src2pkg'. Then paste the contents of the script below into the file and save it. You can then run the build with the command 'src2pkg -X'

Code:

#!/bin/bash
## src2pkg script for:        hplip
## src2pkg Copyright 2005-2008 Gilbert Ashley <amigo@ibilio.org>

SOURCE_NAME='hplip-2.8.2.tar.gz'
NAME='hplip'
VERSION='2.8.2'
ARCH='i486'
BUILD='1'
PRE_FIX='usr'
# Any extra options go here
EXTRA_CONFIGS='--sysconfdir=/etc --localstatedir=/var \
  --disable-xml-install --enable-foomatic-ppd-install \
  --with-hpppddir=/usr/share/cups/model/HP \
  --enable-network-build=yes'
 
# STD_FLAGS='-O2 -march=i486 -mtune=i686'

# Get the functions and configs
. /usr/libexec/src2pkg/FUNCTIONS ;

# do_all_processes can substitute these 16 steps:

pre_process
find_source
make_dirs
unpack_source
fix_source_perms
configure_source
compile_source
fake_install

# from the SlackBuild by Robby Workman  (http://rlworkman.net):
# Fix group and permissions in udev rules file
sed -i -e 's/\(OWNER=\)"lp".*\(GROUP="lp",\).\(MODE=\).*/\1"root", \2 \3"0660"/' \
        $PKG_DIR/etc/udev/rules.d/55-hpmud.rules

# Fix udev rules for current versions of udev
sed -i 's/SYSFS/ATTR/g' $PKG_DIR/etc/udev/rules.d/55-hpmud.rules

# No thanks, we don't replace/add files which are part of other packages
rm -rf $PKG_DIR/etc/sane.d

fix_pkg_perms
strip_bins
create_docs
compress_man_pages
make_description
make_doinst
make_package
post_process

# src2pkg - Copyright 2005-2008  Gilbert Ashley <amigo@ibiblio.org>
## See the documentation for more help and examples. Below are some of
# the most common Extras and Options for easy cut-and-paste use.
# EXTRA_CONFIGS='' PRE_FIX='' DOCLIST=''
# MAKE_COMMAND='' INSTALL_LINE=''
# SHELL_INSTALL='YES' CORRECT_PERMS='NO'
# When editing src2pkg scripts to add custom code, use these variables
# to refer to the current directory, the sources or the package tree:
# $CWD (current directory), $SRC_DIR (sources), $PKG_DIR (package tree)


gnashley 02-11-2008 12:02 PM

rkrishna, yes you have to run 'src2pkg --setup' after each upgrade, at least until I figure out a better way to provide upgrades. Upgrading removes the old package, and it removes the libraries and tar program which are compiled on your system when you run '--setup'. I'm considering other ways to handle upgrading which may make this easier. You may not have installed the one or two versions where I was letting you do this compiling during the installation of the package. That was a little easier, but it just doesn't seem to fit right on a Slackware system compiling something as part of package installation.

I'm looking at ways to make it possible to do online upgrades without having to uninstall and then reinstall or use upgradepkg.
Also, I'm working towards having a very stable 2.0 version which most users could stick with for a while without the need to upgrade until the next stable release.
The current cycle of frequent updates is unfortunate, but necessary because of having added som much code after src2pkg-1.6 which is still being debugged. Sorry for the inconvenience...

rkrishna 02-12-2008 01:55 AM

Quote:

rkrishna, yes you have to run 'src2pkg --setup' after each upgrade, at least until I figure out a better way to provide upgrades.
anyway i did the setup ;)

it will be nice if there is a changelog aswellas a readme

gargamel 02-12-2008 02:22 PM

Quote:

Originally Posted by rkrishna (Post 3054268)
anyway i did the setup ;)

it will be nice if there is a changelog aswellas a readme

I agree. Apart from that: src2pkg was on top my wishlist for the next Slackware release. Now it is above the list. ;-)

gargamel

gnashley 02-13-2008 01:24 AM

There is always a ChangeLog in /usr/doc/src2pkg-x.x.x and there is always a copy on the website here:
http://distro.ibiblio.org/pub/linux/...2pkg/ChangeLog

jelaiwang 02-16-2008 04:43 PM

Quote:

Originally Posted by gnashley (Post 3053197)
jelaiwang, thanks for reporting your problem. I had checked out the functionality of src2pkg a week or so ago, but on hplip-2.7.10, which worked okay.
I've just tried with the new hplip-2.8.2 and also had no problems.
Are you manually configuring and compiling first? If so, what options are you passing to configure? The only thing I can see that would be causing this problem is that you are not pre-configuring and compiling the application first.

gnashley, I appreciate the thorough (and helpful response). Yes, I'm an old checkinstall user, so for packages where I need to pass lots of configure options, I use trackinstall like I would have used checkinstall.

Quote:

Is there a particular reason for not using the src2pkg program, instead of using trackinstall?
Not really, I didn't know about src2pkg -N and -X. I tried it for hplip, using the EXTRA_OPTIONS variable to pass in the configure options and it worked! I really like this method better, less prone to human error for repeated builds if I save the src2pkg.auto script.

However, I still get the same error message from trackinstall 1.9.5 when I manually configure, make, and trackinstall. Here are the options I'm passing (in case it might help you debug):

Code:

./configure --enable-network-build --disable-pp-build --disable-fax-build --disable-gui-build
--disable-scan-build --enable-doc-build --enable-foomatic-ppd-install
--disable-foomatic-drv-install --with-hpppddir=/usr/share/ppd/HP --disable-hpijs-only-build
--prefix=/usr

I can't think of a situation where I would need to run trackinstall in this way now, but this may still be a legit bug.

Quote:

Still, the standard SlackBuild for hplip passes a few arguments to configure and also includes a couple of tweaks for the udev rules which should be included in the build.
I appreciate your telling me about this. I don't know much about SlackBuilds or what those extra lines mean (yet), but I'll look into it.

Many thanks for your support and for making src2pkg!

gnashley 02-17-2008 02:11 AM

I am unable to reproduce the failure here when using trackinstall, but I ma past version 1.9.5. The last few versions have had problems with a routine which checks for a valid 'make install' rule. I've tried several ways of doing this -some of which seemed to be working okay, and then someone would report problems with a ceratin package. I released pretty quickly two or three times trying to address this problem. Hopefully it is fixed by now...
Thanks for reporting the problem -I almost never use the 'trackinstall' utility so it is always possible that something I've done and tested with src2pkg may fail with trackinstall -but not usually as they use the same functions -trackinstall just doesn't call all of them.

You mentioned the -N and -X options -you might also look at using the -A option instead of -N. The -N option writes a script without doing anything. The -A option writes the script *after* the build, so it is able to include extra code, sometimes, based on what was actually done during the build. Also, the -A option enables extra features which can find description info and/or configuration options in rpm *.spec files or debian control/rules files when they are present. This can, at least, save you having to write or edit slack-desc files many times.

wootletootle 01-07-2010 09:36 PM

trackinstall failure
 
I have a problem similar to that described by jelai wang above.
I am using src2pkg v.2.0 with Slack 13.0 running kernel 2.6.29.6

In the past I used trackinstall to run 'make install' after configuration and compilation (using a makefile). Here's an example
of what happens when I use the current trackinstall that comes bundled
with src2pkg:

bash-3.1# trackinstall -i="make -i install"
Client or user supplied NAME and VERSION: glib-2.22.0
Deleting old build files - Done
Creating working directories:
PKG_DIR=/tmp/glib-2.22.0-i486-1
SRC_DIR=/usr/local/src/glib-2.22.0
Checking for Makefile rule: 'install' Okay
Creating content in JAIL root - Using: 'make -i install'
FATAL! Running 'make -i install' has failed with error: 1
Try using INSTALL_LINE 'make -i install' Exiting...
FAILED!! Creation of package glib-2.22.0-i486-1 has failed.
trackinstall ERROR in make_install in: install_to_jail_root

Running the stand-alone command 'make install' succeeds, but I
want to create a package so that the installation paths are
all properly recorded and a suitable entry is made in the pkgtool
database.

The same problem occurs with all the programs I have tried to
install in this fashion. Can someone suggest how I might properly
use trackinstall, or suggest another utility which does the same
thing (builds a slackpack).

Thanks for your suggestions....

Daedra 01-07-2010 11:48 PM

Thanks gnashley, Keep up the great work!

lol, I didn't see the date... this is an old thread, but still src2pkg is the best.

gnashley 01-08-2010 12:50 AM

First, try it using the src2pkg command instead of trackinstall:
src2pkg glib-2.22.0.tar.??
I suspect you may need to use:
src2pkg -DEST glib-2.22.0.tar.??
With the new src2pkg-2.0, the default INSTALL_TYPE has been made JAIL, but it fails with some packages. Anytime you have a failure such as this, it is worth trying one of the alternate content-creation methods. There are five in total:
JAIL, DEST(or DESTDIR), UNION, SAFE and REAL

wootletootle 01-08-2010 01:00 AM

Thanks for your suggestions. I didn't expect your response to be that quick, and I duplicated my post, please ignore.

Are you saying that src2pkg can take over the entire configuration
and compilation of just about any installed program? What if I need
to pass flags to <configure> or <make>?

.................................................................
EDIT: Wow, it worked, I'm impressed :) The first time round I tried

src2pkg glib-2.22.0.tar.gz

and got the same installation error as before. But

src2pkg -DEST glib-2.22.0.tar.gz

worked perfectly through all the stages (configuration, make,
make install) and created the Slackpack ready for use with
installpkg.

Thankyou very much gnashley :)

.................................................................
SECOND EDIT:

-DEST doesn't seem to work as a flag to trackinstall?
Can that be fixed?

gnashley 01-08-2010 05:33 AM

I'll look into the problem with DEST using trackinstall.
Yes, you can use src2pkg for the whole build. It will nearly always be more dependable because it gets tested more. There are a very few cases where trackinstall may give better results. Run 'src2pkg --help' to see the main options or look at the man-page. Passing options to configure is the most commonly-needed feature -you simply use, for example:
src2pkg -e='--disable cruft --enable-goodies' tarball-name
But, if you are using extra options, it really is a good idea to create a src2pkg script so you have a record of what you did. In such a case, you can do this:
src2pkg -e='--disable cruft --enable-goodies' -N tarball-name
The '-N' tells src2pkg to create the script for you. Then, you can run the script by simply using:
src2pkg -X
Note that you can still add other (Captial-lettered) options when using the '-X', option:
src2pkg -X -C -W -DEST
(Run the first script you find, place the final package in the Current directory, cleanup (Wipe up) temporary files when finished, use DESTDIR-type installation for creation of content)
This is handy because it lets you use 'hard copy' options which are essential to the package (configure options, make command, etc), while still having use of a range of transient options for user-oriented beahviours -and keeping the command-line shorter.
Thanks for the tip on -DEST and trackinstall.

veeall 01-08-2010 09:01 AM

I just upgraded to src2pkg-2.0-noarch-16.tgz after grabing latest updates from slackware64-current. While running 'src2pkg --setup' created and installed helpers successfully, during compiling it complained about 'Creating libsentry - Ooops! Can't live without it...'. Afterwards running 'src2pkg package.tar.gz' still gave this notice:
Code:

NOTICE! src2pkg has not been setup yet or needs updating.
  In order to use src2pkg you must first login as root and run
  src2pkg with the command: 'src2pkg --setup'

Is 'libsentry' a missing dependency?

tuxdev 01-08-2010 09:53 AM

libsentry (as well as a few other things) is distributed with src2pkg as source and is built by src2pkg --setup

zhoun 01-08-2010 10:06 AM

confirmed this!
When use src2pkg with root, it always compile src2pkg-helpers first...
again and again.

I am using slackware current.
during compiling it complained about 'Creating libsentry - Ooops! Can't live without it...'

It's ok under slackware 12.2.
just print 'Creating libsentry - Ok'


Quote:

Originally Posted by veeall (Post 3818888)
I just upgraded to src2pkg-2.0-noarch-16.tgz after grabing latest updates from slackware64-current. While running 'src2pkg --setup' created and installed helpers successfully, during compiling it complained about 'Creating libsentry - Ooops! Can't live without it...'. Afterwards running 'src2pkg package.tar.gz' still gave this notice:
Code:

NOTICE! src2pkg has not been setup yet or needs updating.
  In order to use src2pkg you must first login as root and run
  src2pkg with the command: 'src2pkg --setup'

Is 'libsentry' a missing dependency?


gnashley 01-08-2010 11:03 AM

Yeah, libsentry is a must-have. Current just switched to glibc-2.11.1 the other day and I'm pretty sure this is what is keeping libsentzry/src2pkg-helpers from building.
veall and zhoun, can you both send me an email so I can send you a newer copy of src2pkg-helpers or the full pre-release src2pkg so you can see if it now builds?
I've been planning on releasing again real soon -this just makes it more pressing...

ponce 01-08-2010 01:05 PM

this is the error
Code:

src2pkg-helpers-0.7/libsentry-0.6.7.8$ make
./create-defines
Checking truncate argument type... off_t
Checking libc version... libc.so.6
Checking glibc subversion... cc -Wall -U_FORTIFY_SOURCE -D_GNU_SOURCE -DLIBDIR=\"/usr/local/lib\" -DPIC -fPIC -D_REENTRANT -DVERSION=\"0.6.7.8\" -c libsentry.c
libsentry.c: In function 'fopen':
libsentry.c:2529: warning: cast from pointer to integer of different size
libsentry.c:2544: warning: cast from pointer to integer of different size
libsentry.c: At top level:
libsentry.c:3049: error: conflicting types for 'scandir'
/usr/include/dirent.h:252: note: previous declaration of 'scandir' was here
libsentry.c: In function 'fopen64':
libsentry.c:3605: warning: cast from pointer to integer of different size
libsentry.c: At top level:
libsentry.c:3698: error: conflicting types for 'scandir64'
/usr/include/dirent.h:275: note: previous declaration of 'scandir64' was here
make: *** [libsentry.o] Error 1


gnashley 01-08-2010 01:11 PM

Yeah, I think I've fixed that already as I ran into it the other day. I rolled in some fixes for glibc>=2.10 that adress that and some 64-bit issues.

Anyone running slackware64-current who can test these fixes?

mlangdn 01-08-2010 02:00 PM

I just installed src2pkg and ran src2pkg --setup with no problems on x64-current.

gnashley 01-08-2010 02:04 PM

Oh really? So maybe it is working on 64-bit, but not on 32 -sounds backwards...

mlangdn 01-08-2010 02:14 PM

I should have added that I am running the multilib version. That may be important.

Daedra 01-08-2010 02:16 PM

Quote:

Originally Posted by veeall (Post 3818888)
I just upgraded to src2pkg-2.0-noarch-16.tgz after grabing latest updates from slackware64-current. While running 'src2pkg --setup' created and installed helpers successfully, during compiling it complained about 'Creating libsentry - Ooops! Can't live without it...'. Afterwards running 'src2pkg package.tar.gz' still gave this notice:
Code:

NOTICE! src2pkg has not been setup yet or needs updating.
  In order to use src2pkg you must first login as root and run
  src2pkg with the command: 'src2pkg --setup'

Is 'libsentry' a missing dependency?

I can also confirm this on current 32bit

mlangdn 01-08-2010 02:24 PM

No, its not working. Only the install and setup ran ok. Running src2pkg on a tarball still gives notice that helpers needs updating and it seems to rebuild libsentry and coreutils. Then it goes on with the build.

gnashley 01-08-2010 02:56 PM

Okay, sorry it is late here in Germany so I must work on this tomorrow with a fresh start... Thanks to all for the feedback.


All times are GMT -5. The time now is 01:50 AM.