1SUMMARY = "Tool for working with series of patches"
2HOMEPAGE = "http://savannah.nongnu.org/projects/quilt/"
3SECTION = "devel"
4LICENSE = "GPLv2"
5LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
6
7SRC_URI = "${SAVANNAH_GNU_MIRROR}/quilt/quilt-${PV}.tar.gz \
8        file://run-ptest \
9        file://Makefile \
10        file://test.sh \
11        file://0001-tests-Allow-different-output-from-mv.patch \
12"
13
14SRC_URI[md5sum] = "c67ba0228f5b7b8bbe469474661f92d6"
15SRC_URI[sha256sum] = "f6cbc788e5cbbb381a3c6eab5b9efce67c776a8662a7795c7432fd27aa096819"
16
17inherit autotools-brokensep ptest
18
19CLEANBROKEN = "1"
20
21EXTRA_OECONF = "--with-perl='${USRBINPATH}/env perl' --with-patch=patch"
22
23CACHED_CONFIGUREVARS += "ac_cv_path_BASH=/bin/bash"
24
25# Make sure we don't have "-w" in shebang lines: it breaks using
26# "/usr/bin/env perl" as parser
27do_configure_prepend () {
28	find ${S} -name "*.in" -exec sed -i -e "1s,^#\!.*@PERL@ -w$,#\! @PERL@\nuse warnings;," {} \;
29}
30
31# Don't setup symlinks to host utilities, we don't need them
32do_configure_append () {
33	sed -e 's,^COMPAT_SYMLINKS.*:=.*,COMPAT_SYMLINKS	:=,' -i ${S}/Makefile
34}
35
36# quilt Makefiles install to BUILD_ROOT instead of DESTDIR
37do_install () {
38	oe_runmake 'BUILD_ROOT=${D}' install
39	# cleanup unpackaged files
40	rm -rf ${D}/${datadir}/emacs
41}
42
43do_compile_ptest() {
44	oe_runmake bin/patch-wrapper test/.depend
45}
46
47do_install_ptest() {
48	tar -c --exclude=\*.in bin/ | ( cd ${D}${PTEST_PATH} && tar -xf - )
49	tar -c --exclude=\*.in compat/ | ( cd ${D}${PTEST_PATH} && tar -xf - )
50	tar -c --exclude=\*.in quilt/ | ( cd ${D}${PTEST_PATH} && tar -xf - )
51	tar -c --exclude=mail.test --exclude=delete.test test/ | ( cd ${D}${PTEST_PATH} && tar -xf - && chmod 777 test)
52	cp ${WORKDIR}/Makefile ${D}${PTEST_PATH}
53	cp ${WORKDIR}/test.sh ${D}${PTEST_PATH}
54}
55
56PACKAGES += "guards guards-doc"
57
58FILES_${PN} = "${sysconfdir} ${datadir}/quilt \
59               ${bindir}/quilt ${libdir}/quilt"
60FILES_guards = "${bindir}/guards"
61FILES_${PN}-doc = "${mandir}/man1/quilt.1 ${docdir}/${BPN}"
62FILES_guards-doc = "${mandir}/man1/guards.1"
63
64RDEPENDS_${PN} = "bash"
65RDEPENDS_${PN}-ptest = "make file sed gawk diffutils findutils ed perl \
66                        perl-module-filehandle perl-module-getopt-std \
67                        perl-module-posix perl-module-file-temp \
68                        perl-module-text-parsewords perl-module-overloading \
69                        bash util-linux-getopt \
70                       "
71