about summary refs log tree commit diff
path: root/xnew
blob: 188c326618c7ad7490dd762a132664fafc21385e (plain) (blame)
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
#!/bin/sh -e
# xnew PKG - create XBPS template template

PKG=${1?no package name given}
srcdir=$(xdistdir)/srcpkgs
shift

mkdir $srcdir/$PKG

cat >$srcdir/$PKG/template <<EOF
# Template file for '$PKG'
pkgname=$PKG
version=
revision=1
#wrksrc=
#create_wrksrc=yes
#only_for_archs="i686 x86_64"
build_style=gnu-configure
#configure_args=""
#make_build_args=""
#make_install_args=""
#conf_files=""
#make_dirs="/var/log/dir 0755 root root"
hostmakedepends=""
makedepends=""
depends=""
short_desc=""
maintainer="$(git config user.name) <$(git config user.email)>"
license="GPL-3"
homepage=""
distfiles=""
checksum=badbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadb
EOF

for subpkg; do
	ln -sr -- "$srcdir/$PKG" "$srcdir/$subpkg"
	cat >>$srcdir/$PKG/template <<EOF

${subpkg}_package() {
EOF
	case $subpkg in
	*-devel) cat >>$srcdir/$PKG/template <<EOF
	depends="$PKG>=\${version}_\${revision}"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/share/man/man3
		vmove usr/include
		vmove usr/lib/pkgconfig
		vmove "usr/lib/*.a"
		vmove "usr/lib/*.so"
	}
EOF
		;;
	*) cat >>$srcdir/$PKG/template <<EOF
	pkg_install() {
		#vmove path
	}
EOF
		;;
	esac
	echo "}" >>$srcdir/$PKG/template
done

exec ${EDITOR:-vim} +3 $srcdir/$PKG/template