LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File prereq.sh of Package prereqs (Project home:gnb:novaprova)

#!/bin/bash

verbose=
prefix=_service:prereqs

if [ $verbose ] ; then
    # Log to stdout
    exec 2>&1
    # Log everything
    # exec > $prefix:log 2>&1
    set -x
fi

pkg=libxml2-utils
pkg_basename=libxml2-utils_2.9.1+dfsg1-3ubuntu4.4_amd64.deb
pkg_sha1=65f564a27b3b587a01ea2cc284e51413e0888462
pkg_size=34736

# Build a set of fake package spec files which pretend to have built the
# package but actually download it like a vendor package fetch

cat > $prefix:debian.control <<EOF
Source: prereqs
Section: prereqs
Priority: optional
Maintainer: Greg Banks <gnb@fmeh.org>
Build-Depends: debhelper (>= 4.1.16)

Package: prereqs
Architecture: any
Depends:
Description: Insert vendor binary prereqs which OBS wont

EOF

# When the make targets run, their working directory is
# /usr/src/packages/BUILD, and the original sources
# are in /usr/src/packages/SOURCES.

cat > $prefix:debian.rules <<EOF
#!/usr/bin/make -f

export DH_COMPAT=5

build: build-stamp
build-stamp:
	# nothing to do for build-stamp

clean:
	# nothing to do for clean

install: build
	# nothing to do for install

# Build architecture-independent files here.
binary-indep: build install
	# nothing to do for binary-indep

# Build architecture-dependent files here.
binary-arch: build install
	bash /usr/src/packages/SOURCES/fetch-deb.sh $pkg /usr/src/packages/DEBS
	# dpkg-genchanges needs this file to exist
	touch debian/files

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install build-stamp

EOF
cat > $prefix:debian.changelog <<EOF
prereqs (1.0-1) stable; urgency=low

  * Blah.

 -- Greg Banks <gnb@fmeh.org>  Tue, 07 May 2013 21:36:22 +1000
EOF

cat > $prefix:prereq.dsc <<EOF
Format: 1.0
Source: prereqs
Version: 1.0-1
Binary: prereqs
Maintainer: Greg Banks <gnb@fmeh.org>
Architecture: any
Build-Depends: debhelper (>= 4.1.16)
Files: 
 $pkg_sha1 $pkg_size $pkg_basename
EOF

if [ $verbose ]; then
    # Always fail so we see the output in the web interface
    exit 1
fi