You are not logged in.
Pages: 1
I've been working on a screencast script called ffcast these two days.
AUR page here: http://aur.archlinux.org/packages.php?ID=32158
I've got a little headache now that I added xrectsel.c...
# Contributor: lolilolicon <lolilolicon{at}gmail{dot}com>
pkgname=ffcast
pkgver=20091123
pkgrel=1
pkgdesc="bash script that takes screencast of given window area using ffmpeg/xwininfo"
arch=('any')
url="http://github.com/lolilolicon/ffcast"
license=('GPL v3')
makedepends=('git')
depends=('bash>=3.0' 'ffmpeg>=0.5' 'x264>=20090416' 'xorg-utils')
source=()
md5sums=()
_gitroot="git://github.com/lolilolicon/ffcast.git"
_gitname=master
build() {
msg "Connecting to GIT server..."
if [ -d "$srcdir/$pkgname" ]; then
cd "$srcdir/$pkgname" && git pull origin $_gitname || return 1
else
git clone "$_gitroot" "$srcdir/$pkgname" || return 1
cd "$srcdir/$pkgname" && git checkout $_gitname || return 1
fi
msg "GIT checkout done or server timeout"
gcc -Wall -lX11 xrectsel.c -o xrectsel
install -D -m755 xrectsel "$pkgdir/usr/bin/xrectsel"
install -D -m755 ffcast "$pkgdir/usr/bin/ffcast"
}
# vim:set ts=2 sw=2 et:
My questions:
1. Is it normal to put gcc stuff in the build() function? Or, should I write a make file?
2. How to write a make file for this?
3. xrectsel is basically only a helper tool, which will return a geometry value like '600x349+42+300' when you select a rectangle area on your screen. So... is it good to install xrectsel to /usr/bin like this?
4. Also, in xrectsel.c, uses these:
#include<stdio.h>
#include<stdlib.h>
#include<X11/Xlib.h>
#include<X11/cursorfont.h>
the X11/*.h stuff belongs to libx11 package, and libx11 is required by x264, so libx11 does not need to be in the depends array right?
5. Other suggestions?
Thanks in advance
This silver ladybug at line 28...
Offline
1. Is it normal to put gcc stuff in the build() function? Or, should I write a make file?
Yes
2. How to write a make file for this?
There are some very good tutorials to be found on google.
3. xrectsel is basically only a helper tool, which will return a geometry value like '600x349+42+300' when you select a rectangle area on your screen. So... is it good to install xrectsel to /usr/bin like this?
Yes.
4. Also, in xrectsel.c, uses these:
#include<stdio.h>
#include<stdlib.h>
#include<X11/Xlib.h>
#include<X11/cursorfont.h>the X11/*.h stuff belongs to libx11 package, and libx11 is required by x264, so libx11 does not need to be in the depends array right?
Yes.
Offline
So I wrote a makefile
CC=gcc
xrectsel : xrectsel.c -lX11
${CC} ${CFLAGS} xrectsel.c -lX11 -o xrectsel
.PHONY : clean
clean :
-rm xrectsel
Thoughts?
Edit:
second try:
PREFIX=/usr
DESTDIR=
CC=gcc
xrectsel : xrectsel.c -lX11
${CC} ${CFLAGS} xrectsel.c -lX11 -o xrectsel
install : xrectsel ffcast
install -D -m755 xrectsel ${DESTDIR}${PREFIX}/bin/xrectsel
install -D -m755 ffcast ${DESTDIR}${PREFIX}/bin/ffcast
.PHONY : clean
clean :
-rm xrectsel
and in PKGBUILD
make
make DESTDIR="$pkgdir" install
make clean
How's that?
Last edited by lolilolicon (2009-11-23 10:52:20)
This silver ladybug at line 28...
Offline
No need to `make clean`
That's what the srcdir is for, to be dirty with source
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
Hmm sounds reasonable.
But I prefer to `make clean` in the case where git is used -- it keeps srcdir/ffcast look the same as git remote.
This silver ladybug at line 28...
Offline
But I prefer to `make clean` in the case where git is used -- it keeps srcdir/ffcast look the same as git remote.
You might want to take a look at the prototype PKGBUILDs in /usr/share/pacman. They have a better solution for this.
Last edited by tdy (2009-11-25 19:14:43)
Offline
Cool, this *-build dir method is very helpful for bigger projects. I should have thought about that since I actually knew it.
The only pitfall I think, is this method will require extra diskspace for a copy of the git tree.
Besides that, it's good and universal solution. I'll keep that in mind. Thanks tdy.
This silver ladybug at line 28...
Offline
Pages: 1