You are not logged in.
howdy guys,
This is my firstish attempt at building a package. Here's the
PKGBUILD, nothing fancy. I ran makepkg as root, and it made a
package, which I installed with pacman.
pkgname=gnuserv
pkgver=3.12.7
pkgrel=1
pkgdesc="gnuserv with gnu emacs compatability layer"
url="http://meltin.net/hacks/emacs/"
license="GPL"
depends=()
makedepends=()
conflicts=()
replaces=()
backup=()
install=
source=(http://meltin.net/hacks/emacs/src/gnuserv-3.12.7.tar.gz)
md5sums=()
build() {
cd $startdir/src/$pkgname-$pkgver
./configure --prefix=/usr
make || return 1
make DESTDIR=$startdir/pkg install
}
The trouble is, makepkg installed everything without pacman. Pacman
-A "installs" it, pacman -R does not remove it. What did I do wrong?
I could have just compiled by hand with the same results...
Offline
... make DESTDIR=$startdir/pkg install ...
It seems like the Makefile doesn't use DESTDIR, so everything get's installed in /usr...
I prefer to test new PKGBUILD's in an fakeroot environment. This would yield the following error:
/bin/install -c gnuserv /usr/bin/gnuserv
/bin/install: cannot create regular file `/usr/bin/gnuserv': Permission denied
Offline
also, try using
[url]http://dl.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz[/url]
for source whenever possible.
You can generate md5sums by doing makepkg -g>>PKGBUILD
that will put the sums at the bottom of the PKGBUILD.
There are no dependancies?
It shouldn't be hard to find the equivalent of DESTDIR. Just have a look in the makefile, you'll spot it out.[/code]
Offline
Dependencies? Emacs, I guess, since gnuclient works "under" emacs.
I guess I need further enlightenment about the build section of PKGBUILD.
build() {
cd $startdir/src/$pkgname-$pkgver
./configure --prefix=/usr
make || return 1
make DESTDIR=$startdir/pkg install
}
Ok, bear with me, please:
the build section is just as if I did a
#configure
#make
#make install
except that the resulting binarys and whatever are packed into the
package tarball. Pacman -A puts them wherever they really go in the
filesystem. Is that right?
Offline
You need to include the dependancies in depends() array.
Normally if you do make install it will try installing on the filesystem. Thats why you need to find the deleclaration that defines where to install to. In you case its not DESTDIR but more than likely something else. If I had more time, I would try to help you out on that part.
I believe if you use -c to makepkg and do
pacman --upgrade /complete/path/to/file
it will either upgrade or install through pacman, which ever is needed.
Offline
I'm fairly new to Arch packaging myself, but I have found that if DESTDIR= doesn't work with make install, prefix= is worth trying - the Makefile will tell you for sure, though.
Offline
namcap is your friend... (pacman -S namcap)
when a package is built, run namcap on the pkg.tar.gz file
namcap gnuserv-3.12.7-1.pkg.tar.gz
that will list all the things you can do to improve the PKGBUILD
Offline
Amazingly, makepkg's manpage helped me (read? who, me?)
here's the relevant part:
After a package is built, the build function must install the
package files into a special package root, which can be refer-
enced by $startdir/pkg in the build function. The typical way
to do this is one of the following:make DESTDIR=$startdir/pkg install
or
make prefix=$startdir/pkg/usr install
Notice that the "/usr" portion should be present with "prefix",
but not "DESTDIR". "DESTDIR" is the favorable option to use,
but not all Makefiles support it. Use "prefix" only when "DEST-
DIR" is unavailable.
So, using the second one worked.
If you don't mind, I have some other questions. What about "extra
stuff?" I had to manually copy some elisp files into my site-lisp
directory, and edit my .emacs config file. Where would I put, say, a
script that automates this?
Also, I need to make this package more generic, regarding the stuff I
did manually. I tried to add the files to
/usr/share/emacs/site-lisp/, but this did not work for some reason.
the edit to .emacs, and adding the files to my local emacs directory
did.
If anyone else wants to use my package, wouldn't it be better for it
to be completely hands-off?
thanks,
Offline
make prefix=$startdir/pkg/usr install
This is rather dangerous. Many programs use prefix to find extensions on runtime. One example is scheme48, i fixed 2 weeks ago.
Jürgen
Offline
scrawler wrote:... make DESTDIR=$startdir/pkg install ...
It seems like the Makefile doesn't use DESTDIR, so everything get's installed in /usr...
I prefer to test new PKGBUILD's in an fakeroot environment. This would yield the following error:/bin/install -c gnuserv /usr/bin/gnuserv /bin/install: cannot create regular file `/usr/bin/gnuserv': Permission denied
how you go about doing that?
"The only thing we have to fear is fear itself." - Franklin D. Roosevelt
Offline
install fakeroot if it isn't installed (pacman -S fakeroot)
and run makepkg as an ordinary user.
Offline
install fakeroot if it isn't installed (pacman -S fakeroot)
and run makepkg as an ordinary user.
ahh thanks
"The only thing we have to fear is fear itself." - Franklin D. Roosevelt
Offline