pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/genrpm Add DESTDIR support



details:   https://anonhg.NetBSD.org/pkgsrc/rev/0dd94ba37261
branches:  trunk
changeset: 532489:0dd94ba37261
user:      agc <agc%pkgsrc.org@localhost>
date:      Mon Aug 20 21:44:03 2007 +0000

description:
Add DESTDIR support

Make symbolic links to directories in the appropriate way
Change email addres sto match current preferences

diffstat:

 pkgtools/genrpm/Makefile     |  13 +++++++++----
 pkgtools/genrpm/files/genrpm |  25 ++++++++++++++++++-------
 2 files changed, 27 insertions(+), 11 deletions(-)

diffs (88 lines):

diff -r a4fd6bf68e19 -r 0dd94ba37261 pkgtools/genrpm/Makefile
--- a/pkgtools/genrpm/Makefile  Mon Aug 20 21:42:26 2007 +0000
+++ b/pkgtools/genrpm/Makefile  Mon Aug 20 21:44:03 2007 +0000
@@ -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 @@
 
 PKG_INSTALLATION_TYPES=        overwrite pkgviews
 
+PKG_DESTDIR_SUPPORT=   user-destdir
+
 WRKSRC=                ${WRKDIR}
 NO_CHECKSUM=   yes
 
@@ -34,8 +36,11 @@
 .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 -r a4fd6bf68e19 -r 0dd94ba37261 pkgtools/genrpm/files/genrpm
--- a/pkgtools/genrpm/files/genrpm      Mon Aug 20 21:42:26 2007 +0000
+++ b/pkgtools/genrpm/files/genrpm      Mon Aug 20 21:44:03 2007 +0000
@@ -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}/${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 @@
                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@localhost>" >> $specfile
+               echo "Packager: Alistair Crooks <agc%pkgsrc.org@localhost>" >> $specfile
                echo "Distribution: ${DISTRIBUTION}" >> $specfile
                echo "Vendor: ${DISTVENDOR}" >> $specfile
                echo "Prefix: ${pkgprefix}" >> $specfile



Home | Main Index | Thread Index | Old Index