You are not logged in.
Hi, This is my first serious attempt to make a PKGBUILD, and I would like if someone can review it and make comments, bugfixes, and all kind of feedback you want. The package is nTPV, a POS (Point Of Sale) system for pubs, discos, restaurants, .... I think the program is very nice but the source tarball is not easy to build (It's mainly focused on debian). Right now the program is in spanish but the author says that for 1.2 final version it will be released in english also.
I have had to make many workarounds to make the program compile and I don't know if the process can be enhanced before trying it to be acce pted in the AUR. I Hope soon I would put a link to a binary package and a simple instruccions on how to build the complete POS system (database & customizations included).
Unfortunaly, this package depends on other one (gdchart) that hasn't an official archlinux package. So I submit two PKGBUILDS for your review.
Many thanx.
pkgname=ntpv
pkgver=1.2rc1
pkgrel=3
pkgdesc="nTPV POS System & libs"
url="http://www.napsis.com"
license=""
depends=('xorg' 'qt' 'kdelibs' 'libxml2' 'gd' 'gdchart' 'sudo' 'nmap' 'iproute')
makedepends=()
conflicts=()
replaces=()
backup=()
install=ntpv.install
source=(http://switch.dl.sourceforge.net/sourceforge/ntpv/ntpv_bundle-1.2-rc1.tar.gz)
md5sums=('0712a36f80c72c5b6c6011170683eac7')
dirname=ntpv_bundle-1.2rc1
build() {
# 1) Libbslxml
cd $startdir/src/$dirname/libbslxml
make INCLUDES+="-I/usr/include/libxml2 -I/opt/qt/include" LDFLAGS+="-L/opt/qt/lib" || return 1
mkdir -p $startdir/pkg/usr/lib $startdir/pkg/usr/include/libbslxml
cp libbslxml.so.0.2.1 $startdir/pkg/usr/lib
cp *.h $startdir/pkg/usr/include/libbslxml
cd $startdir/pkg/usr/lib
ln -s libbslxml.so.0.2.1 libbslxml.so.0.2
ln -s libbslxml.so.0.2.1 libbslxml.so
# 2) Libqutexr
cd $startdir/src/$dirname/libqutexr/src
qmake -makefile || return 1
make LDFLAGS+="-L$stardir/pkg/usr/lib" || return 1
mkdir -p $startdir/pkg/usr/include/libqutexr
cp *.h $startdir/pkg/usr/include/libqutexr
cp libqutexr.a $startdir/pkg/usr/lib
chmod 755 $startdir/pkg/usr/lib/libqutexr.a
# 3) ntpv-libs base
cd $startdir/src/$dirname/ntpvlibs
make -f Makefile-base INCLUDES+="-I$startdir/pkg/usr/include -I/opt/qt/include" LDFLAGS+="-L$startdir/pkg/usr/lib -lsql -lpsql" || return 1
mkdir -p $startdir/pkg/usr/include/liblinuxbar
cp -f *.h $startdir/pkg//usr/include/liblinuxbar/
cp -f liblinuxbar.so.0.1.1 $startdir/pkg/usr/lib/
cd $startdir/pkg/usr/lib
ln -s liblinuxbar.so.0.1.1 liblinuxbar.so.0.1
ln -s liblinuxbar.so.0.1.1 liblinuxbar.so.0
ln -s liblinuxbar.so.0.1.1 liblinuxbar.so
# 4) ntpv-libs widgets
cd $startdir/src/$dirname/ntpvlibs
sed -i -e "s:// ::" floatkeyboardbox.cpp
sed -i -e "s:/usr/bin/moc:/opt/qt/bin/moc:" Makefile-widgets
sed -i -e "s/-shared/-shared $(LDFLAGS)/ " Makefile-widgets
make -f Makefile-widgets INCLUDES+="-I$startdir/pkg/usr/include -I/opt/qt/include -I/opt/kde/include" LDFLAGS+="-L$startdir/pkg/usr/lib -L/opt/qt/lib" || return 1
mkdir -p $startdir/pkg/usr/include/liblinuxbarwidgets
cp -f *.h $startdir/pkg/usr/include/liblinuxbarwidgets/
cp -f liblinuxbarwidgets.so.0.0.4 $startdir/pkg/usr/lib/
cd $startdir/pkg/usr/lib
ln -s liblinuxbarwidgets.so.0.0.4 liblinuxbarwidgets.so.0.1
ln -s liblinuxbarwidgets.so.0.0.4 liblinuxbarwidgets.so.0
ln -s liblinuxbarwidgets.so.0.0.4 liblinuxbarwidgets.so
# 5) xmlmanage
cd $startdir/src/$dirname/xmlmanage-0.1
./configure
make INCLUDES+="-I$startdir/pkg/usr/include -I/opt/qt/include" LDFLAGS+="-L$startdir/pkg/usr/lib -L/opt/qt/lib" || return 1
mkdir -p $startdir/pkg/usr/bin
cp xmlmanage/xmlmanage $startdir/pkg/usr/bin/
# 6) dcopprinter
cd $startdir/src/$dirname/dcopprinter-0.3
grep -Rl --include "*.cpp" "namespace.*{}.*;" . | xargs sed -i -e "s/^namespace.*{}.*;/namespace std {}/"
./configure
sed -i -e "s:/usr/lib/libqutexr.a:$startdir/pkg/usr/lib/libqutexr.a:" dcopprinter/Makefile
sed -i -e "s:/usr/bin/dcopidl:/opt/kde/bin/dcopidl:" dcopprinter/Makefile
sed -i -e "s:/usr/bin/dcopudl2cpp:/opt/kde/bin/dcopidl2cpp:" dcopprinter/Makefile
make INCLUDES+="-I$startdir/pkg/usr/include -I/opt/qt/include -I/opt/kde/include" LDFLAGS+="-L$startdir/pkg/usr/lib -L/opt/qt/lib -L/opt/kde/lib" || return 1
cp dcopprinter/dcopprinter $startdir/pkg/usr/bin/
mkdir -p $startdir/pkg/etc/ntpv
cp -r etc_linuxbar/* $startdir/pkg/etc/ntpv
mkdir -p $startdir/pkg/usr/share/dcopprinter
cp -r usr_dcopprinter/* $startdir/pkg/usr/share/dcopprinter/
#7) ntpv
cd $startdir/src/$dirname/ntpv-1.2
sed -i -e "s/" "/" > "/" linuxbar/barcore/openbox.cpp # BUG FIX
sed -i -e "s/fewa/ntpv/" etc_ntpv/bar_database.xml
sed -i -e "s/192.168.2.201/localhost/" etc_ntpv/dcopprinter_config.xml
sed -i -e "s:/sbin/sync:/bin/sync:" linuxbar/menusystem/menus/bslexitactionswidget.cpp
./configure
grep -Rl --include "*.cpp" "namespace.*{}.*;" . | xargs sed -i -e "s/^namespace.*{}.*;/namespace std {}/"
make INCLUDES+="-I$startdir/pkg/usr/include -I/opt/qt/include -I/opt/kde/include -I/usr/include/gdchart" LDFLAGS+="-L$startdir/pkg/usr/lib" || return 1
cp linuxbar/linuxbar $startdir/pkg/usr/bin/ntpv
cp -r etc_ntpv/* $startdir/pkg/etc/ntpv/
mkdir -p $startdir/pkg/usr/share/ntpv
cp -r usr_share_ntpv/* $startdir/pkg/usr/share/ntpv
#8) ntpvbo
cd $startdir/src/$dirname/ntpvbo-1.2
sed -i -e "s:*proc << "sudo";://*proc << "sudo";:" linuxbarbackoffice/menusystem/database/bslddbbwidget.cpp
./configure
grep -Rl --include "*.cpp" --include "*.h" "/usr/include/" . | xargs sed -i -e "s:/usr/include/::"
grep -Rl --include "*.cpp" "namespace.*{}.*;" . | xargs sed -i -e "s/^namespace.*{}.*;/namespace std {}/"
make INCLUDES+="-I$startdir/pkg/usr/include -I/opt/qt/include -I/opt/kde/include" LDFLAGS+="-L$startdir/pkg/usr/lib" || return 1
cp linuxbarbackoffice/linuxbarbackoffice $startdir/pkg/usr/bin/ntpv_backoffice
mkdir -p $startdir/pkg/etc/ntpv_backoffice
cp -r etc_ntpv_backoffice/* $startdir/pkg/etc/ntpv_backoffice/
mkdir -p $startdir/pkg/usr/share/ntpv_backoffice
cp -r usr_share_linuxbarbackoffice/* $startdir/pkg/usr/share/ntpv_backoffice/
}
the ntpv.install file
create_group() {
grupo_ntpv=$(cat /etc/group |sed s/:/' '/ | awk '$1~/ntpv/ {print $1}' |wc -l)
ADDGRP=$(which addgroup 2>/dev/null)
if [ -z $ADDGRP ]
then
ADDGRP=$(which groupadd 2>/dev/null)
fi
if [ $grupo_ntpv -eq 0 ]
then
$ADDGRP ntpv
fi
}
check_perms() {
if [ -d $dir_ntpv ]
then
echo -ne "checking group and permissions of /etc/ntpv"
chgrp -R ntpv $dir_ntpv
chgrp -R ntpv ${dir_ntpv}/*
chmod g+rwx $dir_ntpv
find ${dir_ntpv}/ -type d | xargs chmod g+rwx
find ${dir_ntpv}/ -type f | xargs chmod g+rw
echo -e " ttt[DONE]"
fi
if [ -d $dir_ntpv_backoffice ]
then
echo -ne "checking group and permissions of /etc/ntpv_backoffice"
chgrp -R ntpv $dir_ntpv_backoffice
chgrp -R ntpv ${dir_ntpv_backoffice}/*
chmod g+rwx $dir_ntpv_backoffice
find ${dir_ntpv_backoffice}/ -type d | xargs chmod g+rwx
find ${dir_ntpv_backoffice}/ -type f | xargs chmod g+rw
echo -e " tt[DONE]"
fi
}
# arg 1: the new package version
post_install() {
create_group
check_perms
}
# arg 1: the new package version
# arg 2: the old package version
post_upgrade() {
check_perms
}
dir_ntpv=/etc/ntpv
dir_ntpv_backoffice=/etc/ntpv_backoffice
op=$1
shift
$op $*
and the other PKGBUILD
pkgname=gdchart
pkgver=0.11.5dev
pkgrel=1
pkgdesc="Create charts and graphs in PNG, GIF and WBMP format"
url="http://www.fred.net/brv/chart/"
license=""
depends=('gd')
makedepends=()
conflicts=()
replaces=()
backup=()
install=
source=(http://www.fred.net/brv/chart/$pkgname$pkgver.tar.gz)
md5sums=('a4af7bc927d8b88934da56fce10a7a3c')
build() {
cd $startdir/src/$pkgname$pkgver
sed -i -e "s:local/::" Makefile
make || return 1
mkdir -p $startdir/pkg/usr/include
cp *.h $startdir/pkg/usr/include/
mkdir -p $startdir/pkg/usr/lib
cp libgdc.a $startdir/pkg/usr/lib
}
Offline