SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
On a 64-bit system with FULL Multilib, the ELF 32-bit progs should 'just work' ...
-- kjh
ok, perhaps I could just leave bin/* as is and install
the lib*.so in usr/lib since it's 32-bit library
If someone with that type of printer and a 64-bit system could test it,
we'll know for sure
I removed the restriction for the 64-bit architecture.
I just found an error in my SlackBuilds (this one and the HL-L2300D):
In doinst.sh
Since that particular Printer Driver is 32-bit software, LIBDIRSUFFIX should ALWAYS be blank so that the 32-bit 'stuff' lands in /usr/lib/ and not /usr/lib64/
See the code after my sig ...
I also wondered about the following Symlink Command in the doinst.sh code generator.
This is the original code that sets PARCH and LIBDIRSUFFIX.
Code:
PARCH=i386
LIBDIRSUFFIX=""
if [ $ARCH == "x86_64" ]; then
PARCH=x86_64
LIBDIRSUFFIX=64
fi
#
# PARCH will falsely tag the Package as a 64-bit Package on any x86_64 System
#
PKGNAME=brotherhll2300d-${VERSION}-${PARCH}-${BUILD}$TAG.txz
I changed it to this ...
Code:
FORCE=${FORCE:-0} # kjh added this to force the build on 64-bit w/out MultiLib
PARCH=i386
LIBDIRSUFFIX="" # not used here
IsMultiLib=0 # kjh was here
#
# kjh changed this
#
if [ $ARCH == "x86_64" ]
then
test -f /usr/lib/libcupsfilters.la && IsMultiLib=1 || IsMultiLib=0
if [ "$IsMultiLib" = "0" ]
then
echo "this is a 32-bit only Package. You will require MultiLib to run on $ARCH" >&2
[ "$FORCE" = "0" ] && exit 1
fi
fi
PKGNAME=brotherhll2300d-${VERSION}-${PARCH}-${BUILD}$TAG.txz
On a 64-bit system with FULL Multilib, the ELF 32-bit progs should 'just work'
Actually, you only need the cups-compat32 package and the glibc-solibs package from our revered Alien_Bob to support the 32-bit Brother printer driver on a 64-bit system. (Choose your Slackware version at http://bear.alienbase.nl/mirrors/people/alien/multilib/ The cups-compat32 package is in the ./slackware64-compat32/ap-compat32 subdirectory)
Since that particular Printer Driver is 32-bit software, LIBDIRSUFFIX should ALWAYS be blank so that the 32-bit 'stuff' lands in /usr/lib/ and not /usr/lib64/
in the HL-L2300D there's no 32-bit stuff in /usr/lib64,
there's just a symbolic link to a shell script in /usr/lib64/cups/filter
#
# PARCH will falsely tag the Package as a 64-bit Package on any x86_64 System
#
PKGNAME=brotherhll2300d-${VERSION}-${PARCH}-${BUILD}$TAG.txz
[/code]
The problem is preventing from installing the package if those 32-compat libraries
are missing. Say, someone builds this in a 64-bit environment with the required libraries,
and they want to install the resulting package on another (pure) 64-bit environment.
I was thinking about what's the best way to warn the user...
@allend
Quote:
Actually, you only need the cups-compat32 package and the glibc-solibs package from our revered Alien_Bob to support the 32-bit Brother printer driver on a 64-bit system.
Yes, I mentioned that earlier.
I think I should put a readmefirst.txt or x86_64.txt along with that info
and the warning.
@offgridguy
don't use the SlackBuild yet. There are a few things I need to check first.
@offgridguy
don't use the SlackBuild yet. There are a few things I need to check first.
You bet, actually I am hoping to get microlinux installed on this machine tomorrow and I would like the drivers there as MLED comes with Libre Office.
I actually have 2 separate install of 14.1 on here now, one is earmarked for MLED.
I added a x86_64readme.txt to give the info for running it on
a 64-bit slackware system (I also put the same info in the slack-desc).
Looking at the cupswrapper script in usr/local/Brother/cupswrapper/
I noticed that when invoked it wrote a ppd file and and lpdwrapper
I wrote these directly in the appropriate directories (usr/share...).
I applied awk and sed on that script to produce these files,
and I left usr/local/Brother/cupswrapper/cupswrapper* out of the installation.
Also, in order not to mislead, the package name resulting is *x86*.txz
(and no $LIBDIRSUFFIX).
Let me know if you see any error, or something I forgot to add.
Thanks
vonbiber --
Maybe all you can do would be to install something like the 'standard' set of SBo Files plus a README.SACKWARE file ?
-- kjh
I was considering including the 3 libraries from ALIENbob but then thought it would
be better to warn the user in the slack-desc and to remove the misleading $LIBDIRSUFFIX or
x86_64 in the name of the package
So I commented out this passage
The 7030 package built but not having that printer, I didn't install it.
I pounded out the clear statement in the SlackBuild so I could see the output ( below )
One thing I noticed yesterday when I used allend's suggestion to try the rpm2tgz command ( http://docs.slackware.com/howtos:har...r_installation ) is that the permissions on var/spool/lpd/DCP7030/ may be incorrect ( 644 ) ... see below for directory and file listings.
If these perms are incorrect, maybe needs a doinst.sh or maybe fix the perms ( ??? and owner ??? ) on the extracted directory, before running makepkg ?
Looks pretty good to me and thanks again !
-- kjh
# this is the output from the SlackBuild
#
# sh brotherdcp7030.SlackBuild
Code:
extracting files from /home/dld/Brother/vonbiber-Brother-7030-SlackBuild/cupswrapperDCP7030-2.0.2-1.i386.rpm ...
71 blocks
... done
extracting files from /home/dld/Brother/vonbiber-Brother-7030-SlackBuild/brdcp7030lpr-2.0.2-1.i386.rpm ...
243 blocks
... done
Slackware package maker, version 3.141593.
Searching for symbolic links:
No symbolic links were found, so we won't make an installation script.
You can make your own later in ./install/doinst.sh and rebuild the
package if you like.
This next step is optional - you can set the directories in your package
to some sane permissions. If any of the directories in your package have
special permissions, then DO NOT reset them here!
Would you like to reset all directory permissions to 755 (drwxr-xr-x) and
directory ownerships to root.root ([y]es, [n]o)? n
Creating Slackware package: /home/dld/Brother/vonbiber-Brother-7030-SlackBuild/brotherdcp7030-2.0.2-1-i386-1_vbi.txz
./
var/
var/spool/
var/spool/lpd/
var/spool/lpd/DCP7030/
usr/
usr/bin/
usr/bin/brprintconflsr2
usr/bin/brprintconfiglpr2
usr/share/
usr/share/Brother/
usr/share/Brother/cupswrapper/
usr/share/Brother/cupswrapper/brcupsconfig3
usr/share/Brother/inf/
usr/share/Brother/inf/brDCP7030rc
usr/share/Brother/inf/paperinf
usr/share/Brother/inf/setupPrintcap
usr/share/Brother/inf/brDCP7030func
usr/share/Brother/inf/braddprinter
usr/share/Brother/lpd/
usr/share/Brother/lpd/psconvert2
usr/share/Brother/lpd/filterDCP7030
usr/share/Brother/lpd/rawtobr2
usr/share/cups/
usr/share/cups/model/
usr/share/cups/model/DCP7030.ppd
usr/doc/
usr/doc/brotherdcp7030/
usr/doc/brotherdcp7030/SlackBuild/
usr/doc/brotherdcp7030/SlackBuild/brotherdcp7030.SlackBuild
usr/doc/brotherdcp7030/SlackBuild/readme.txt
usr/lib/
usr/lib/cups/
usr/lib/cups/filter/
usr/lib/cups/filter/brlpdwrapperDCP7030
usr/lib/libbrcomplpr2.so
install/
install/slack-desc
Slackware package /home/dld/Brother/vonbiber-Brother-7030-SlackBuild/brotherdcp7030-2.0.2-1-i386-1_vbi.txz created.
dcp_7030 (driver for the Brother DCP-7030 printer)
This package contains the lpr printer driver and
the CUPS wrapper for the Brother DCP-7030 laser printer.
Note that the binaries here are 32-bit. If you want to run this
on a 64-bit slackware system, you need to install at least these
packages (from Alien Bob): cups-compat32*, cups-filters-compat32*,
and glibc-solibs*.
http://support.brother.com/g/b/
package brotherdcp7030-2.0.2-1-i386-1_vbi.txz successfully created in /home/dld/Brother/vonbiber-Brother-7030-SlackBuild
#
# extract brotherdcp7030-2.0.2-1-i386-1_vbi.txz for inspection ...
#
Code:
# mkdir tmp
# cd tmp
# tar -xvf ../brotherdcp7030-2.0.2-1-i386-1_vbi.txz
#
# these are the perms on the directories in brotherdcp7030-2.0.2-1-i386-1_vbi.txz ( note the last one ~/DCP7030/ )
#
The Package Names have an extra '-' char in the VERSION.
This causes the 'standard' Slackware Package Name Parser to fail.
One way to fix it is to add a tr command to translate '-' to '.' or '_' after you extract the VERSION from the rpm file name:
Code:
VERSION="$(echo $VERSION |tr '-' '.')" # translate '-' to '.'
#
# or
#
VERSION="$(echo $VERSION |tr '-' '_')" # translate '-' to '_'
This way, the Package File Name will parse using the std SlackWare Rules ( found all over the place ).
-- kjh
# original Package FileName with an extra '-' in VERSION, parsepkg fails:
Code:
# parsepkg vonbiber-Brother-7030-SlackBuild/brotherdcp7030-2.0.2-1-i386-1_vbi.txz
Package = brotherdcp7030-2.0.2-1-i386-1_vbi
Name = brotherdcp7030-2.0.2
Version = 1
Arch = i386
Build = 1
Tag = _vbi
Ext = .txz
# 'fixed' VERSION with '-' translated to '.' ...
Code:
# parsepkg vonbiber-Brother-7030-SlackBuild/brotherdcp7030-2.0.2.1-i386-1_vbi.txz
Package = brotherdcp7030-2.0.2.1-i386-1_vbi
Name = brotherdcp7030
Version = 2.0.2.1
Arch = i386
Build = 1
Tag = _vbi
Ext = .txz
#
# this is my parsepkg script if you want it ...
#
# save as parsepkg ( or invoke with -v flag ) and the output will include each Slackware Package FileName Component
# save as any other name ( or make a hard link ) and the output will only include the Program Name ( and optional Prefix ; Suffix )
#
Code:
#!/bin/sh
PrgNam="`basename $0`"
DirNam="`dirname $0`"
if [ "$DirNam" = "." ]
then
if [ -f "$PrgNam" ]
then
DirNam="`pwd`"
else
DirNam="`whichone $PrgNam`"
DirNam="`dirname $DirNam`"
fi
elif [ "$DirNam" = ".." ]
then
DirNam="`pwd`"
DirNam="`dirname $DirNam`"
elif [ "`dirname $DirNam`" = ".." ]
then
FooNam="`basename $DirNam`"
DirNam="`pwd -P`"
DirNam="`dirname $DirNam`/$FooNam"
elif [ "$DirNam" = "" ] # should not happen ...
then # see: man 3 dirname
DirNam="`whichone $PrgNam`"
DirNam="`dirname $DirNam`"
fi
AllArg="$@"
CwdDir="`pwd -P`"
File=""
DoSuffix="0"
DoPrefix="0"
Verbose=0
WacExt ()
{
echo "$@" |
gawk '
{
if (( L = length( $0 )) < 1 )
{
print ""
exit 0
}
for ( i = L ; i > 0 ; i -- )
{
if (( substr( $0, i, 1 ) == "." ) \
&& ( substr( $0, i-1, 1 ) != "/" ))
{
print substr( $0, 1, i-1 )
exit 0
}
}
print $0
exit 0
}'
return $?
}
GetExt ()
{
GetExtCase=""
while [ "$1" = "-l" \
-o "$1" = "-L" \
-o "$1" = "-u" \
-o "$1" = "-U" ]
do
if [ "$1" = "-l" -o "$1" = "-L" ]
then
GetExtCase="l"
shift
elif [ "$1" = "-u" -o "$1" = "-U" ]
then
GetExtCase="u"
shift
fi
done
echo "$@" |
gawk '
BEGIN {
Case = "'"$GetExtCase"'" ""
}
function FixCase( DoCase, InStr )
{
if ( DoCase == "l" )
{
return( tolower( InStr ))
}
if ( DoCase == "u" )
{
return( toupper( InStr ))
}
return( InStr )
}
# main
{
if (( L = length( $0 )) < 1 )
{
print ""
exit 0
}
for ( i = L ; i > 0 ; i -- )
{
if (( substr( $0, i, 1 ) == "." ) \
&& ( substr( $0, i-1, 1 ) != "/" ))
{
print FixCase( Case, substr( $0, i ))
exit 0
}
}
print ""
exit 0
}'
return $?
}
Usage ()
{
ErrNum=$1
shift
[ $# -gt 0 ] && echo -e "\n$*" >&2
echo -e "\nusage: $PrgNam [ -foo ] " >&2
cat <<Usage_EOF >&2
No help text here !
boo
hoo
hoo ...
Usage_EOF
exit $ErrNum
}
while getopts vhlspf: junk 2>/dev/null
do
case $junk in
f) File="$OPTARG"
;;
p) DoPrefix=1
;;
s) DoSuffix=1
;;
l) DoPrefix=1
DoSuffix=1
;;
v) Verbose=1
;;
h) Usage 0
;;
*) Usage 1
;;
esac
done
shift `expr $OPTIND - 1`
FileList="$@"
[ "$File" != "" ] && FileList="$FileList $(cat $File)"
[ "$FileList" = "" ] && echo "usage: $PrgNam [ -f ListFile ] [ File [ File ... ]]" >&2 && exit 1
for PkgFile in $FileList
do
echo $PkgFile
done |
gawk '
BEGIN {
PrgNam = "'"$PrgNam"'" ""
DirNam = "'"$DirNam"'" ""
Verbose = "'"$Verbose"'" +0
DoPrefix = "'"$DoPrefix"'" +0
DoSuffix = "'"$DoSuffix"'" +0
RetCode = 0
DoProps = (( Verbose == 1 ) || ( PrgNam == "parsepkg" )) ? 1 : 0
Prefix = ( DoPrefix == 1 ) ? " " : ""
Suffix = ( DoSuffix == 1 ) ? "-" : ""
}
function BaseName( InStr, N, FooAry )
{
N = split( InStr, FooAry, "/" )
if ( N < 2 )
return( InStr )
return( FooAry [N] )
}
function WacExt( InStr, i )
{
# returns FileName sans LAST dot-extent
if ( InStr == "" )
{
return ( InStr )
}
for ( i = length( InStr ) ; i > 0 ; i-- )
{
if ( substr( InStr, i, 1 ) == "." )
{
if ( i > 1 )
return( substr( InStr, 1, i-1 ))
else
return( InStr )
}
}
return( InStr )
}
function GetExt( InStr, i )
{
# returns LAST dot-extent
if ( InStr == "" )
return ( InStr )
for ( i = length( InStr ) ; i > 0 ; i-- )
{
if ( substr( InStr, i, 1 ) == "." )
{
if ( i > 1 )
return( substr( InStr, i ))
else
return( "" )
}
}
return( "" )
}
# main
{
Pkg = BaseName( $NF )
Ext = GetExt( Pkg )
if ( match( Ext, /t.*z$/ ))
{
Pkg = WacExt( Pkg )
}
else
{
Ext = ""
}
N = split( Pkg, FooAry, "-" )
Build = FooAry[ N-- ]
Arch = FooAry[ N-- ]
Ver = FooAry[ N-- ]
Tag = ""
Name = Sep = ""
for ( i = 1 ; i <= N ; i ++ )
{
Name = Name Sep FooAry[ i ]
Sep = "-"
}
if ( match( Build, /^[0-9][0-9]*/ ))
{
Tag = substr( Build, RLENGTH + 1 )
Build = substr( Build, RSTART, RLENGTH )
}
if ( DoProps == 1 )
{
print "Package = " Pkg
print "Name = " Name
print "Version = " Ver
print "Arch = " Arch
print "Build = " Build
print "Tag = " Tag
if ( Ext != "" )
{
print "Ext = " Ext
}
print ""
}
else
{
print Prefix Name Suffix
}
}'
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.