You are not logged in.

#1 2007-01-21 01:46:44

stmok
Member
From: Sydney, Australia
Registered: 2006-11-19
Posts: 72

Need a little help with SVN and PKGBUILD

This is a bit of a long one...

The application I want to package is DVBCUT.
=> http://dvbcut.sourceforge.net/index.html

Now there is already a prebuilt one in Unsupported of AUR, but it is a year out of date. The issue is that I don't think the maintainer (AndyRTR) is bothering with it any longer. The thing is, the SVN version has fixes not found in the Unsupported package. (Resolves a number of issues).

As seen here:
=> http://svn.sourceforge.net/viewvc/dvbcu … iew=markup

What I want to do, (as part of my learning experience), is to package an application from SVN.

As discussed here:
=> http://wiki.archlinux.org/index.php/Arc … N_PKGBUILD

Useful details

* From http://dvbcut.sourceforge.net/download.html

You can download a snapshot of the DVBCUT sources with the following command:

svn co https://svn.sourceforge.net/svnroot/dvbcut/trunk dvbcut

* From http://dvbcut.sourceforge.net/installation.html

To compile the sources of DVBCUT yourself you need:

    * Qt, version 3
    * SCons (a modern build utility, replacing automake, autoconf and make)
    * libao (optional, for sound output)

It then goes on...

DVDCUT makes use of the FFMPEG libraries for decoding and encoding video frames, for decoding audio data, and for writing MPEG program streams and transport streams. To ease the installation procedure, DVBCUT comes now with the necessary sources of FFMPEG. If you want to use your already installed FFMPEG libraries, follow the instructions in the file README.ffmpeg.

The README.ffmpeg file...
From http://svn.sourceforge.net/viewvc/dvbcu … iew=markup

DVBCUT uses the FFMPEG libraries (libavformat, libavcodec) for decoding and
   encoding of MPEG2 video streams, as well as for decoding audio streams. To ease
   the build process of DVBCUT, a sufficient subset of the FFMPEG sources is now
   included in the DVBCUT archive. You find this in the ffmpeg.src directory.
   
   FFMPEG is licensed under the LGPL, with the exception of liba52 and libpostproc,
   which are licensed under the GPL. Read the details in ffmpeg.src/README and
   ffmpeg.src/COPYING. All credits for FFMPEG go to its authors, which are listed
   in ffmpeg.src/CREDITS.
   
   However, you can still build DVBCUT with the FFMPEG libraries which are
   installed on your system. Type
   
   make FFMPEG=/usr
   
   if the FFMPEG libraries are in /usr/lib and the header files are in
   /usr/include/ffmpeg. This is usually the case if you have FFMPEG packages and
   development packages installed from your distribution. If you build FFMPEG
   yourself, you have to specify the FFMPEG installation prefix to the DVBCUT
   Makefile. E.g.:
   
   (in the FFMPEG directory)
   ./configure --prefix=/path/to/my/ffmpeg
   make
   make install
   
   (in the DVBCUT directory)
   make FFMPEG=/path/to/my/ffmpeg
   
   If you do not specify any FFMPEG path, DVBCUT will be linked against static
   FFMPEG libraries built from the sources in ffmpeg.src.
   
   Currently, DVBCUT comes with a CVS snapshot from FFMPEG, taken at September 18th
   2005. The files listed in ffmpeg-patches/cvs20050918.deletefiles were removed
   and the patch ffmpeg-patches/cvs20050918.diff was applied, in order to reduce
   the size of the DVBCUT source archive. The DVBCUT executable is also
   significantly smaller thanks to the patch, which removes unneeded functionality
   from FFMPEG.


Back to http://dvbcut.sourceforge.net/installation.html

To install DVBCUT, just download the current release, untar it, enter the DVBCUT directory and type 'make'. You may type 'make install' as root user afterwards.

Furthermore, an installed MPlayer will enable you to play the videos inside DVBCUT, which makes browsing the video material much easier. (The MPlayer binary has to be named mplayer and has to be in a directory in your PATH.)

* The INSTALL file says...
http://svn.sourceforge.net/viewvc/dvbcu … iew=markup

DVBCUT INSTALL -- last edited 2005-11-21
   
   In order to compile dvbcut, you need to have the following libraries
   installed:
   
   * Qt, version 3
   * SCons (a modern build utility, replacing automake, autoconf and make)
   * libao (optional, for sound output)
   
   On a Debian system, the following packets should do the job:
   libqt3-mt-dev qt3-dev-tools scons libao-dev
   
   If you have MPlayer installed on your machine (and it is accessible as
   "mplayer"), you can play the videos inside DVBCUT.
   
   How to compile DVBCUT:
   
   * Unpack the dvbcut source archive and enter the dvbcut directory.
   * Type 'make'. If everything works well, you will find the DVBCUT executable
     in the bin subdirectory.


My questions

Specifically, I'm not sure what to put in regards to the build function of the PKGBUILD file. Based on the above information.

This is what I've done so far...

pkgname=dvbcut-svn
pkgver=0.5.3
pkgrel=1
pkgdesc="DVBCUT-svn is an application that allows you to  
edit MPEG files. ie: Remove TV ads. (SVN version)."
url="http://dvbcut.sourceforge.net"
depends=('qt' 'libao')
makedepends=('subversion' 'scons')
conflicts=()
source=()
md5sums=()

_svntrunk=https://svn.sourceforge.net/svnroot/dvbcut/trunk
_svnmod=dvbcut

build() {
  cd $startdir/src

  svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod
  cd $_svnmod
  ./autogen.sh

  msg "SVN checkout done or server timeout"
  msg "Starting make..."

  mkdir ../$_svnmod-build
  cd ../$_svnmod-build

  ../$_svnmod/configure --prefix=/usr 
  
  make || return 1
  make DESTDIR=$startdir/pkg/ install

  rm -r $startdir/src/$_svnmod-build
}
# vim:syntax=sh

Its mostly based on other examples and how they work. But I don't think its right for this application, as it uses scons.

Any suggestions or improvements?


The most important thing the hacker community does is write better code. Our deeds are the best propaganda we have. -Eric S. Raymond

Offline

#2 2007-01-21 03:47:50

mutlu_inek
Member
From: all over the place
Registered: 2006-11-18
Posts: 683

Re: Need a little help with SVN and PKGBUILD

I am not really the right person to answer to this post since I have never written a PKGBUILD for svn. But to me it seems like a very good job for a start.

As a general remark (and I assume you know this already), you should make sure that the files are placed in accordance with the Arch directory guidelines:
http://wiki.archlinux.org/index.php/Arc … _Standards

Regarding this PKGBUILD I would advise you to add

conflicts=('dvbcut')
provides=('dvbcut')

to ensure compatibility with the (outdated) package in AUR.

I would also add the dependency on qt.

Why do you write that you are "not sure what to put in regards to the build function of the PKGBUILD file"? Does the package build well with the PKGBUILD given above? If yes, what exactly is the problem (apart from seeking comments)?

To me it seems that while it is generally discouraged to use alternative packing systems, scons is in fact used by a number of packages in AUR, including some provided for by TUs and devs. In so far I think it should be fine. But someone knowledgeable should comment on this.

Offline

#3 2007-01-21 06:34:42

stmok
Member
From: Sydney, Australia
Registered: 2006-11-19
Posts: 72

Re: Need a little help with SVN and PKGBUILD

mutlu_inek wrote:

Why do you write that you are "not sure what to put in regards to the build function of the PKGBUILD file"? Does the package build well with the PKGBUILD given above? If yes, what exactly is the problem (apart from seeking comments)?

Haven't actually tried to build yet, but wanting feedback from more experienced users. I'm more curious about scons, and if I have to consider anything extra compared to the regular "configure, make, make install" way.

I prefer to get things right from a theoretical perspective, before I run the code. (Its like what I do with C++ and Python. I get a lot less errors that way). I haven't used SVN before, but I'm reading about it.


The most important thing the hacker community does is write better code. Our deeds are the best propaganda we have. -Eric S. Raymond

Offline

#4 2007-01-21 08:02:28

stmok
Member
From: Sydney, Australia
Registered: 2006-11-19
Posts: 72

Re: Need a little help with SVN and PKGBUILD

Well, I've tried compiling a package and I have modified the PKGBUILD file to look like this now. (Keeping it as simple as possible)

pkgname=dvbcut-svn
pkgver=16
pkgrel=1
pkgdesc="DVBCUT-svn is an application that allows you to  
edit MPEG files. ie: Remove TV ads. (SVN version: Fri, 01 Dec 2006)."
url="http://dvbcut.sourceforge.net"
depends=('qt' 'libao')
makedepends=('subversion' 'scons')
conflicts=('dvbcut' 'ffmpeg')
provides=('dvbcut')
source=()
md5sums=()

_svntrunk=https://svn.sourceforge.net/svnroot/dvbcut/trunk
_svnmod=dvbcut

build() {
  cd $startdir/src

  svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod
  cd $_svnmod

  msg "SVN checkout done or server timeout"
  msg "Starting make..."

  make || return 1
 
}
# vim:syntax=sh

I then run makepkg PKGBUILD and let it do its thing

It ends with this...

scons: done building targets.
==> Removing info/doc files...
==> Compressing man pages...
==> Stripping debugging symbols from libraries...
==> Stripping symbols from binaries...
==> Generating .PKGINFO file...
==> Generating .FILELIST file...
tar: *: Cannot stat: No such file or directory
tar: Error exit delayed from previous errors
==> Compressing package...
tar: *: Cannot stat: No such file or directory
tar: Error exit delayed from previous errors
==> Finished making: dvbcut-svn  (Sun Jan 21 19:08:28 UTC 2007)

I'm not sure what's causing this error message.
tar: *: Cannot stat: No such file or directory
tar: Error exit delayed from previous errors

I'll try installing it and see how it goes.


The most important thing the hacker community does is write better code. Our deeds are the best propaganda we have. -Eric S. Raymond

Offline

#5 2007-01-21 10:23:29

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

Re: Need a little help with SVN and PKGBUILD

You should be attempting to build against external ffmpeg libs/headers provided by the Arch ffmpeg package. And your latest version errors because it doesn't do make install.

There are also some errors in your PKGBUILD, but after checking the wiki page, they appear to be due to someone making incorrect changes to the SVN example. The checked-out source should be copied to a new build directory before the build starts, and all build commands should be run in that new directory. After the build has completed, the new directory should be deleted, leaving behind an untouched copy of the sources as the starting point for the next build. Have a look at any of the official SVN PKGBUILDs for examples e.g.mplayer-svn.

Offline

#6 2007-01-21 10:37:08

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

Re: Need a little help with SVN and PKGBUILD

Wiki SVN example is now correct, btw.

Offline

#7 2007-01-21 21:25:25

stmok
Member
From: Sydney, Australia
Registered: 2006-11-19
Posts: 72

Re: Need a little help with SVN and PKGBUILD

Thanks for the correcting the wiki and the tips.

I'll try that and report back.


The most important thing the hacker community does is write better code. Our deeds are the best propaganda we have. -Eric S. Raymond

Offline

Board footer

Powered by FluxBB