diff options
author | agc <agc@pkgsrc.org> | 2007-08-20 21:44:03 +0000 |
---|---|---|
committer | agc <agc@pkgsrc.org> | 2007-08-20 21:44:03 +0000 |
commit | 3f175c6486c472aa598a76af6291462551050476 (patch) | |
tree | 24cf74bc5e45a9f33db17705cb2e80396c534847 /pkgtools/genrpm | |
parent | 446a0e15d2205d30bd9c9c8c7aea9e96985f4b32 (diff) | |
download | pkgsrc-3f175c6486c472aa598a76af6291462551050476.tar.gz |
Add DESTDIR support
Make symbolic links to directories in the appropriate way
Change email addres sto match current preferences
Diffstat (limited to 'pkgtools/genrpm')
-rw-r--r-- | pkgtools/genrpm/Makefile | 13 | ||||
-rw-r--r-- | pkgtools/genrpm/files/genrpm | 25 |
2 files changed, 27 insertions, 11 deletions
diff --git a/pkgtools/genrpm/Makefile b/pkgtools/genrpm/Makefile index 7071b6ed7a6..3a37beb40c8 100644 --- a/pkgtools/genrpm/Makefile +++ b/pkgtools/genrpm/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.5 2007/07/14 14:51:19 agc Exp $ +# $NetBSD: Makefile,v 1.6 2007/08/20 21:44:03 agc Exp $ DISTNAME= genrpm-1.1 CATEGORIES= pkgtools @@ -14,6 +14,8 @@ DEPENDS+= rpm-[0-9]*:../../misc/rpm PKG_INSTALLATION_TYPES= overwrite pkgviews +PKG_DESTDIR_SUPPORT= user-destdir + WRKSRC= ${WRKDIR} NO_CHECKSUM= yes @@ -34,8 +36,11 @@ do-build: .endif do-install: - ${INSTALL_SCRIPT} ${WRKSRC}/genrpm ${PREFIX}/sbin - ${INSTALL_MAN} ${WRKSRC}/genrpm.0 ${PREFIX}/${PKGMANDIR}/cat8 - ${INSTALL_MAN} ${WRKSRC}/genrpm.8 ${PREFIX}/${PKGMANDIR}/man8 + ${INSTALL_PROGRAM_DIR} ${DESTDIR}${PREFIX}/sbin + ${INSTALL_MAN_DIR} ${DESTDIR}${PREFIX}/${PKGMANDIR}/cat8 + ${INSTALL_MAN_DIR} ${DESTDIR}${PREFIX}/${PKGMANDIR}/man8 + ${INSTALL_SCRIPT} ${WRKSRC}/genrpm ${DESTDIR}${PREFIX}/sbin + ${INSTALL_MAN} ${WRKSRC}/genrpm.0 ${DESTDIR}${PREFIX}/${PKGMANDIR}/cat8 + ${INSTALL_MAN} ${WRKSRC}/genrpm.8 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man8 .include "../../mk/bsd.pkg.mk" diff --git a/pkgtools/genrpm/files/genrpm b/pkgtools/genrpm/files/genrpm index 626cf8ccf48..5f5deadda2a 100644 --- a/pkgtools/genrpm/files/genrpm +++ b/pkgtools/genrpm/files/genrpm @@ -1,6 +1,6 @@ #! @SH@ -# $NetBSD: genrpm,v 1.2 2007/07/14 14:51:19 agc Exp $ +# $NetBSD: genrpm,v 1.3 2007/08/20 21:44:03 agc Exp $ # # Copyright © 2005,2007 Alistair Crooks. All rights reserved. @@ -31,7 +31,7 @@ # small shell script to convert from an installed NetBSD package to an rpm # -# Usage: pkg2rpm [--distdir=distdir] [--objdir=objdir] [--rpmdir=rpmdir] [--srpmdir=srpmdir] [--sign] [-s] [-v] pkgname +# Usage: genrpm [--distdir=distdir] [--objdir=objdir] [--rpmdir=rpmdir] [--srpmdir=srpmdir] [--sign] [-s] [-v] pkgname # find a program and set a global variable with its path check_prog() @@ -138,10 +138,21 @@ safemkdir ${rpmdir} safemkdir ${rpmdir}/${arch} safemkdir ${srpmdir} -(cd $redhatdir && ${ln_cmd} -s $objdir/rpm BUILD) -(cd $redhatdir && ${ln_cmd} -s $rpmdir RPMS) -(cd $redhatdir && ${ln_cmd} -s $srpmdir SRPMS) -(cd $redhatdir && ${ln_cmd} -s $objdir/rpm/SOURCES SOURCES) +if [ ! -e ${redhatdir}/BUILD ]; then + (cd $redhatdir && ${ln_cmd} -s $objdir/rpm BUILD) +fi + +if [ ! -e ${redhatdir}/RPMS ]; then + (cd $redhatdir && ${ln_cmd} -s $rpmdir RPMS) +fi + +if [ ! -e ${redhatdir}/SRPMS ]; then + (cd $redhatdir && ${ln_cmd} -s $srpmdir SRPMS) +fi + +if [ ! -e ${redhatdir}/SOURCES ]; then + (cd $redhatdir && ${ln_cmd} -s $objdir/rpm/SOURCES SOURCES) +fi # check that we have required packages installed for p in $reqpkgs; do @@ -207,7 +218,7 @@ while [ $# -gt 0 ]; do echo "Release: %{release}" >> $specfile echo "Copyright: unknown" >> $specfile echo "URL: `${pkg_info_cmd} -d $name | ${awk_cmd} 'BEGIN { homepage=\"http://www.pkgsrc.org\"; }/^Homepage:/ { getline; homepage=$0 } END { print homepage }'`" >> $specfile - echo "Packager: Alistair Crooks <genrpm@alistaircrooks.com>" >> $specfile + echo "Packager: Alistair Crooks <agc@pkgsrc.org>" >> $specfile echo "Distribution: ${DISTRIBUTION}" >> $specfile echo "Vendor: ${DISTVENDOR}" >> $specfile echo "Prefix: ${pkgprefix}" >> $specfile |