You are not logged in.

#1 2007-01-23 17:11:06

schoens
Member
From: My throne.
Registered: 2007-01-23
Posts: 43

My first PKGBUILD, sendmail.

Alright, well I've been reading the wiki, and some of the other posts in the forum here, but I'm not entirely sure what I'm doing wrong. So I figured I'd ask here and see what mistakes I've been making.

Here is the PKGBUILD file I made:

#Contributor: Paul Schoenfelder <pschoenfelder>
pkgname=sendmail
pkgver=8.13.8
pkgrel=1
pkgdesc="Sendmail 8.13.8 for Arch"
url="www.sendmail.org"
depends=
makedepends=
provides=
conflicts=
replaces=
backup=
install=
source=(ftp://ftp.sendmail.org/pub/sendmail/sendmail.8.13.8.tar.gz)
md5sums=('5f29c94b42e0bb74d546b2ae84203a1e')

build() {
  cd $startdir/src/$pkgname-$pkgver
  ./configure --prefix=/usr
  make || return 1
  make DESTDIR=$startdir/pkg install
}

This is my first package, so I'm sure there are mistakes aplenty in there, but if someone could point out to me where I'm going wrong that would be awesome.

The error message I'm getting is this:

..a bunch of output up here..
make[1]: Leaving directory `/var/abs/local/sendmail/src/sendmail-8.13.8/obj.Linux.2.6.19-ARCH.i686/vacation'
make: *** [install] Error 2
==> ERROR: Build Failed. Aborting...

Thanks for the help!

Offline

#2 2007-01-23 19:59:51

schoens
Member
From: My throne.
Registered: 2007-01-23
Posts: 43

Re: My first PKGBUILD, sendmail.

Well after further reading in the Wiki, I think the PKGBUILD I made is going to require some significant tweaking before it's going to work. Unfortunately the source for sendmail contains no configure file, and there are a number of files that need tweaking before it can even be installed, so I'm going to have to do quite a bit of work to get this functional.

Offline

#3 2007-01-23 20:04:55

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: My first PKGBUILD, sendmail.

The actual error is going to be somewhere in those lines you marked as "a bunch of output here" - please post the last 10 or 20 lines in that output.

Offline

#4 2007-01-23 20:08:39

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: My first PKGBUILD, sendmail.

Starting with your build error, the output you've given is not what we need to see. The "bunch of output up here" is where the actual details of the error will be. If you can't identify the error, paste the entire output in pastebin.archlinux.org.

Regarding the PKGBUILD, here's a few notes:
- pkgdesc should be a generic description of the package and its function, preferable copied directly from the application's website.
- it's unlikely that there are no dependencies. Again, check the website, and any README/INSTALL/similar files in the source tarball.
- removing empty fields is recommended for readability.
- you should use the pkgver variable in the source line.

If you haven't already done so, have a look over the ABS pages in the wiki, and you could also have a look at some of the official PKGBUILDS for further examples.

Offline

#5 2007-01-23 22:17:45

schoens
Member
From: My throne.
Registered: 2007-01-23
Posts: 43

Re: My first PKGBUILD, sendmail.

As requested above, here is the link to the full output: http://pastebin.archlinux.org/993

Regarding the dependencies, I've checked through sendmail's website (although I may have missed it somewhere), but I was unable to find any prereq's and/or dependencies for sendmail, so I'm not sure what to do there.

Thanks again for the help!

Offline

#6 2007-01-23 22:34:31

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: My first PKGBUILD, sendmail.

Looks like its failing because it assumes usr/sbin will always here there...
right after "make" but before the make/install line, add this:

mkdir -p $startdir/pkg/usr/sbin

Offline

#7 2007-01-23 22:57:15

schoens
Member
From: My throne.
Registered: 2007-01-23
Posts: 43

Re: My first PKGBUILD, sendmail.

It would appear there are several such directories. I'll go through and add them all in, and then post back with the results.

Offline

#8 2007-01-24 17:26:40

schoens
Member
From: My throne.
Registered: 2007-01-23
Posts: 43

Re: My first PKGBUILD, sendmail.

Ok, well after a couple hours of work, figuring out what things needed to be changed, I finally got a successful compile, as well as a fully functional sendmail package that works right out of the box (I tested this with the software I was building sendmail for). I'm not sure how to share this with the community though, so if someone could point me in the right direction, that would be great.

Thanks for the help!

Edit: I unfortunately can't just post a PKGBUILD, as I had to make changes to the tar.gz from sendmail.org's ftp, and I don't have a place to upload the new one. I'm thinking I can either share the whole thing as a tar.gz that you download, extract, and run the PKGBUILD from, or, if someone has a place to store the tar.gz, I can just share the revised PKGBUILD.

Offline

#9 2007-01-24 18:18:36

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: My first PKGBUILD, sendmail.

schoens wrote:

I'm not sure how to share this with the community though, so if someone could point me in the right direction, that would be great.

Go to the AUR - there's a link up on the top right.

Thanks for the help!

schoens wrote:

Edit: I unfortunately can't just post a PKGBUILD, as I had to make changes to the tar.gz from sendmail.org's ftp, and I don't have a place to upload the new one.

You should make any required changes in the PKGBUILD, by writing and applying a patch, and/or using commands like sed. The source= should point to the source tarball as released by sendmail's developers.

Offline

#10 2007-01-24 19:00:55

schoens
Member
From: My throne.
Registered: 2007-01-23
Posts: 43

Re: My first PKGBUILD, sendmail.

Thanks for pointing me in the right direction. I'll go back and make the changes to the PKGBUILD like you mentioned and get it working that way, seems like a far better idea compared to the others.

Offline

#11 2007-01-24 20:00:52

schoens
Member
From: My throne.
Registered: 2007-01-23
Posts: 43

Re: My first PKGBUILD, sendmail.

Alright all done. The PKGBUILD is below. Let me know if any errors are encountered and I'll do my best to fix them.



  # Contributor: Paul Schoenfelder <pschoenfelder>
 
      pkgname=sendmail
      pkgver=8.13.8
      pkgrel=1
      pkgdesc="Sendmail Mail Transfer Agent"
      arch=(i686)
      url="www.sendmail.org"
      conflicts=(postfix postfix-mysql postfix-pgsql ssmtp courier-mta)
      source=(ftp://ftp.sendmail.org/pub/sendmail/sendmail.8.13.8.tar.gz)
      md5sums=('5f29c94b42e0bb74d546b2ae84203a1e')
      
      build() {
        #Makes necessary changes to source
         cd $startdir/src/$pkgname-$pkgver/cf/cf
         mv generic-linux.cf sendmail.cf
         sed -i 's|Fw/etc/mail/local-host-names|#Fw/etc/mail/local-host-names|g' sendmail.cf
         cd $startdir/src/$pkgname-$pkgver
         ./configure --prefix=/var/abs/sendmail
         make || return 1
        #Makes temp /etc/mail directory for sendmail.cf install
         mkdir -p $startdir/pkg/etc/mail
         cp $startdir/src/$pkgname-$pkgver/cf/cf/sendmail.cf $startdir/pkg/etc/mail/sendmail.cf
        #Makes temp directories for install
         mkdir -p $startdir/pkg/usr/man/man1
         mkdir -p $startdir/pkg/usr/man/man8
         mkdir -p $startdir/pkg/usr/man/man5
         mkdir -p $startdir/pkg/usr/bin
         mkdir -p $startdir/pkg/usr/sbin
         mkdir -p $startdir/pkg/var/spool/mqueue
      make DESTDIR=$startdir/pkg install
      } 

I've tested the new PKGBUILD as well and it works right out of the box for me.

Offline

#12 2007-01-24 20:26:51

Sigi
Member
From: Thurgau, Switzerland
Registered: 2005-09-22
Posts: 1,131

Re: My first PKGBUILD, sendmail.

I've changed a few things, although I haven't tested anything

# Contributor: Paul Schoenfelder <pschoenfelder>

pkgname=sendmail
pkgver=8.13.8
pkgrel=1
pkgdesc="Sendmail Mail Transfer Agent"
arch=(i686)
url="www.sendmail.org"
conflicts=(postfix postfix-mysql postfix-pgsql ssmtp courier-mta)
source=(ftp://ftp.sendmail.org/pub/${pkgname}/${pkgname}.${pkgver}.tar.gz)
md5sums=('5f29c94b42e0bb74d546b2ae84203a1e')

build() {
  mkdir -p $startdir/pkg/usr/man/{man1,man5,man8}
  mkdir -p $startdir/pkg/usr/{bin,sbin,spool/mqueue}
  mkdir -p $startdir/pkg/etc/mail

  #Makes necessary changes to source
  cd $startdir/src/$pkgname-$pkgver/cf/cf
  mv generic-linux.cf sendmail.cf
  sed -i 's|Fw/etc/mail/local-host-names|#Fw/etc/mail/local-host-names|g' sendmail.cf
  
  cd $startdir/src/$pkgname-$pkgver
  ./configure --prefix=/usr
  make || return 1
  install -m644 $startdir/src/$pkgname-$pkgver/cf/cf/sendmail.cf $startdir/pkg/etc/mail/sendmail.cf
  make DESTDIR=$startdir/pkg install
} 

As written above - no testing, only cosmetical changes...
I've changed ./configure --prefix to /usr because it doesn't belong into /var/abs!

edit: btw, thanks a lot for all the effort you put into this PKGBUILD!


Haven't been here in a while. Still rocking Arch. smile

Offline

#13 2007-01-24 20:41:51

schoens
Member
From: My throne.
Registered: 2007-01-23
Posts: 43

Re: My first PKGBUILD, sendmail.

Thanks for checking it over for me...I made one slight change (one of the directories needed was not being made), tested it, and it works! Below is the newest revision:


# Contributor: Paul Schoenfelder <pschoenfelder>

pkgname=sendmail
pkgver=8.13.8
pkgrel=1
pkgdesc="Sendmail Mail Transfer Agent"
arch=(i686)
url="www.sendmail.org"
conflicts=(postfix postfix-mysql postfix-pgsql ssmtp courier-mta)
source=(ftp://ftp.sendmail.org/pub/${pkgname}/${pkgname}.${pkgver}.tar.gz)
md5sums=('5f29c94b42e0bb74d546b2ae84203a1e')

build() {
  mkdir -p $startdir/pkg/usr/man/{man1,man5,man8}
  mkdir -p $startdir/pkg/usr/{bin,sbin}
  mkdir -p $startdir/pkg/etc/mail
  mkdir -p $startdir/pkg/var/spool/mqueue

  #Makes necessary changes to source
  cd $startdir/src/$pkgname-$pkgver/cf/cf
  mv generic-linux.cf sendmail.cf
  mv generic-linux.mc sendmail.mc
  sed -i 's|Fw/etc/mail/local-host-names|#Fw/etc/mail/local-host-names|g' sendmail.cf
  
 
  cd $startdir/src/$pkgname-$pkgver
  ./configure --prefix=/usr
  make || return 1
  install -m644 $startdir/src/$pkgname-$pkgver/cf/cf/sendmail.cf $startdir/pkg/etc/mail/sendmail.cf
  install -m644 $startdir/src/$pkgname-$pkgver/cf/cf/sendmail.mc $startdir/pkg/etc/mail/sendmail.mc
  make DESTDIR=$startdir/pkg install
}

Last edited by schoens (2007-01-28 03:41:24)

Offline

Board footer

Powered by FluxBB