You are not logged in.
Hi!
I made a script that it lets you install software in your PC cleanly, creating a pkg.
You must configure, compile and finally install the program in the directory "pkg" and run "creapkg". An example:
./configure --prefix=/usr
make
make prefix=`pwd`/pkg install
creapkg
After you do this, the script will ask you some questions and will create a package in ./pkg.
You can find PKGBUILD in aur.
I'll wait your opinions.
Thanks and sorry for my poor english.
<B>UPDATE</B>
Version 0.3
=======
I added some options and fix some bugs. Now you can compile/install an autoconf program easyly.
[root@localhost thinkeramik-3.2.1]# creapkg -h
creapkg 0.3
usage: /usr/bin/creapkg pkgname pkgversion [OPTIONS]
OPTIONS:
-i, --install Install package after successful build
-r <release> Package release
-d <description> Package description
-u <url> Program URL
-l <license> Program license
-p <packager> Package packager
-c, --cleanbuild Clean building directory
-n, --nocolor Disable colorized output messages
-h, --help Show this help
BUILDING OPTIONS:
-a, --autoconf Build autoconf program
-w <prefix> Set program prefix
An example:
[root@localhost thinkeramik-3.2.1]# creapkg kde-theme-thinkeramik 3.2.1 -iaw /opt/kde
==> Building program with autoconf...
==> Running configure script...
==> Configure script executed successful!
==> Starting compilation...
==> Compiling...
==> Compilation successful!
==> Locating files in pkg directory...
==> Location successful!
==> Building a package for kde-theme-thinkeramik 3.2.1...
==> Generating .FILELIST...
==> Generating .PKGINFO...
==> Compressing package...
.PKGINFO
.FILELIST
opt/
opt/kde/
opt/kde/lib/
opt/kde/lib/kde3/
opt/kde/lib/kde3/kwin_thinkeramik_config.la
opt/kde/lib/kde3/kwin_thinkeramik_config.so
opt/kde/lib/kde3/kwin3_thinkeramik.la
opt/kde/lib/kde3/kwin3_thinkeramik.so
opt/kde/lib/kde3/kstyle_thinkeramik_config.la
opt/kde/lib/kde3/kstyle_thinkeramik_config.so
opt/kde/lib/kde3/plugins/
opt/kde/lib/kde3/plugins/styles/
opt/kde/lib/kde3/plugins/styles/thinkeramik.la
opt/kde/lib/kde3/plugins/styles/thinkeramik.so
opt/kde/share/
opt/kde/share/apps/
opt/kde/share/apps/kwin/
opt/kde/share/apps/kwin/thinkeramik.desktop
opt/kde/share/apps/kstyle/
opt/kde/share/apps/kstyle/themes/
opt/kde/share/apps/kstyle/themes/thinkeramik.themerc
opt/kde/share/apps/kdisplay/
opt/kde/share/apps/kdisplay/color-schemes/
opt/kde/share/apps/kdisplay/color-schemes/thinkeramik.kcsrc
opt/kde/share/apps/kdisplay/color-schemes/thinkeramik-II.kcsrc
==> The package kde-theme-thinkeramik 3.2.1-1 has been built successful (Sun Aug 14 16:32:59 2005)
==> You can find the package in /home/moret/src/thinkeramik-3.2.1/pkg/kde-theme-thinkeramik-3.2.1-1.pkg.tar.gz
==> Installing kde-theme-thinkeramik-3.2.1-1...
loading package data... done.
checking for file conflicts... done.
installing kde-theme-thinkeramik... done.
Opinions please!
ArchLinux
2.6.11.7-ARCH
KDE 3.4
ADSL 512/128
Offline
Offline
Maybe this presumably bypasses the need for a PKGBUILD though which makepkg does need.
Offline
isn't this exactly what "makepkg" does?
Not exactly, you don't need edit any file and you can build a package faster.
ArchLinux
2.6.11.7-ARCH
KDE 3.4
ADSL 512/128
Offline
It's nice, but why not try to make sth. like:
./configure --prefix /usr
make
creapkg
which then directly uses make prefix=`pwd`/pkg install. but you could overwrite the default behaviour:
creapkg use make DESTDIR=/$(pwd)/pkg
creapkg python (which then uses python setup.py --prefix=$(pwd)/pkg)
Offline
mm, it's good idea but if for example is "destdir" and not "DESTDIR" or "prefix" o another... Maybe:
creapkg -> make DESTDIR=$(pwd)/pkg
creapkg python -> python setup.py --prefix=$(pwd)/pkg
creapkg --prefix=usr/share/program -> cp -R * $(pwd)/pkg/usr/share/program
Ideas please!!
ArchLinux
2.6.11.7-ARCH
KDE 3.4
ADSL 512/128
Offline
so does this pass off the the neccessary package info to pacman's database?
Offline
I would guess then you have to do pacman -A <new_pkg_name>. But then you can also contribute it, and the PKGBUILD.
Offline
so does this pass off the the neccessary package info to pacman's database?
Yes, it's a valid package
ArchLinux
2.6.11.7-ARCH
KDE 3.4
ADSL 512/128
Offline
Penguin wrote:so does this pass off the the neccessary package info to pacman's database?
Yes, it's a valid package
Really? It doesn't take into account dependencies, install files, etc.
Offline
Yes, this method is for install programs easyly, so the dependences and others are unnecessary. However, I can add the option in order to we can add dependences and other options:
creapkg --dep=bash,python
What do you think?
ArchLinux
2.6.11.7-ARCH
KDE 3.4
ADSL 512/128
Offline
I think that it is already included in Arch... Hey, what's so hard about writing a PKGBUILD? Sorry if I sound rude, I don't intend to; but I'm afraid this idea is a tad unnecessary, no?
Offline
it's nice to have a choice, so keep up the good work, moret.
Offline
Your tool is like Slack's checkinstall...
It would be nice to install quickly a package and see if it is worth writing a PKGBUILD for it...
Nice idea.
Offline
Would be nice if you could somehow make it like checkinstall.
Some PKGBUILDs: http://members.lycos.co.uk/sweiss3
Offline
Would be nice if you could somehow make it like checkinstall.
a) good work moret - I didn't get the difference at first, but this makes alot of sense, so thanks
b) checkinstall is waaaay too complicated - for the install, it hooks into the standard C library calls to move and copy files - that's the only way to know for sure what it's doing.
Offline
I created a simple clone of creapkg for python packages. most of the code is just ripped from creapkg, but it uses a temporary directory, so there can be a pkg directory.
For the install it just calls the setup.py script with build and then install. this is completly sufficient as most packages seem to be installable with distutils.
usgae:
pypkg $pkgname $pkgver [$pkgdesc] [$pkgver]
example
[17:41] police:pypkg tar xzf linda-0.5.1.tar.gz
[17:41] police:pypkg cd linda-0.5.1
[17:41] police:linda-0.5.1 ../pypkg pylinda 0.5.1
::creating a package for pylinda (0.5.1)
::creating a temporary package directory
::running the python setup
::generating the filelist
::generating the package info
::compressing the package
::removing package directory
[17:41] police:linda-0.5.1 sudo pacman -A pylinda-0.5.1-1.pkg.tar.gz
loading package data... done.
checking for file conflicts... done.
installing pylinda... done.
[17:42] police:linda-0.5.1
pypkg:
#!/bin/bash
# check arguments:
if [ $# -lt 2 ]
then
echo "usage: $0 pkgname version"
exit
fi
pkgname="$1"
pkgver="$2"
if [ $# -ge 3 ]
then
pkgdesc="$3"
else
pkgdesc="autogenerated python package"
fi
if [ $# -ge 4 ]
then
pkgrel=$4
else
pkgrel=1
fi
startdir=$(pwd)
builddate=`LC_ALL= ; LANG= ; date -u "+%a %b %e %H:%M:%S %Y"`
version=0.1
echo "::creating a package for $pkgname ($pkgver)"
echo "::creating a temporary package directory"
pkg=$(mktemp -d -p "$startdir")
echo "::running the python setup"
(
python setup.py build && python setup.py install --prefix="$pkg"
) > /dev/null || (echo " ::error build failed"; exit)
echo "::generating the filelist"
cd $pkg
tar cvf /dev/null * | sort | >.FILELIST
echo "::generating the package info"
touch .PKGINFO
echo "# Generated by pypkg $version" >> .PKGINFO
echo "# $builddate" >> .PKGINFO
echo "pkgname = $pkgname" >> .PKGINFO
echo "pkgver = ${pkgver}-${pkgrel}" >> .PKGINFO
echo "pkgdesc = $pkgdesc" >> .PKGINFO
echo "builddate = $builddate" >> .PKGINFO
size=$(du -cb $pkg | tail -n 1 | awk '{print $1}')
echo "size = $size" >> .PKGINFO
if [ "$CARCH" != "" ]; then
echo "arch = $CARCH" >> .PKGINFO
fi
echo "::compressing the package"
tar czf "$startdir/$pkgname-$pkgver-$pkgrel.pkg.tar.gz" .PKGINFO .FILELIST *
echo "::removing package directory"
cd $startdir
rm -r $pkg
Offline
Yes, it's like checkinstall, but the Arch packages are easy to build, so with a simple script we can build one. This script is for installing programs quickly, so the dependences, I think, are unnecessary, like conflicts, source, md5sum...
Now, the script is very simple and I would want to know what ideas do you have to apply to script
ArchLinux
2.6.11.7-ARCH
KDE 3.4
ADSL 512/128
Offline
Nice script! I think we must create one that builds package of all kind of program! I've sent you a pm
ArchLinux
2.6.11.7-ARCH
KDE 3.4
ADSL 512/128
Offline
New version! I want opinions!
http://aur.archlinux.org/packages.php?d … =1&ID=1727
ArchLinux
2.6.11.7-ARCH
KDE 3.4
ADSL 512/128
Offline
Nice script! I think we must create one that builds package of all kind of program! I've sent you a pm
Hi moret. This is pretty much what bpkg does. It will download a tarball, extract it, try to figure out what mechanism to use to build a package, build it, then create and install an Arch package. It uses installwatch (from checkinstall) to track the installation and handles dependencies and configuration files automatically. An older version (0.2, current is 0.3) is in the AUR.
There are a few other similar programs, such as checkinstall, but none support Arch except yours and mine!
Offline
Oohh, it's seems great! But my script was done in order to create packages quickly, without specify URL, without source... It's nice to have alternatives but, maybe, I'll add some functions extras like autocompile, I'll see... hehe
Bye!
ArchLinux
2.6.11.7-ARCH
KDE 3.4
ADSL 512/128
Offline
I was working with bpkg and I think it's too simple, it don't detect any build method :S and I think it only works with autoconf... Too restricted...
ArchLinux
2.6.11.7-ARCH
KDE 3.4
ADSL 512/128
Offline
I did update (and rename) my script. it's now allmost feature complete, but I need a nice error function (printing in red) and the normal make install command (I'm too lazy to look it up ).
You now can build a package of python programms or just package a specific directory (usefull for scripts).
Of course I'am not responsible for any damage done by this script, bla, bla, bla.
examples:
the installation of autopkg as a package
[11:26] police:pypkg ls
autopkg
[11:26] police:pypkg mkdir -p pkg/usr/bin
[11:26] police:pypkg cp autopkg pkg/usr/bin/
[11:26] police:pypkg autopkg autopkg 0.2 "a package creating tool for archlinux" --pkg-dir pkg/ --install
==> ::running the setup
==> warning: no build command issued
==> ::generating the filelist
==> ::trying to retrive information about the package
==> ::generating the package info
==> ::compressing the package
==> installing package
loading package data... done.
checking for file conflicts... done.
upgrading autopkg... done.
==> ::finished
[11:27] police:pypkg
creating a package for pylinda
[11:30] police:linda ls
linda-0.5.1.tar.gz
[11:30] police:linda tar xzf linda-0.5.1.tar.gz
[11:30] police:linda cd linda-0.5.1
[11:30] police:linda-0.5.1 autopkg pylinda 0.5.1 "an implementation of a linda system in python" --python
==> ::creating a temporary directory
==> ::running the setup
==> ::generating the filelist
==> ::trying to retrive information about the package
==> ::generating the package info
==> ::compressing the package
==> ::removing package directory
==> ::finished
[11:31] police:linda-0.5.1
the script (autopkg)
#!/bin/bash
# 12.08.05 8:00 am created file
[ -f /etc/makepkg.conf ] && source /etc/makepkg.conf
# infos about this script
NAME="pypkg"
VERSION="0.2"
# global vars - w/ defaults
pkg="" # the package directory
pkgname="" # the name of the package
pkgver="" # the version of the package
pkgdesc="" # the description of the package
pkgrel="1" # the package release
builddate=`LC_ALL= ; LANG= ; date -u "+%a %b %e %H:%M:%S %Y"`
startdir=$(pwd) # the directory the build has started
allready_installed="n" # wether the package was allready installed
BUILD=""
INSTALL="n"
NO_TMP="n"
# some functions
function msg() {
#if [ "$USE_COLOR" = "Y" -o "$USE_COLOR" = "y" ]; then
# echo -e "33[1;32m==>33[1;0m 33[1;1m$*33[1;0m" >&2
#else
echo "==> $@" >&2
#fi
}
function gen_filelist(){
# 12.8.05 8:07 am created function
# args: $1 target file
msg "::generating the filelist"
cd $pkg
tar cvf /dev/null * | sort | >.FILELIST
}
function create_tmp_dir(){
# 12.8.05 8:07 am created function
if [ $NO_TMP == "y" ]; then return; fi
msg "::creating a temporary directory"
pkg=$(mktemp -d -p "$startdir")
}
function run_setup(){
# 12.8.05 8:07 am created function
msg "::running the setup"
cd $startdir
if [ "$BUILD" == "python" ]
then
(
python setup.py install --prefix="$pkg/usr"
) > /dev/null || (echo " ::error build failed"; exit -1)
elif [ "$BUILD" == "make" ]
then
msg "::currently unsported";
remove_tmp_dir
exit
#(
#make install
#) > /dev/null || (echo "::error build failed"; exit -1)
elif [ "$BUILD" == "use" ]
then
($USE) > /dev/null || (echo "::error build failed"; exit -1)
else
msg "warning: no build command issued"
fi
}
function gen_pkginfo(){
# 12.08.05 8:07 am created function
msg "::generating the package info"
cd $pkg
touch .PKGINFO
size=$(du -cb $pkg | tail -n 1 | awk '{print $1}')
echo "size = $size" >> .PKGINFO
echo "# Generated by pypkg $version" >> .PKGINFO
echo "# $builddate" >> .PKGINFO
echo "pkgname = $pkgname" >> .PKGINFO
echo "pkgver = ${pkgver}-${pkgrel}" >> .PKGINFO
echo "pkgdesc = $pkgdesc" >> .PKGINFO
echo "builddate = $builddate" >> .PKGINFO
if [ "$CARCH" != "" ]; then
echo "arch = $CARCH" >> .PKGINFO
fi
}
function compress_pkg(){
# 12.08.05 8:07 am created function
msg "::compressing the package"
cd $pkg
pkg_file="$startdir/$pkgname-$pkgver-$pkgrel.pkg.tar.gz"
tar czf $pkg_file .PKGINFO .FILELIST *
}
function remove_tmp_dir(){
# 12.08.05 8:07 am created function
if [ $NO_TMP == "y" ]; then return; fi
msg "::removing package directory"
cd $startdir
rm -r $pkg
}
function __get_info(){
# 12.08.05 8:30 am created function
pacman -Qi $pkgname | grep $1 | sed 's/.*:s*/(w.*)/1/'
}
function get_pkginfo(){
# 12.08.05 8:30 am created function
# if the package is allready installed, retrive it's information
msg "::trying to retrive information about the package"
(pacman -Qi $pkgname 2>/dev/null > /dev/null && installed=y) || installed=n
if [ -z "$pkgdesc" ]
then
if [ "$installed" == "y" ]
then
pkgdesc=$(__get_info 'Description')
else
pkgdesc="Autogenerated by autopkg"
fi
fi
if [ -z "$pkgrel" ]
then
if [ "$installed" == "y" ]
then
pkgrel=$(__get_info 'Version' | sed 's/-(d*)/1/')
else
pkgrel=1
fi
fi
}
function install_pkg(){
# 12.08.05 09:20 created function
if [ $INSTALL != 'y' ] || [ -z "$pkg_file" ]; then return; fi
msg "installing package"
sudo pacman -U $pkg_file
}
function mk_abs_path(){
if [ ${1:0:1} == "/" ]
then
echo $1
else
echo $(pwd)/$1
fi
}
# parse the options
function usage(){
# 12.08.05 08:50 created function
echo "usage: $0 pkgname pkgver [pkgdesc] [pkgrel] OPTIONS"
echo "OPTIONS: "
echo "--python installs the programm via distutils"
echo "--make installs the programm via make"
echo "--use CMD installs the programm via CMD"
echo " (has to be the last option)"
echo "--pkg-dir DIR uses the directory pkg for package installation"
echo " (else a temporary director is used)"
echo "--install directly installs the programm via pacman (needs sudo)"
echo "--help prints this message"
}
function set_non_build(){
# 12.08.05 08:40 created function
# usage set_non_build option arg
if [ -z "$1" ] || [ $# -lt 2 ]
then
return -1
fi
if [ "${1:0:2}" != "--" ]
then
eval "$2="$1""
return 0
fi
return -1
}
#if [ $# -lt 2 ] || [ -z "$(echo $@ | grep -- --help)" ]
#then
# usage; exit
#fi
pkgname=$1
pkgver=$2
shift 2
set_non_build "$1" "pkgdesc" && shift
set_non_build "$1" "pkgrel" && shift
while [ $# -ne 0 ]
do
case $1 in
--python) BUILD="python";;
--make) BUILD="make";;
--use) BUILD="use";shift;USE="$@";exit;;
--pkg-dir) NO_TMP="y";shift;pkg=$(mk_abs_path "$1");;
--install) INSTALL="y";;
*) usage; exit;;
esac
shift
done
create_tmp_dir
run_setup || exit
gen_filelist
get_pkginfo
gen_pkginfo
compress_pkg
remove_tmp_dir
install_pkg
msg "::finished"
Offline
New version! Read first post!
ArchLinux
2.6.11.7-ARCH
KDE 3.4
ADSL 512/128
Offline