You are not logged in.
I'm trying to build the package to stoq, an open source commerce and industry manager from Brasil, but I can figure out how to put it on AUR, or test it if its ok.
The PKGBUILDs i made so far are this both:
_pkgname=stoqdrivers
pkgname=stoqdrivers-git
pkgver=1.9
pkgrel=1
pkgdesc='Brasilian Open Source commercial and industrial manager drivers. Git mirror'
arch=('any')
url='http://stoq.com.br/'
license=('GPL2')
depends=( 'kiwi'
'python-pyserial'
'python'
'pythob-zope-interface')
makedepends=('git')
conflicts=("$_pkgname")
provides=("$_pkgname")
replaces=("$_pkgname")
source=('git+https://github.com/stoq/stoqdrivers.git')
sha256sums=('SKIP')
pkgver() {
cd $_pkgname
git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}
prepare() {
mkdir -p $_pkgname
}
build() {
cd $_pkgname
./configure --prefix=/usr
make
}
package() {
cd $_pkgname
make DESTDIR="$pkgdir" install
}and this one:
_pkgname=stoq
pkgname=stoq-git
pkgver=1.9
pkgrel=1
pkgdesc='Brasilian Open Source commercial and industrial manager. Git mirror'
arch=('any')
url='http://stoq.com.br/'
license=('GPL2')
depends=( 'gtk2'
'libgudev'
'kiwi'
'python-mako'
'postgresql'
'pygtk'
'python-pyserial'
'python'
'python-cairo'
'dateutil'
'poppler-git'
'python-twisted'
# 'python xlwt'
'python-pillow'
'pywebkitgtk'
'python-psycopg2'
'python-reportlab'
'stoqdrivers'
'storm'
'pythob-zope-interface'
'pythob-weasyprint'
makedepends=('git')
conflicts=("$_pkgname")
provides=("$_pkgname")
replaces=("$_pkgname")
source=('git+https://github.com/stoq/stoq.git')
sha256sums=('SKIP')
pkgver() {
cd $_pkgname
git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}
prepare() {
mkdir -p $_pkgname
}
build() {
cd $_pkgname
./configure --prefix=/usr
make
}
package() {
cd $_pkgname
make DESTDIR="$pkgdir" install
}but I really dont know if im doing right the pkgver() prepare() build() package() part, and reading the wiki i didnt figured out how to upload it to AUR.
Could someone give me some help?
Offline
Instead of _pkgname i'd use a a source line like this :
source=('stoqdrivers::git+https://github.com/stoq/stoqdrivers.git')With such a sourceline , makepkg should create the necessary folder and you can remove the prepare function.
Stoq looks like a python package, check https://wiki.archlinux.org/index.php/Py … guidelines for other needed changes.
After you've made those changes, run namcap PKGBUILD to see if it detects problems in the package build.
Post the updated PKGBUILDs (and if necessary namcap outputs).
We'll deal with uploading to AUR later.
Last edited by Lone_Wolf (2015-08-26 21:23:54)
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
Thanks for the reply
The new PKGBUILDs are:
# Maintainer: RicardoScar <ricardoscar@gmail.com>
pkgname=stoqdrivers-git
pkgver=1.9
pkgrel=1
pkgdesc='Brasilian Open Source commercial and industrial manager drivers. Git mirror'
arch=('any')
url='http://stoq.com.br/'
license=('GPL2')
depends=( 'kiwi'
'python-pyserial'
'python'
'python-zope-interface')
makedepends=('git')
conflicts=("$_pkgname")
provides=("$_pkgname")
replaces=("$_pkgname")
source=('stoqdrivers::git+https://github.com/stoq/stoqdrivers.git')
sha256sums=('SKIP')
pkgver() {
cd $_pkgname
git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}
#build() {
# cd $_pkgname
# ./configure --prefix=/usr
# make
#}
package() {
cd "$srcdir/$pkgname-$pkgver"
python setup.py install --root="$pkgdir/" --optimize=1
}
# vim:set ts=2 sw=2 et:# Maintainer: RicardoScar <ricardoscar@gmail.com>
pkgname=stoq-git
pkgver=1.9
pkgrel=1
pkgdesc='Brasilian Open Source commercial and industrial manager. Git mirror'
arch=('any')
url='http://stoq.com.br/'
license=('GPL2')
depends=( 'gtk2'
'libgudev'
'kiwi'
'python-mako'
'postgresql'
'pygtk'
'python-pyserial'
'python'
'python-cairo'
'dateutil'
'poppler-git'
'python-twisted'
# 'python xlwt'
'python-pillow'
'pywebkitgtk'
'python-psycopg2'
'python-reportlab'
'stoqdrivers'
'storm'
'pythob-zope-interface'
'pythob-weasyprint')
makedepends=('git')
conflicts=("$_pkgname")
provides=("$_pkgname")
replaces=("$_pkgname")
source=('stoq::git+https://github.com/stoq/stoq.git')
sha256sums=('SKIP')
pkgver() {
cd $_pkgname
git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}
#build() {
# cd $_pkgname
# ./configure --prefix=/usr
# make
#}
package() {
cd "$srcdir/$pkgname-$pkgver"
python setup.py install --root="$pkgdir/" --optimize=1
}
# vim:set ts=2 sw=2 et:The namcap outputs are clean.
When I follow the wiki trying to add it to AUR, I get these:
xxxx@xxxx:~/Dropbox/STOQ$ git clone ssh://aur@aur.archlinux.org/stoq-git.gitClonar em 'stoq-git'...
warning: You appear to have cloned an empty repository.
Checking connectivity... terminado.
xxxx@xxxx:~/Dropbox/STOQ$ mksrcinfo
xxxx@xxxx:~/Dropbox/STOQ$ git add PKGBUILD .SRCINFO
fatal: Not a git repository (or any parent up to mount point /mnt/compart)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).OBS.: '/mnt/compart' is the partition where I share documents with my other operational system.
Offline
The packages are not ready yet for upload, as they need some more changes and testing.
At the bottom of this post, i'll explain about the error you get when trying to upload.
stoq-git depends on stoqdriver-git , so let's focus on stoqdriver-git first.
- A while ago AUR (i think it was AUR 3.0 ) got proper support for split packages .
Afaik every AUR pacakge now needs a pkgbase entry.
above the pkgname= line add pkgbase=stoqdriver-git
- _pgkname
some people try to make PKGBUILDs as generic as possible, so they can reuse them for other packages easily.
Others (like me) focous on easy readability for humans and tend to treat each PKGBUILD as a unique project.
Both ways work and have their own advantages/.disadvantages , so which one you choose is a personal preference.
If you prefer generic PKGBUILDs, add back a line _pkgname=stoqdriver just below the pkgname= line.
In case you prefer uniqueness/readability, replace _pkgname with the actual pkgname everywhere in the PKGBUILD.
- License
Look into the file COPYING here : https://github.com/stoq/stoqdrivers .
Stoqdrivers is not GPL2 licensed , but LGPL 2.1 .
the correct entry in the PKGBUILD is : license=('LGPL2.1') .
- quoting variables
using $some_name vaiables in bash can lead to problems with paths that have spaces in them.
The most used solution for this is to put double quotes around the var, so bash will expand the variable value before using it.
replace every occurence of $some_name in the PKGBUILD with "$some_name"
EDIT
using "${some_variable_name}" is even better i think.
- Once you made the above changes, run namcap PKGBUILD again. it will prob give 1 error (missing package_xxxx ) .
Personally i ignore that error unless i'm working on a split package.
- run makepkg
solve any build errors
look thoroughly at pkgdir contents to see what is put there and try to find weird things (will get easier with experience).
run namcap on the created *.pkg.tar.xz and post the output.
--------------------------------------------
Git has it's own way of doing things.
First you need to decide whether you want to separate the folders where you build packages from the folders that make up your local git repo.
Separating keeps things clean and git repo configuration simpler, but requires some manual copying.
I'll describe the simpler way with separate build and git repo folders for now.
Create a folder, say ~/Aurbuild .
under that folder , create stoqdrivers-git folder.
put the PKGBUILD in the ~/Aurbuild/stoqdriver-git folder .
Create a folder to hold your local git repos , say ~/Aur_repo .
to clone a package , cd into ~/Aur_repo and run the git clone command , git clone ssh://aur@aur.archlinux.org/stoqdriver-git.git
run ls , you'll see a folder with the same name as the package that holds the local copy of the files (if any) in aur stoqdriver-git repo .
CD to your package build folder, run mksrcinfo .
copy .SRCINFO , PKGBUILD and any other needed files to the ~/Aur-repo/stoqdriver-git folder.
cd to ~/Aur-repo/stoqdriver-git , run the git add / git -am , git push commands from that folder.
Last edited by Lone_Wolf (2015-08-27 12:12:11)
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
# Maintainer: RicardoScar <ricardoscar@gmail.com>
pkgbase=stoqdrivers-git
pkgname=stoqdrivers-git
pkgver=1.9
pkgrel=1
pkgdesc='Brasilian Open Source commercial and industrial manager drivers. Git mirror'
arch=('any')
url='http://stoq.com.br/'
license=('LGPL2.1')
depends=( 'kiwi'
'python-pyserial'
'python'
'python-zope-interface')
makedepends=('git')
conflicts=("$stoqdrivers")
provides=("$stoqdrivers")
replaces=("$stoqdrivers")
source=('stoqdrivers::git+https://github.com/stoq/stoqdrivers.git')
sha256sums=('SKIP')
pkgver() {
cd "$stoqdrivers"
git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}
#build() {
# cd $stoqdrivers
# ./configure --prefix=/usr
# make
#}
package() {
cd "$srcdir/$stoqdrivers"
python setup.py install --root="$pkgdir/" --optimize=1
}
# vim:set ts=2 sw=2 et:output from makepkg:
==> Criando o pacote: stoqdrivers-git 1.9-1 (Qui Ago 27 18:38:33 BRT 2015)
==> Verificando as dependências de tempo de execução...
==> Verificando as dependências de tempo de compilação...
==> Obtendo fontes...
-> Atualizando repositório stoqdrivers do tipo git...
Baixando origin
==> Validando arquivos fonte com sha256sums...
stoqdrivers ... Ignorada
==> Extraindo fontes...
-> Criando cópia de trabalho do repositório stoqdrivers do tipo git...
Mudado para a nova rama 'makepkg'
==> Iniciando pkgver()...
fatal: Not a git repository (or any parent up to mount point /mnt/compart)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
==> Removendo diretório $pkgdir/ existente...
==> Entrando no ambiente fakeroot...
==> Iniciando package()...
python: can't open file 'setup.py': [Errno 2] No such file or directory
==> ERRO: Uma falha ocorreu em package().
Abortando...The translation world be something like "an error happened in package() aborting...
The output of namcap is:
PKGBUILD (stoqdrivers-git) E: Child package stoqdrivers-git does not have a valid package() function
Offline
Your "cd" commands are wrong.
Offline
Place 'set -u' and 'set +u' at the beginning and end of the entire PKGBUILD and each function. Then watch bash smash through your easy bugs like a bull in a china shop. makepkg does not tolerate set -u so it must be turned off each time control passes back in. Example:
set -u
pkgbase=stoqdrivers-git
...
pkgver() {
set -u
cd "$stoqdrivers"
git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
set +u
}
...
set +u
# vim:set ts=2 sw=2 et:Set your provides to this
provides=("${pkgbase%-git}=${pkgver%.r*}")This should result in a provides=('stoqdrivers=1.9'). Without an explicit version, depends=('stoqdrivers') will work. depends=('stoqdrivers>=2.0') won't.
Your descriptions aren't very expressive. I can't think of any subject search that would let me find that. I'd need to know the name already. The Google Translation of the home page isn't much more descriptive. Sometimes you need to jazz the description up so it can be found.
Offline
Thanks for the feedback guys, Im learning a lot, even if it is being really hard to me.
I fixed it changing the package () function to (the cd command was wrong):
package() {
cd "$srcdir/stoqdrivers"
python setup.py install --root="$pkgdir/" --optimize=1
}but it fails at the package () part:
Traceback (most recent call last):
File "setup.py", line 6, in <module>
from kiwi.dist import setup, listpackages, listfiles
ImportError: No module named 'kiwi'I have already installed the kiwi package from the official repositories (kiwi-1.9.29-4), but at github it says I need "Kiwi 1.9.26.2". Will I need to install an older version of the kiwi package?
Offline
Thanks for the feedback guys, Im learning a lot, even if it is being really hard to me.
Glad to hear that, you didn't exactly pick an easy package for your first PKGBUILD.
I have already installed the kiwi package from the official repositories (kiwi-1.9.29-4), but at github it says I need "Kiwi 1.9.26.2". Will I need to install an older version of the kiwi package?
I doubt it's the version of kiwi that's the problem, but sofar we haven't looked at needed dependencies .
Requirements
------------* Python 2.4 (http://www.python.org/)
* Kiwi 1.9.26.2 (http://www.async.com.br/projects/kiwi/)
* pySerial 1.3 (http://pyserial.sourceforge.net/)
* Zope interfaces 3.5.2 (http://www.zope.org/Products/ZopeInterface/)
Arch has python3 as default, and stoqdriver is intended to work with python2 .
I suggest you add python2, kiwi, pyserial , and python2-zope-interface as dependencies .
python2 & kiwi shoud also be makedepends, whether pyserial & python2-zope-interface are also needed at buildtime is unclear for now.
in the package() function , replace python with python2 then try running makepkg again.
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
Thank you again
Turned out namcap said me that all the dependencies were 'make dependencies', so I changed the PKGBUILD, with the changes you said me.
Now there is this output of namcap, im putting only the beguining here, since it appers to be saying the same thing for all the archives of the package:
xxx@xxx:~/Dropbox/stoqdrivers$ namcap stoqdrivers-git-1.9-1-any.pkg.tar.xz
stoqdrivers-git W: File (.PKGINFO) has the world writable bit set.
stoqdrivers-git W: File (.MTREE) has the world writable bit set.
stoqdrivers-git W: File (usr/share/stoqdrivers/conf/bematech.ini) has the world writable bit set.
stoqdrivers-git W: File (usr/share/stoqdrivers/conf/dataregis.ini) has the world writable bit set.
stoqdrivers-git W: File (usr/share/stoqdrivers/conf/perto.ini) has the world writable bit set.
stoqdrivers-git W: File (usr/share/locale/pt_BR/LC_MESSAGES/stoqdrivers.mo) has the world writable bit set.
stoqdrivers-git W: File (usr/share/locale/es_ES/LC_MESSAGES/stoqdrivers.mo) has the world writable bit set.
.............
....Didnt find anything at duckduckgo that could help me.
Im feeling pretty happy with the results, it feels good haha
Offline
That is weird, especially for files like .PKGINFO and .MTREE that are created by makepkg without user intervention.
What filesystem are you using for ~/Dropbox/stoqdrivers folder ?
(if you're not sure, just post output of mount commando ).
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
~/Dropbox/stoqdrivers is NTFS.
I built it on Ext4 now, the namcap output now is just:
xxx@xxx:~/AUR/stoqdrivers$ namcap stoqdrivers-git-0.9.22.r3.g8e2025e-1-any.pkg.tar.xz
stoqdrivers-git W: File (usr/share/locale/es_ES/LC_MESSAGES/stoqdrivers.mo) has the world writable bit set.
stoqdrivers-git W: File (usr/share/locale/pt_BR/LC_MESSAGES/stoqdrivers.mo) has the world writable bit set.is it ready?
Offline
You're getting close, but the namcap output indicates some file permissions are incorrect.
I've checked other *.mo files, and none of them have that bit set.
Please post the current version of stoqdrivers-git, so we can investigate what happens.
I do think stoqdrivers-git has improved enough to start improving/testing the stoq-git PKGBUILD now.
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
Current version of stoqdrivers-git:
# Maintainer: RicardoScar <ricardoscar@gmail.com>
pkgbase=stoqdrivers-git
pkgname=stoqdrivers-git
pkgver=0.9.22.r3.g8e2025e
pkgrel=1
pkgdesc='Brasilian Open Source commercial and industrial manager drivers. Git mirror'
arch=('any')
url='http://stoq.com.br/'
license=('LGPL2.1')
depends=()
makedepends=('git'
'python2'
'python2-zope-interface'
'kiwi'
'python-pyserial')
conflicts=("stoqdrivers")
provides=("${pkgbase%-git}=${pkgver%.r*}")
replaces=("stoqdrivers")
source=('stoqdrivers::git+https://github.com/stoq/stoqdrivers.git')
sha256sums=('SKIP')
pkgver() {
cd "stoqdrivers"
git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}
package() {
cd "$srcdir/stoqdrivers"
python2 setup.py install --root="$pkgdir/" --optimize=1
}
# vim:set ts=2 sw=2 et:The stoq-git PKGBUILD:
# Maintainer: RicardoScar <ricardoscar@gmail.com>
pkgbase=stoq-git
pkgname=stoq-git
pkgver=1.9
pkgrel=1
pkgdesc='Brasilian Open Source commercial and industrial manager. Git mirror'
arch=('any')
url='http://stoq.com.br/'
license=('GPL2')
depends=( 'gtk2'
'libgudev'
'kiwi'
'python2-mako'
'postgresql'
'pygtk'
'python2-pyserial'
'python2'
'python2-cairo'
'python2-dateutil'
'poppler-git'
'python2-twisted'
'python2-xlwt'
'python2-pillow'
'pywebkitgtk'
'python2-psycopg2'
'python2-reportlab'
'stoqdrivers'
'storm'
'python2-zope-interface'
'python2-weasyprint')
makedepends=('git')
conflicts=("stoq")
provides=("stoq")
replaces=("stoq")
source=('stoq::git+https://github.com/stoq/stoq.git')
sha256sums=('SKIP')
pkgver() {
cd "stoq"
git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}
package() {
cd "$srcdir/stoq"
python2 setup.py install --root="$pkgdir/" --optimize=1
}
# vim:set ts=2 sw=2 et*Some of the dependencies are from aur.
The namcap output is:
namcap PKGBUILD
PKGBUILD (stoq-git) E: Child package stoq-git does not have a valid package() functionOffline
I've looked at stoqdrivers-git and didn't get "world writable bit set" message from namcap.
I think it's a remnant of the NTFS permissions, try running "makepkg --cleanbuild" and see if namcap still reports errors.
(--cleanbuild will remove the $srcdir before building ).
makepkg does give 1 warning,
UserWarning: Unknown distribution option: 'install_requires'
warnings.warn(msg)http://stackoverflow.com/questions/1276 … -packaging
installing python2-setuptools doesn't solve the warning, and it seems safe to ignore that warning.
You might want to create a new issue at https://github.com/stoq/stoq/issues to alert upstream of this.
The pkgdesc entry is not very descriptive, in setup.py you can find a better one .
Once you changed the package description and verified the namcap output, i'd say stoqdrivers-git is ready to be uploaded to the aur.
--------------------------------------------
The namcap output is:
namcap PKGBUILD
PKGBUILD (stoq-git) E: Child package stoq-git does not have a valid package() functionnamcap is technically correct, personally i ignore that message when there's only 1 package() function in the PKGBUILD (like this one)
Last edited by Lone_Wolf (2015-08-31 11:11:13)
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline