2011-09-24 03:37:34 -04:00
# $OpenBSD: Makefile,v 1.10 2011/09/24 07:37:34 espie Exp $
2010-01-08 09:00:49 -05:00
COMMENT = database of packages for use with locate( 1)
2011-09-11 12:12:34 -04:00
DISTNAME = pkglocatedb-0.3
2010-01-08 09:00:49 -05:00
DISTFILES =
CATEGORIES = databases
PERMIT_PACKAGE_CDROM = Yes
PERMIT_PACKAGE_FTP = Yes
PERMIT_DISTFILES_CDROM = Yes
PERMIT_DISTFILES_FTP = Yes
2011-09-10 06:43:06 -04:00
BUILD_DEPENDS = databases/sqlports,-compact>= 1.18 \
databases/sqlite3
do-build :
2011-09-24 03:37:34 -04:00
@if test -s ${ WRKBUILD } /ouch; then \
cat ${ WRKBUILD } /ouch; \
exit 1; \
fi
2010-01-08 09:00:49 -05:00
do-install :
${ INSTALL_DATA } ${ WRKBUILD } /pkglocatedb ${ PREFIX } /share
2011-09-11 12:12:34 -04:00
${ SUBST_CMD } -o root -g bin -c ${ FILESDIR } /pkglocate ${ PREFIX } /bin/pkg_locate
chmod ${ BINMODE } ${ PREFIX } /bin/pkg_locate
ln -s ${ TRUEPREFIX } /bin/pkg_locate ${ PREFIX } /bin/pkglocate
2010-01-08 09:00:49 -05:00
NO_REGRESS = Yes
. i n c l u d e < b s d . p o r t . m k >
2011-09-10 06:43:06 -04:00
# XXX cheat a bit to avoid having two makefiles
do-build : ${WRKBUILD }/pkglocatedb
${WRKBUILD}/subdirlist :
2011-09-24 03:37:34 -04:00
sqlite3 ${ LOCALBASE } /share/sqlports-compact 'select min(paths.fullpkgpath||ports.pseudo_flavor) from paths join ports on paths.id=ports.fullpkgpath group by fullpkgname order by paths.fullpkgpath' >$@
2011-09-10 06:43:06 -04:00
${WRKBUILD}/pkglocatedb : ${WRKBUILD }/subdirlist
2011-09-24 03:37:34 -04:00
SUBDIRLIST = ${ WRKBUILD } /subdirlist FULLPATH = Yes REPORT_PROBLEM_LOGFILE = ${ WRKBUILD } /ouch pkg_mklocatedb -a -p ${ PORTSDIR } > $@