2015年4月2日 星期四

[PKGBUILD][ArchLinux] How to make a PKGBUILD


Take vnc2swf to be an example


# Maintainer: 
# Contributor: 

pkgname=vnc2swf
pkgver=0.5.0
pkgrel=1
pkgdesc='Screen recording tool'
arch=('any')
uirl='http://www.unixuser.org/~euske/vnc2swf/'
license=('')
depends=('')
options=('emptydirs')
install=""
source=("http://www.unixuser.org/~euske/vnc2swf/$pkgname-$pkgver.tar.gz")

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

md5sums=('2eed9cd91cff76e69004c905660b00ae')


makepkg -g
[happy@happy-B400AV vnc2swf]$ makepkg -g
==> Retrieving sources...
==> ERROR: vnc2swf-0.5.0.tar.gz was not found in the build directory and is not a URL.
[happy@happy-B400AV vnc2swf]$ vim PKGBUILD 
[happy@happy-B400AV vnc2swf]$ makepkg -g                                                                                                                                       
==> Retrieving sources...
  -> Downloading vnc2swf-0.5.0.tar.gz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  427k  100  427k    0     0   539k      0 --:--:-- --:--:-- --:--:--  538k
==> Generating checksums for source files...
md5sums=('2eed9cd91cff76e69004c905660b00ae')


makepkg -o
[happy@happy-B400AV vnc2swf]$ makepkg -o
==> Making package: vnc2swf 0.5.0-1 (Wed Feb 11 17:50:28 CST 2015)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found vnc2swf-0.5.0.tar.gz
==> Validating source files with md5sums...
    vnc2swf-0.5.0.tar.gz ... Passed
==> Extracting sources...
  -> Extracting vnc2swf-0.5.0.tar.gz with bsdtar
==> Sources are ready.


makepkg
[happy@happy-B400AV vnc2swf]$ makepkg                                                                                                                                          
==> Making package: vnc2swf 0.5.0-1 (Wed Feb 11 17:53:04 CST 2015)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found vnc2swf-0.5.0.tar.gz
==> Validating source files with md5sums...
    vnc2swf-0.5.0.tar.gz ... Passed
==> Extracting sources...
  -> Extracting vnc2swf-0.5.0.tar.gz with bsdtar
==> Removing existing $pkgdir/ directory...
==> Entering fakeroot environment...
==> Starting package()...
creating cache ./config.cache
checking for gcc... gcc
checking whether the C compiler (gcc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -Wl,-O1,--sort-common,--as-needed,-z,relro) works..$
 yes
checking whether the C compiler (gcc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -Wl,-O1,--sort-common,--as-needed,-z,relro) is a cr$
ss-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... (cached) no
checking for c++... c++
checking whether the C++ compiler (c++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -Wl,-O1,--sort-common,--as-needed,-z,relro) works$
.. yes
checking whether the C++ compiler (c++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -Wl,-O1,--sort-common,--as-needed,-z,relro) is a $
ross-compiler... no
checking whether we are using GNU C++... yes
checking whether c++ accepts -g... (cached) no
checking for ranlib... ranlib
checking whether make sets ${MAKE}... yes
checking how to run the C++ preprocessor... /lib/cpp
checking for X... libraries /usr/lib, headers /usr/include
checking for dnet_ntoa in -ldnet... no
checking for dnet_ntoa in -ldnet_stub... no
checking for gethostbyname... yes
checking for connect... yes
checking for remove... yes
checking for shmat... yes
checking for IceConnectionNumber in -lICE... yes
checking for deflate in -lz... yes
checking for socklen_t... yes
updating cache ./config.cache
creating ./config.status
creating Makefile
creating rdr/Makefile
...
...
...
c++ -D_FORTIFY_SOURCE=2 -DVNC2SWF_VERSION='"0.5.0"' -DHAVE_LIBZ=1  -I. -DVNC_SOCKLEN_T=socklen_t  -I/usr/include  -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -Wall -g -c sockets.cxx
c++ -D_FORTIFY_SOURCE=2 -DVNC2SWF_VERSION='"0.5.0"' -DHAVE_LIBZ=1  -I. -DVNC_SOCKLEN_T=socklen_t  -I/usr/include  -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -Wall -g -c zrle.cxx
cd rfb; make librfb.a;
make[1]: Entering directory '/tmp/test1/vnc2swf/src/vnc2swf-0.5.0/rfb'
gcc -D_FORTIFY_SOURCE=2 -DHAVE_LIBZ=1  -I.. -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -Wall  -g -c d3des.c
gcc -D_FORTIFY_SOURCE=2 -DHAVE_LIBZ=1  -I.. -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -Wall  -g -c vncauth.c
rm -f librfb.a
ar cq librfb.a d3des.o vncauth.o
ranlib librfb.a
make[1]: Leaving directory '/tmp/test1/vnc2swf/src/vnc2swf-0.5.0/rfb'
cd rdr; make librdr.a;
make[1]: Entering directory '/tmp/test1/vnc2swf/src/vnc2swf-0.5.0/rdr'
c++ -D_FORTIFY_SOURCE=2 -DHAVE_LIBZ=1  -I.. -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -Wall -g -c FdInStream.cxx
c++ -D_FORTIFY_SOURCE=2 -DHAVE_LIBZ=1  -I.. -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -Wall -g -c FdOutStream.cxx
c++ -D_FORTIFY_SOURCE=2 -DHAVE_LIBZ=1  -I.. -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -Wall -g -c InStream.cxx
c++ -D_FORTIFY_SOURCE=2 -DHAVE_LIBZ=1  -I.. -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -Wall -g -c NullOutStream.cxx
c++ -D_FORTIFY_SOURCE=2 -DHAVE_LIBZ=1  -I.. -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -Wall -g -c ZlibInStream.cxx
c++ -D_FORTIFY_SOURCE=2 -DHAVE_LIBZ=1  -I.. -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -Wall -g -c ZlibOutStream.cxx
rm -f librdr.a
ar cq librdr.a FdInStream.o FdOutStream.o InStream.o NullOutStream.o ZlibInStream.o ZlibOutStream.o
ranlib librdr.a
make[1]: Leaving directory '/tmp/test1/vnc2swf/src/vnc2swf-0.5.0/rdr'
rm -f vnc2swf
c++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -Wall -g -Wl,-O1,--sort-common,--as-needed,-z,relro -o vnc2swf argsresources.o colour.o desktop.o dialogs.o fullscreen.o listen.o misc.o popup.o rfbproto.o selection.o shm.o swf.o vnc2swf.o writeswf.o sockets.o zrle.o rfb/librfb.a rdr/librdr.a -lz  -lSM -lICE  -L/usr/lib -lXmu -lXaw -lXt -lX11 -lXext 
strip vnc2swf
mkdir -p /tmp/test1/vnc2swf/pkg/usr/X11R6/bin
cp vnc2swf /tmp/test1/vnc2swf/pkg/usr/X11R6/bin
cp recordwin.sh /tmp/test1/vnc2swf/pkg/usr/X11R6/bin/recordwin
chmod 0755 /tmp/test1/vnc2swf/pkg/usr/X11R6/bin/recordwin
==> Tidying install...
  -> Purging unwanted files...
  -> Removing libtool files...
  -> Removing static library files...
  -> Compressing man and info pages...
  -> Stripping unneeded symbols from binaries and libraries...
==> Creating package "vnc2swf"...
  -> Generating .PKGINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: vnc2swf 0.5.0-1 (Wed Feb 11 17:53:08 CST 2015)


Reference:
1. Making packages for Arch Linux w/ makepkg

0 意見:

張貼留言