Commits

Konstantin Nikiforov committed 98a3c91

bitcoin 0.6.0-2: rewritten package() to use contrib/debian,
-bitcoin.desktop,
will port to -git and -bin pkgbuilds later...

Comments (0)

Files changed (2)

 name=bitcoin
 pkgname=$name
 pkgver=0.6.0
-pkgrel=1
+pkgrel=2
 pkgdesc="Bitcoin is a peer-to-peer network based digital currency."
 arch=('i686' 'x86_64')
 url="http://www.bitcoin.org/"
 makedepends=('boost' 'gcc' 'make' 'automoc4')
 conflicts=('bitcoin-bin' 'bitcoin-git' 'bitcoin-daemon')
 license=('MIT')
-source=("http://downloads.sourceforge.net/sourceforge/${pkgname}/${pkgname}-${pkgver}-linux.tar.gz"
-	"${pkgname}.desktop")
-md5sums=('d0289e10c5433b37b485755a92c0be64'
-	 '77139ce8a40f46bd7d7ad0a743672113')
+source=("http://downloads.sourceforge.net/sourceforge/${pkgname}/${pkgname}-${pkgver}-linux.tar.gz")
+
+## global vars for dirs and files
 s1=$srcdir/${pkgname}-${pkgver}-linux
-src_qt=$s1/src
-src_d=$s1/src/src/
+src_root=$s1/src
+src_qt=$src_root
+src_d=$src_root/src
+src_deb=$src_root/contrib/debian
 makefile_unix=makefile.unix
 
 build() {
 
 	msg "Patching $makefile_unix..."
 	sed -i $makefile_unix \
+		-e 's/-Bstatic/--as-needed ${LDFLAGS}/g' \
 		-e 's/\(-DNOPCH\)/\1 -DBOOST_FILESYSTEM_VERSION=2/' \
-		-e 's/-Bstatic/--as-needed ${LDFLAGS}/g' \
 		-e 's/\(USE_UPNP:=\)0/\11/' \
 		-e 's/$(DEBUGFLAGS)//g' \
 		-e 's/CXXFLAGS/CPPFLAGS/g' \
 
 
 package() {
-	mkdir -p $pkgdir/usr/bin
-	mkdir -p $pkgdir/usr/share/pixmaps
-	mkdir -p $pkgdir/usr/share/applications
+	## Grab debian .install files here.
+	## First, create directories:
+	cat $src_deb/*.install | cut -d\  -f2 | sort | uniq | xargs -I{} mkdir -p $pkgdir/{}
 
-	# get compiled binaries
-	install -D -m755 $src_qt/bitcoin-qt $pkgdir/usr/bin/
-	install -D -m755 $src_d/bitcoind $pkgdir/usr/bin/
-	
-	# add icon and .desktop file to pkg
-	install -D -m644 $src_qt/src/qt/res/icons/bitcoin.png $pkgdir/usr/share/pixmaps/
-	install -D -m644 $srcdir/$name.desktop $pkgdir/usr/share/applications/ 
+	## Copy needed files into created dir-s:
+	cat $src_deb/*.install | deb_paths_pp | apply_deb_install
+
+	## Copy mans
+	cat $src_deb/*.manpages | deb_paths_pp | install_man
+
+	## Copy examples
+	mkdir -p $pkgdir/usr/share/bitcoin
+	cat $src_deb/*.examples | deb_paths_pp | xargs -I{} install $src_root/{} $pkgdir/usr/share/bitcoin/
+
+	find $pkgdir/usr/share/ -type f | xargs chmod -x 
 }
+
+## convert paths from .install and other files: "debian/" -> "contrib/debian/"
+deb_paths_pp() { sed -e 's@^\(debian\)@contrib/\1@'; }
+
+## reading input in "<from> <to>"-manner and convert it
+apply_deb_install() {
+    while read from to ; do
+	install $src_root/$from $pkgdir/$to
+    done
+}
+
+## guess correct /usr/share/man's subdirectory for man every file
+## FIXME Uber-fat crunch. It should another, simple way...
+install_man() {
+    while read man; do
+	local man_d="$pkgdir/usr/share/man/man${man#${man%?}}/"
+	mkdir -p $man_d
+	install -D $src_root/$man $man_d
+    done
+}
+
+## makepkg -g >> PKGBUILD
+md5sums=('d0289e10c5433b37b485755a92c0be64')

bitcoin/bitcoin.desktop

-[Desktop Entry]
-Name=Bitcoin
-GenericName=P2P network based digital currency
-Comment=P2P network based digital currency
-Exec=bitcoin-qt
-Icon=/usr/share/pixmaps/bitcoin.png
-StartupNotify=true
-Terminal=false
-Type=Application
-Categories=Office;Finance;P2P