summaryrefslogtreecommitdiff
blob: 90a64ffb34d794f860cb5d9423ee6b4c93602193 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash

. /etc/init.d/functions.sh

PV=$1
SVN_ROOT=${2:-/usr/local/src}

if [[ $# -eq 0 ]] ; then
	ebegin "Detecting latest version"
	cd "${SVN_ROOT}/netpbm/release_number"
	svn up -q || die
	PV=$(svn ls | sort -V | tail -1) || die
	[[ -z ${PV} ]] && die
	PV=${PV%/}
	eend
	einfo "Using PV=${PV}"

	if [[ ! -d ${PV} ]] ; then
		ebegin "Checking out ${PV}"
		svn up -q ${PV}
		eend || die
	fi
fi

if [[ $# -gt 2 ]] ; then
	exec echo "Usage: $0 [version] [netpbm svn root]"
fi

PN=netpbm
P=${PN}-${PV}

T=/tmp

maint_pkg_create() {
	local base="/usr/local/src"
	local srcdir="${base}/netpbm/release_number"
	local htmldir="${base}/netpbm/userguide"
	if [[ -d ${srcdir} ]] ; then
		cd "${T}" || die

		rm -rf ${P}

		ebegin "Exporting ${srcdir}/${PV} to ${P}"
		svn export -q "${srcdir}/${PV}" ${P}
		eend $? || return 1

		ebegin "Exporting ${htmldir} to ${P}/userguide"
		svn export -q "${htmldir}" ${P}/userguide
		eend $? || return 1

		ebegin "Generating manpages from html"
		(cd "${P}/userguide" && ../buildtools/makeman *.html)
		eend $? || return 1

		ebegin "Creating ${P}.tar.xz"
		tar cf - ${P} | xz > ${P}.tar.xz
		eend $?

		einfo "Tarball now ready at: ${T}/${P}.tar.xz"
	else
		einfo "You need to run:"
		einfo " cd ${base}"
		einfo " svn co https://netpbm.svn.sourceforge.net/svnroot/netpbm"
		die "need svn checkout dir"
	fi
}
maint_pkg_create