Commits

Rodrigo Bistolfi  committed e18f7d2

Initial commit at vlcore

  • Participants
  • Tags 0.4.12.2-6.0

Comments (0)

Files changed (17)

File install/slack-desc

+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.  Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in.  You must
+# make exactly 11 lines for the formatting to be correct.  It's also
+# customary to leave one space after the ':'.
+
+$SHIM|-----handy-ruler------------------------------------------------------|
+sbbuilder: sbbuilder (perl script for generating SlackBuilds)
+sbbuilder:
+sbbuilder: SlackBuild Builder its a small perl script for automating 
+sbbuilder: the generation of SlackBuilds and the directory structure needed
+sbbuilder: for building packages compliant with the VectorLinux repository
+sbbuilder: standards.
+sbbuilder:
+sbbuilder: License: GPL
+sbbuilder: Authors: Kidd, rbistolfi
+sbbuilder: Website: http://vectorlinux.com

File install/slack-required

+perl >= 5.8.0-i586-1vl59 | perl >= 5.8.0-i586-1vl60

File sbbuilder-0.4.12.2-noarch-5vl60.tlz

Binary file added.

File usr/bin/sbbuilder

+#!/usr/bin/perl
+
+##-{{{
+=head1 NAME
+
+sbbuilder - A Simple script to create SlackBuild files with directory structure
+
+=head1 SYNOPSIS
+
+sbbuilder --package=foo --version=42 [--user=Bill] [--build=1] ...
+
+
+    Help Options:
+	--package  Name of the package to build SlackBuild for.
+	--version  Version of the package to build SlackBuild for.
+	--link	   Direct link to the source tarball.
+	--help     Show this scripts help information.
+	--manual   Read this scripts manual.
+
+=cut
+
+
+=head1 OPTIONS
+
+=over 8
+
+=item B<--package=>string
+
+Name of the package.
+
+=item B<--version=>string
+
+Version of the package.
+
+=item B<--build=>string
+
+Build number.
+
+=item B<--user=>string
+
+Author of the SlackBuild.
+
+=item B<--ldoptions=>string
+
+Extra ldoptions.
+
+=item B<--type=>string
+
+Type of SlackBuild.  There are 5 types of SlackBuilds :
+
+I<normal> . Default configure; make and make install flags. 
+
+I<perl> . Slackbuild for perl packages.
+
+I<python> . Slackbuild for python packages.
+
+I<noarch> . noarch package? This is for you. 
+
+I<cmake> . Use cmake instead GNU autoconf.
+
+=item B<--link=>string
+
+Enter a download link if you know where you can find the source tarball.
+
+If this option is set and nor package nor version are, sbbuilder will try to
+guess them from the file. Alert: No success guaranteed, sbbuilder expects a
+standard naming scheme.
+
+Example: sbbuilder --link=http://foobar.com/foo-2.3.tar.gz [--user=Bill] [--build=1] ...
+
+
+=item B<--configure_options=>string
+
+Pass arguments to the configure script, in general quotes are required.
+
+Example: sbbuilder --link=http://foobar.com/foo-2.3.tar.gz --configure_options="--without-x"
+
+=item B<--add=>string
+
+Add explicit package as dependency. Usually needed when a software has a non binary dependency.
+
+Example: sbbuilder --link=http://foobar.com/foo-2.3.tar.gz --add="package_name >= 1.0-i586-1vl60"
+
+=item B<--exclude=>string
+
+Remove a package from the dependencies list.
+
+Example: sbbuilder --link=http://foobar.com/foo-2.3.tar.gz --exclude="package_name >= 1.0-i586-1vl60"
+
+=item B<--noconfig>
+
+Do not include the execution of a configure script.
+
+=item B<--xdesktop>
+
+Include the generation of a Desktop Entry in the SlackBuild.
+
+=item B<--help>
+Show the brief help information.
+
+=item B<--manual>
+Read the manual, with examples.
+
+=item B<--version>
+Show the version number and exit.
+
+=back
+
+=cut
+
+=head1 DESCRIPTION
+
+
+  Sbbuilder is a perl script for generating SlackBuilds for the VectorLinux repository. 
+  It was written for helping to build packages compliant with Vectorlinux repository standards 
+  in a consistent way.
+  
+
+=cut
+
+
+=head1 AUTHORS
+
+kidd,  
+rbistolfi
+
+=cut
+
+=head1 LICENSE
+
+GNU General Public License
+=cut
+##-}}}
+
+use strict;
+use warnings;
+use Template;
+use Getopt::Long;
+use Pod::Usage;
+
+# main
+my $user;
+my $type;
+my $package;
+my $version;
+my $link;
+my $build = 1;
+my $configure_options;
+my $ldflags;
+my $manual;
+my $help;
+my $add;
+my $exclude;
+my $noconfig;
+my $xdesktop;
+
+GetOptions( 
+	"user=s"              => \$user,
+	"type=s"	      => \$type,
+	"package=s"           => \$package,
+	"version=s"           => \$version,
+	"link=s"              => \$link,
+	"build=s"	      => \$build,
+	"configure_options=s" => \$configure_options,
+	"ldflags=s"           => \$ldflags,
+	"manual"    	      => \$manual,
+	"help"		      => \$help,
+	"add=s"		      => \$add,
+	"exclude=s"	      => \$exclude,
+	"without_config"      => \$noconfig,
+	"xdesktop"	      => \$xdesktop);
+
+my $message_text = "\nVectorLinux SlackBuild Builder.\n";
+my $exit_status   = 1;         
+my $verbose_level = 0;
+$verbose_level=2 if $manual;
+
+if (!$link and (!$package or !$version)) {
+       	pod2usage ({ -message => $message_text ,
+	     -exitval => $exit_status  ,  
+	     -verbose => $verbose_level,
+	     });
+}
+
+if ($link and !$package and !$version) {
+	($package, $version) = $link =~ m{(?:ht|f)tp.*/(.+)-([^-]+)\.t(ar|gz)}i ;
+}
+
+chomp ($user = $user || $ENV{VL_PACKAGER} || `whoami`);
+$link =~ s/$package/\$NAME/g if ($link) ;
+$link =~ s/$version/\$VERSION/g if ($link);
+
+# Get sbbuilder version
+my $sbbversion;
+my $ls;
+
+open $ls, "ls /var/log/packages/sbbuilder*|";
+while (<$ls>) {
+	if (m/sbbuilder/) {
+		($sbbversion) = m/sbbuilder-(.+)-.+-\d+vl\d+/ ;
+	}
+}
+#---
+
+my $tt = Template->new({
+	INCLUDE_PATH => '/usr/share/sbb/template'});
+
+my $file = 'main.template';
+my $vars = {
+       	user              => $user,
+       	type              => $type,
+       	'package'         => $package,
+       	version           => $version,
+       	'link'            => $link,
+        build             => $build,
+       	configure_options => $configure_options,
+       	ldflags           => $ldflags,
+	add		  => $add,
+	exclude		  => $exclude,
+	sbbversion        => $sbbversion,
+	noconfig	  => $noconfig,
+	xdesktop	  => $xdesktop,
+	};
+
+my $sbText;
+$tt->process($file, $vars, \$sbText);
+$sbText =~ s/^\s+|\s+$//g;
+
+mkdir "$package" or warn "$!. Failed creating top dir.\n";
+mkdir "$package/$version" or warn "$!. Failed creating version folder.\n";
+mkdir "$package/$version/src" or warn "$!. Failed creating src folder.\n";
+chdir "$package/$version/src" or die $!;
+open my $fh, "+>$package.SlackBuild" or die $!;
+print $fh $sbText;
+close $fh;
+
+# vim: set tabstop=4 shiftwidth=4 foldmethod=marker : ##

File usr/share/sbb/template/cflags

+#CFLAGS SETUP
+#--------------------------------------------
+if [[ "$ARCH" = i?86 ]]; then
+  ARCH=i586
+  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+  CONFIGURE_TRIPLET="i486-slackware-linux"
+elif [ "$ARCH" = "x86_64" ]; then
+  SLKCFLAGS="-O2 -fpic"
+  CONFIGURE_TRIPLET="x86_64-vlocity-linux"
+elif [ "$ARCH" = "powerpc" ]; then
+  SLKCFLAGS="-O2"
+  CONFIGURE_TRIPLET="powerpc-vlocity-linux"
+fi
+
+export CFLAGS="$SLKCFLAGS $CFLAG_OPTIONS"
+export CXXFLAGS=$CFLAGS
+export LDFLAGS="$LDFLAGS $LDFLAG_OPTIONS"
+#--------------------------------------------
+

File usr/share/sbb/template/configure.cmake

+#CONFIGURE & MAKE
+#----------------------------------------------------------------------
+# If you are building a KDE-related app, then change the following
+# arguments in the script below:
+# --prefix=$(kde-config -prefix) \\
+# --sysconfdir=/etc/kde \\
+#
+# Making these changes will ensure that your package will build in the
+# correct path and that it will work seamlessly within the KDE environment.
+#
+#-----------------------------------------------------------------------
+
+echo "Configuring source..."
+
+#mkdir -p build
+#cd build || exit 1
+
+# Build
+cmake . -DCMAKE_INSTALL_PREFIX:PATH=/usr \
+	-DBUILD_SHARED_LIBS:BOOL=ON \
+	-DSYSCONFDIR:PATH=/etc \
+	$CONFIG_OPTIONS || exit 1
+
+make VERBOSE=1 || exit 1
+make install DESTDIR=$PKG || exit 1

File usr/share/sbb/template/configure.custom

Empty file added.

File usr/share/sbb/template/configure.default

+#CONFIGURE & MAKE
+#----------------------------------------------------------------------
+# If you are building a KDE-related app, then change the following
+# arguments in the script below:
+# --prefix=$(kde-config -prefix) \
+# --sysconfdir=/etc/kde \
+#
+# Making these changes will ensure that your package will build in the
+# correct path and that it will work seamlessly within the KDE environment.
+#
+#-----------------------------------------------------------------------
+
+echo "Configuring source..."
+[%- UNLESS noconfig %]
+[%- SET configure = 
+'./configure --prefix=/usr \
+  --sysconfdir=/etc \
+  --localstatedir=/var \
+  --mandir=/usr/man \
+  --with-included-gettext \
+  --disable-debug \
+  --program-prefix="" \
+  --program-suffix="" \
+  --build=$CONFIGURE_TRIPLET \
+  $CONFIG_OPTIONS || exit 1' %]
+[%- END %]
+[% configure %]
+
+make || exit 1
+
+make install DESTDIR=$PKG || exit

File usr/share/sbb/template/configure.perl

+#CONFIGURE & MAKE
+#----------------------------------------------------------------------
+# If you are building a KDE-related app, then change the following
+# arguments in the script below:
+# --prefix=\$(kde-config -prefix) \\
+# --sysconfdir=/etc/kde \\
+#
+# Making these changes will ensure that your package will build in the
+# correct path and that it will work seamlessly within the KDE environment.
+#
+#-----------------------------------------------------------------------
+
+echo "Configuring source..."
+
+perl Makefile.PL || exit 1
+make || exit 1
+make test || exit 1
+make install DESTDIR=$PKG || exit 1
+#this next part should be done for all perl pkgs
+PERLDIR=$(grep ^INSTALLARCHLIB Makefile|cut -d " " -f3)
+# create and add our first line
+cat >> $PKG/install/doinst.sh << FOE
+cat >> $PERLDIR/perllocal.pod << EOF
+FOE
+# Now copy contents of .pod of this package to next line
+cat $PKG/$PERLDIR/perllocal.pod >> $PKG/install/doinst.sh
+# Okay it's done, now add final closing EOF to doinst.sh
+cat >> $PKG/install/doinst.sh << FOE
+EOF
+FOE
+# Confused yet?  I am.  Done making the doinst.sh Now remove .pod
+rm $PKG/$PERLDIR/perllocal.pod
+

File usr/share/sbb/template/configure.python

+#CONFIGURE & MAKE
+#----------------------------------------------------------------------
+# If you are building a KDE-related app, then change the following
+# arguments in the script below:
+# --prefix=$(kde-config -prefix) \\
+# --sysconfdir=/etc/kde \\
+#
+# Making these changes will ensure that your package will build in the
+# correct path and that it will work seamlessly within the KDE environment.
+#
+#-----------------------------------------------------------------------
+
+echo "Configuring source..."
+
+python setup.py build
+python setup.py install --root=$PKG
+

File usr/share/sbb/template/description

+#if there is a slack-desc in src dir use it
+if test -f $CWD/slack-desc; then
+cp $CWD/slack-desc $RELEASEDIR/slack-desc
+else
+# This creates the white space in front of "handy-ruler" in slack-desc below.
+
+LENGTH=$(expr length "$NAME")
+SPACES=0
+SHIM=""
+until [ "$SPACES" = "$LENGTH" ]; do
+SHIM="$SHIM "
+let SPACES=$SPACES+1
+done
+
+# Fill in the package summary between the () below.
+# Then package the description, License, Author and Website.
+# There may be no more then 11 $NAME: lines in a valid slack-desc.
+
+cat > $RELEASEDIR/slack-desc << EOF
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.  Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in.  You must
+# make exactly 11 lines for the formatting to be correct.  It's also
+# customary to leave one space after the ':'.
+
+$SHIM|-----handy-ruler------------------------------------------------------|
+$NAME: $NAME ()
+$NAME:
+$NAME: 
+$NAME: 
+$NAME: 
+$NAME:
+$NAME:
+$NAME: License: GPL
+$NAME: Authors: 
+$NAME: Website: 
+
+EOF
+fi
+cat >> $RELEASEDIR/slack-desc << EOF
+
+
+
+#----------------------------------------
+BUILDDATE: $(date)
+PACKAGER:  $VL_PACKAGER
+HOST:      $(uname -srm)
+DISTRO:    $(cat /etc/vector-version)
+CFLAGS:    $CFLAGS
+LDFLAGS:   $LDFLAGS
+CONFIGURE: $(awk "/\.\/configure\ /" $TMP/$NAME-$VERSION/config.log)
+
+EOF
+
+cat $RELEASEDIR/slack-desc > $PKG/install/slack-desc

File usr/share/sbb/template/header

+#!/usr/bin/bash
+# This script assumes it will be launched within "/NAME/VERSION/src" dir.
+# With all sources in "src" Your Vector Linux .tlz package, slack-desc,
+# and slack-required will be found in "VERSION" dir. The extraction and
+# build will be in a temp dir created in "NAME" dir, and then removed on exit.
+# Comment out second to last line to keep this dir intact.
+#
+# This Template was compiled from the contributions of many users of the Vector
+# Linux forum at http://forum.vectorlinux.com and from tidbits collected 
+# from all over the internet. 
+#
+# Generated by sbbuilder-[% sbbversion %], written by Rodrigo Bistolfi 
+# (rbistolfi) and Raimon Grau Cuscó (Kidd) for VectorLinux.
+#
+# Please put your name below if you add some original scripting lines.
+# AUTHORS = 
+
+NAME="[% package %]"            #Enter package Name!
+VERSION=${VERSION:-"[% version %]"}      #Enter package Version!
+VER=$(echo $VERSION|sed 's/-/_/') #this fixes - in version
+VL_PACKAGER=${VL_PACKAGER:-"[% user %]"}   #Enter your Name!
+LINK=${LINK:-"[% link %]"}  #Enter URL for package here!
+
+
+#SYSTEM VARIABLES
+#----------------------------------------------------------------------------
+BUILDNUM=${BUILDNUM:-"[% build %]"}
+VL_VERSION=${VL_VERSION:-"$(ls /var/log/packages/|grep vlconfig2|cut -d "-" -f4|cut -c 2-5)"}
+BUILD=${BUILD:-"$BUILDNUM""$VL_VERSION"}
+ARCH=${ARCH:-"[% arch %]"}
+CONFIG_OPTIONS=${CONFIG_OPTIONS:-"[% configure_options %]"}
+LDFLAG_OPTIONS=${LDFLAG_OPTIONS:-"[% ldflags %]"}
+ADDRB=${ADDRB:-"[% add %]"} #Add deps that need to be added to the slack-required file here
+EXRB=${EXRB:-"[% exclude %]"} #Add deps that need to be excluded from the slack-required file here
+#----------------------------------------------------------------------------
+
+
+#SETUP PACKAGING ENVIRONMENT
+#--------------------------------------------
+CWD=$(pwd)
+cd ../
+RELEASEDIR=$(pwd)
+cd $CWD
+mkdir -p $RELEASEDIR/tmp
+TMP=$RELEASEDIR/tmp
+PKG=$TMP/package-$NAME
+#--------------------------------------------
+
+
+
+if [ $UID != 0 ]; then
+   echo "You are not authorized to run this script. Please login as root"
+   exit 1
+fi
+
+if [ ! -x /usr/bin/requiredbuilder ]; then
+   echo "Requiredbuilder not installed, or not executable."
+   exit 1
+fi
+
+if [ $VL_PACKAGER = "YOURNAME" ]; then
+   echo 'Who are you?
+   Please edit VL_PACKAGER=${VL_PACKAGER:-YOURNAME} in this script.
+   Change the word "YOURNAME" to your VectorLinux packager name.
+   You may also export VL_PACKAGER, or call this script with
+   VL_PACKAGER="YOUR NAME HERE"'
+   exit 1
+fi
+

File usr/share/sbb/template/main.template

+[% IF (type == 'noarch') %]
+[% SET arch = 'noarch' %]
+[% ELSE %]
+[% SET arch = '$(uname -m)' %] 
+[% END %]
+[% PROCESS header %]
+[% PROCESS cflags %]
+[% PROCESS pkgsetup %]
+[% SWITCH type %]
+[% CASE 'perl' %]
+[% PROCESS configure.perl %]  
+[% CASE 'python' %]
+[% PROCESS configure.python %]
+[% CASE 'cmake' %]
+[% PROCESS configure.cmake %]
+[% CASE 'custom' %]
+[% PROCESS configure.custom %]
+[% CASE %]
+[% PROCESS configure.default %]
+[% END %]
+[% PROCESS tweaks %]
+[% PROCESS description %]
+[% PROCESS makepkg %]

File usr/share/sbb/template/makepkg

+#STRIPPING
+#------------------------------------------------------------------------------------------------------------------
+cd $PKG
+echo " "
+echo "Stripping...."
+echo " "
+find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+#------------------------------------------------------------------------------------------------------------------
+
+
+#FINISH PACKAGE
+#--------------------------------------------------------------
+echo "Finding dependencies..."
+ADD="$ADDRB" EXCLUDE="$EXRB" requiredbuilder -v -y -s $RELEASEDIR $PKG
+echo "Creating package $NAME-$VERSION-$ARCH-$BUILD.tlz"
+makepkg -l y -c n $RELEASEDIR/$NAME-$VERSION-$ARCH-$BUILD.tlz
+
+cd $CWD
+echo "Cleaning up temp files..." && rm -rf $TMP
+echo "Package Complete"
+#--------------------------------------------------------------
+
+# vim: set tabstop=4 shiftwidth=4 foldmethod=marker : ##

File usr/share/sbb/template/pkgsetup

+#GET THE SOURCE
+#--------------------------------------------
+for SRC in $(echo $LINK);do
+if [ ! -f $CWD/$(basename $SRC) ]
+then
+        wget -c $SRC
+fi
+done
+#--------------------------------------------
+
+
+rm -rf $PKG
+mkdir -p $PKG
+cd $TMP
+rm -rf $NAME-$VERSION
+
+
+#EXTRACT SOURCES
+#-----------------------------------------------------
+echo "Extracting source..."
+tar xvf $CWD/$NAME-$VERSION.tar.* || exit 1
+#-----------------------------------------------------
+
+
+cd $TMP/$NAME-$VERSION
+
+# Put any Patches here
+#-----------------------------------------------------
+#patch -p1 <
+#-----------------------------------------------------
+
+
+#SET PERMISSIONS
+#-----------------------------------------
+echo "Setting permissions..."
+chown -R root:root .
+find . -perm 664 -exec chmod 644 {} \;
+find . -perm 777 -exec chmod 755 {} \;
+find . -perm 2777 -exec chmod 755 {} \;
+find . -perm 775 -exec chmod 755 {} \;
+find . -perm 2755 -exec chmod 755 {} \;
+find . -perm 774 -exec chmod 644 {} \;
+find . -perm 666 -exec chmod 644 {} \;
+find . -perm 600 -exec chmod 644 {} \;
+find . -perm 444 -exec chmod 644 {} \;
+find . -perm 400 -exec chmod 644 {} \;
+find . -perm 440 -exec chmod 644 {} \;
+find . -perm 511 -exec chmod 755 {} \;
+find . -perm 711 -exec chmod 755 {} \;
+find . -perm 555 -exec chmod 755 {} \;
+#-----------------------------------------
+

File usr/share/sbb/template/tweaks

+#######################################################################
+#Miscellenious tweaks and things outside a normal ./configure go here #
+#######################################################################
+
+
+[%- IF xdesktop %]
+[% PROCESS xdesktop %]
+[%- END %]
+
+mkdir -p $PKG/usr/doc/$NAME-$VERSION
+cp -a AUTHORS COPYING ChangeLog Credits MANIFEST README TODO \
+$PKG/usr/doc/$NAME-$VERSION
+cat $CWD/$NAME.SlackBuild > $PKG/usr/doc/$NAME-$VERSION/$NAME.SlackBuild
+
+#----------------------------------------------------------------------
+
+if [ -d $PKG/usr/share/man ] ; then
+mkdir -p $PKG/usr/man
+mv $PKG/usr/share/man/* $PKG/usr/man
+rm -rf $PKG/usr/share/man
+fi
+find $PKG/usr/man -type f -exec gzip -9 {} \;
+
+if [ -d $PKG/usr/share/info ] ; then
+mkdir -p $PKG/usr/info
+mv $PKG/usr/share/info/* $PKG/usr/info
+rm -rf $PKG/usr/share/info
+fi 
+
+find $PKG/usr/info -type f -exec gzip -9 {} \;
+mkdir -p $PKG/install
+if [ -d $PKG/usr/info ] ; then
+cat >> $PKG/install/doinst.sh << EOF
+cd usr/info
+if [ -f dir ]; then
+    rm dir
+fi
+if [ -f dir.gz ]; then
+    rm dir.gz
+fi
+for i in *.info.gz
+        do
+        install-info $i dir
+    done
+EOF
+fi
+
+mkdir -p $PKG/install
+

File usr/share/sbb/template/xdesktop

+# Menu entry - http://standards.freedesktop.org/desktop-entry-spec/latest/
+
+if test -f $CWD/$NAME.png; then
+  mkdir -p $PKG/usr/share/pixmaps
+  cp $CWD/$NAME.png $PKG/usr/share/pixmaps/$NAME.png
+fi
+
+mkdir -p $PKG/usr/share/applications
+if test -f $CWD/${NAME}.desktop; then
+  cp $CWD/$NAME.desktop $PKG/usr/share/applications/$NAME.desktop
+else
+cat > $PKG/usr/share/applications/$NAME.desktop << EOF
+[Desktop Entry]
+# Please edit as needed
+Name=$NAME
+GenericName=
+Comment=
+Exec=$NAME
+Icon=$NAME.png
+
+# AudioVideo, Development, Education, Game, Graphics, Network
+# Office, Settings, System, Utility
+Categories=
+		
+Type=Application
+Terminal=false
+Encoding=UTF-8
+
+#TryExec=
+#Path=
+#StartupWMClass=
+#NoDisplay=
+#StartupNotify=
+#MimeType=
+#OnlyShowIn=
+#NotShowIn=
+
+#Localization example
+#Name[es]=
+#Comment[es]=
+EOF
+fi